Unformatted text preview: Homework #4 Topic: Numerical Differentiation Due: Thurs. Feb. 25 by the beginning of class (please email your code to [email protected] ) Assignment 1. Compare the errors for the central, forward, backward difference methods for stencil ( h ) values with a range of values between [1e5:1e1] by computing the derivative of f ( x ) = x sin(2 x ) for the range x =[0:5] and comparing with the exact value. Plot the computed and exact values together on a plot with a legend showing the h value. 2. Now compute the above derivative at a particular x value (say x =2.5) using the central and forward difference methods for a wide range of h values [1e13:1e5]. Make a plot of the error vs h value for each of the methods. Note the trends and make comments about how they differ. How do those trends relate to the theory we discussed in class. Also comment about what happens at very small h values and why....
View
Full Document
 Spring '09
 Gladden
 Numerical Analysis, Work, finite difference, Numerical Differentiation, difference methods

Click to edit the document details