{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw4 - Homework#4 Topic Numerical Differentiation Due Thurs...

This preview shows page 1. Sign up to view the full content.

Physics 503: Scientific Computing Homework #4 Topic: Numerical Differentiation Due: Thurs. Feb. 25 by the beginning of class (please email your code to ) Assignment 1. Compare the errors for the central, forward, backward difference methods for stencil ( h ) values with a range of values between [1e-5:1e-1] 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 [1e-13:1e-5]. 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. Physics 503: Scientific Computing
This is the end of the preview. Sign up to access the rest of the document.

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 [1e-5:1e-1] 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 [1e-13:1e-5]. 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

{[ snackBarMessage ]}

Ask a homework question - tutors are online