`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
clc
%%Matlab code for forward backward and central difference
method
clear all
close all
%function for which derivative have to find
f=@(x) exp(-2*x)-x;
%Function for exact derivative of function
df=@(x) (-2*exp(-2*x))-1;
%exact solution for f'(x) at x=2
ext_val=df(2);
%x value at which derivative have to find
x0=2;
%all h values
hh=linspace(0.5,0.01,40);
%loop for forward backward and central difference formulae
fprintf('\th,\tcntrl_diff,\tfrwd_diff,\tbkwd_diff\n')
for i=1:length(hh)
%all step size
h=hh(i);
%central diff
cn_frwd(i)=(f(x0+h)-f(x0-h))/(2*h);
%forward diff
fd_frwd(i)=(-f(x0+2*h)+4*f(x0+h)-3*f(x0))/(2*h);
%backward diff
bk_frwd(i)=(3*f(x0)-4*f(x0-h)+f(x0-2*h))/(2*h);
%exaxt differential
ext_diff(i)=ext_val;
%printing the result
fprintf('\t%.2f, \t%.4f, \t %.4f, \t
%.4f.\n',h,cn_frwd(i),fd_frwd(i),bk_frwd(i))
end
%Loglog plot of true error vs h
plot(hh,cn_frwd,'linewidth',2)
hold on
plot(hh,fd_frwd,'linewidth',2)
plot(hh,bk_frwd,'linewidth',2)
plot(hh,ext_diff,'linewidth',2)
xlabel('step size (h)')
ylabel('numerical differential')
title('numerical differential vs. step size plot')
legend('Central difference','Forward difference','Backward
difference','exact differential')
Kindly revert for any queries
Thanks.
please i need the requiered MATLAB script to solve this. All calculations need to be done in matlab please Design Layout References Mailings Review View Share 1) (15 points) Calculate the followi...
please show me a Matlab script that will compute the total errors of the approximation due to the given function, also include the panel plot as well, thank you. 1) This problem studies the errors due to the approximation of the first derivative of a given function f(x) using the forward and centered difference methods. For this problem, we consider f(x)=sin(x). a) First, we will investigate the effect of the step size h on the first derivative approximation. Set h=10',...
I need some help with this. et cred 1. Word Sign in References Mailings Review View Help Tell me what you want to do S Shani Optimization Questions 1. You've been hired by Nielsen Company to study the market for potatoes. Demand in the potato market is characterized by the demand function QQdd 25-12 PP. Where Pis the market price of a potato and Odd is the quantity of potatoes demanded. The marginal revenue of the fifth potato produced is...
Edit View Insert Format Tools Table Window Help nsert Design Layout References Mailings Review » share Calibri (Body) ,1111 | A-Av A-A2 Styles a the degree of relationship without regard to the torm of the relationship b. the degree to which the relationship is consistently multi-directional c. the degree of linear relationship d. the degree of curvilinear relationship A scatter plot shows a set of data points that are clustered close to a line that slopes down to the right....
5 Mailings Review View Help Design Layout Search Experimental design and procedures: 1. Use the picture provided to count the number of yellow and purple corn kernels. You should count ALL of the kernels visible in the picture. Each kernel is a seed-seeds are baby plants. Therefore, each kernel represents an offspring of the plant cross. Enter these observed Values into Table 1. Page 6 3 f BE 2. Tally the total number of offspring that are yellow and purple...
I need to solve this using Matlab please type comments in the script so I understand thank you. Create a table (similar to what we do in class) with all the parameters that you have to calculate for every step in the solution. Include y and dy/dx in the same plot with points from your table joined by straight lines (and clearly indicate which line correspond to what). You may use the MATLAB function you created above. Solve the following...
please I need help with this Ch.3 HH2) Layout References Mailings Review Home Insert Draw Design Times New Roman 12 - D BIU.abx, * AO Paste A.D.A.A. AA Clipboard Font Ibrahim Ojoma Abdullahi View Help Acrobat - DD 9 Search E. Styles Editing - AL Paragraph Liti Create and Share Request Adobe PDF Signatures Adobe Acrobat Dictate Styles Voice Principles of Accounting 1 Chapter 3 Homework Gordon Corporation is a rental car company owned and operated by Jeff Gordon. On...
Can I please get help with these 2 questions, thank you! G- Search in Docuiment Home Insert Design Layout References Mailings Review View & Share A chemical reaction is observed to convert Molecule A into Molecule B. The accompanying graph plots the change in concentration for both molecules against the change in time. Use this graph to determine the stoichiometry of this equation, if it is written as: Kinetics Graph for the Decomposition from A into B 1.40 1.20 1.00...
problem 3-1 please answer inside the chart. Draw + Design Layout References View Mailings Review Help Awigancats 160 44 6 50 145 20 165 192 Comprehensive Problems Neto e Chapter 3 Honorkadets below to solve problems 3/ how 3.3. Extreme Edge, Inc Income Sun For the Years Hinded December 31, 2013, 2012 and 2011 (5 in thousands) Accounts payable Accueities Total current liabilities Long-term has Notes payable Total Liabilities 100 350 100 265 100 40 50 410 2011 2013 51.340...
sseument Part& Pretected Viei)Word Mailings Review View Help Tell me what you want to do Enable Editing ruses. Unless you need to edit, it's safer to stay in Protected View 1. Two variables have a strong negative correlation. Which of the following statements is not true? a. the dependent variable decreases as the independent variable increases b. the trend of the data exhibits an irregular decline c. the line of best fit has a negative slope d. most data points...