Question: Write a python program that implements the central, forward, and backward difference approaches. Use this program to calculate the numerical derivative of the function f(x)

 Write a python program that implements the central, forward, and backward

Write a python program that implements the central, forward, and backward difference approaches. Use this program to calculate the numerical derivative of the function f(x) = sin(2) at the point x = 0.5. The program should have a function that compares the true derivative to the numerical one, and computes the percentage error to quantify this difference between the true and computed values: error = yiyi 1.100 where y; is the true value at a point and ; is the estimate you are computing through numerical differentiation. Use this program to calculate a range of different h values, using h=2 with z ranging from -50 to 1. For each value of h, compute the percent error. Make a log/log plot of h vs the percent error for all three estimates. What value of h minimizes the error for each estimate? Which method is best to use

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 Databases Questions!