This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Homework #4 Topic: Numerical Differentiation Due: Thurs. Feb. 25 by the beginning of class (please email your code to jgladden@olemiss.edu ) 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
This note was uploaded on 10/05/2010 for the course PHYS phy503 taught by Professor Gladden during the Spring '09 term at Ole Miss.
 Spring '09
 Gladden
 Work

Click to edit the document details