1. Math
  2. Advanced Math
  3. using matlab sample function dfnumericalderivativefunxhdffunxhfunxhforward schemedffunxhfunxhbackward schemedffunxhfunxh2hcentral finite difference...

Question: using matlab sample function dfnumericalderivativefunxhdffunxhfunxhforward schemedffunxhfunxhbackward schemedffunxhfunxh2hcentral finite difference...

Question details

1) Compute the numerical derivative of f(x) xex for Xi = i- , 10 0,1. 10 by using the following formula with h0.01; faa -2h) -8f(a -h)+8f(a+h) -f(a +2h)] 2) Compare the difference between numerical and real derivatives for each x; 3) Test the accuracy order for the formula (*) numerically

Using matlab

sample

function df=Numerical_derivative(fun,x,h)df=(fun(x+h)-fun(x))/h;%forward schemedf=(fun(x+h)-fun(x))/h;%backward schemedf=(fun(x+h)-fun(x-h))/2/h;%central finite difference

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution