Question: Create a function, mynumdiff ( f , x ) to compute the derivative of the function f ( x ) where x is the grid
Create a function, mynumdiff to compute the derivative of the function where is the
grid on which has been computed. Assume Groups I,IIGroups
III,IV and expGroups VVIVII Call mynumdiff between the limits of as
pi having grid points equally spaced at a distance dx marks
a Compute the derivative using the forward difference, backward difference and central
difference formula and plot the analytical derivative on the same graph.
b Compute the error at each point for different values of dx varying by atleast orders
of magnitude and plot on a separate loglog graph for each difference formula.
c Plot max error in the entire domain as function of dx for all the three difference
formulae on the same graph. What do you observe?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
