Computational Physics - Assignment 3: Submission Date: June 07, 2021
Computational Physics - Assignment 3: Submission Date: June 07, 2021
2. Numerical Differentiation
Use the forward-difference, central-difference, and extrapolated-difference algorithms to
differentiate the function at
a) Print out the derivative and its relative error as functions of . Reduce the step size
until it equals machine precision .
b) Plot and check whether the number of decimal places obtained
agrees with the estimates in our lecture note. If it doesn’t agree explain why?
c) See if you can identify regions where truncation error dominates at large and round-
off error at small in your plot.
3. Numerical Integration
Write a FORTRAN program to calculate
using the trapezoid and Simpson rule and investigate its accuracy for various values of N (5,
7, 9 , 11, 21, 51,101). Present your data in the tabular form. (Hint: Split the range of
integration into two parts and make a different change of variable in each integral to handle
the singularities.)