Project Description
This project studies numerical errors, which are composed of two parts: the roundoff errors and the truncation errors. We will first work on the truncation errors by numerically approximating the second derivative of a given function at a point with two methods of different accuracy as in a) and b). Following that, in c) we will keep on reducing the truncation error (using smaller and smaller h) until roundoff error in Matlab starts to dominate the truncation error.
- Recall that given function f(x), the second order derivative of f(x), f00(x) can be approxh h
imated by the forward difference approximation,.
Let f(x) be a function of your pick (do not use f(x) = ex), and compute f00(x) numerically at x = a of your pick with h = 0.1,0.05,0.025,0.0125,0.00625,0.003125. Present a table with the following format. column 1: h, column 2: ), column 3: ), column 4: (f00(a) D+f2(a))/h, column 5: (. column 6: order. Output your table in a professional way by formatting the tabular data appropriately.
- Repeat for the centered difference approximation,, which also approximates f00(x).
- Modify the Matlab code given in class to plot the error in) and ) for step size h = 1/2j with j = 0 : 64. Use log scales for the error |f00(a) D2f(a)| and step size h. Plot both cases on the same graph in a professional (hint: use hold on command).
Project Specification
Your project submission is composed two parts: the paper submission and the e-submission. The paper submission includes 1) (hand written or print) the front page with project title, course, section, date, name, department/program, etc.; 2) (hand written or print) the page for deriving the convergence order of) and); 3) (print) the published results which should be divided into sections and include comments in discussing the pattern observed from tables and graphs. Note the discussion will contribute significantly to your project score thus please be comprehensive, precise, and concise. The e-submission is the matlab code (in one .m file) uploaded via link provided from Canvas. I will grade on the paper submission but will download and run your code when needed.
Note: You can discuss the project with each other but coding must be finished independently.
Reviews
There are no reviews yet.