Question: Problem 4 Verify your fourth _ order _ diff ( ) function by performing a convergence analysis on the following function: f ( x )

Problem 4
Verify your fourth_order_diff() function by performing a convergence analysis on the following function:
f(x)=exp(-x)
To do this, let's select a single point x=0.6 and a series of heights h=1,0.5,13,0.25,0.2,16,17,18,19. For each height, compute the error between the numerical derivative and the exact derivative, -exp(-0.6). The error is the absolute value of the difference between the output of your function, and the value of the exact derivative.
In your write up, include a line plot of h vs error. Then, verify that we see O(h4) convergence rate by estimating the convergence rate the following way: Ratei=log(errori+1/errori)/log(hi+1/hi) for i=1,2....,8
In your write up print this rate vector and include a screenshot of your code which generated the plot and estimated the convergence rate.
Problem 4 Verify your fourth _ order _ diff ( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!