hw5 - Physics 503: Scientific Computing Homework #5 Topic:...

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

View Full Document Right Arrow Icon
Physics 503: Scientific Computing Homework #5 Topic: Numeric Integration Due: Thurs. Mar. 4 by the beginning of class (please email your code to jgladden@olemiss.edu ) Assignment 1. Evaluate the definite integral x sin( x ) dx = π 0 using both the trapezoid and Simpson’s 1/3 methods for a range of panels (say between 10 and 100). Plot the |error| for each method as a function of the number of panels (might want a log-log plot for this). 2. Use the polyfit() function in pylab to fit the errors for each of the above methods to a power law function. Discuss the different powers of number of panels each method seems to follow. HINT: remember you can linearize a power law by taking the log of both sides of the equation, then fit the log of the data to a line -> the slope will then be the exponent. 3. Apply the Richardson extrapolation method to the trapezoid function to improve the accuracy. Compare errors for with and without Richardson for an integral of your choice for a few
Background image of page 1
This is the end of the preview. Sign up to access the rest of the 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.

Ask a homework question - tutors are online