Skip to main content
留学咨询

辅导案例-CSE3365

By May 15, 2020No Comments

Math3315 / CSE3365 Spring 2019 Project 1 due: Fri., Oct. 18, 2019 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 approx- imating 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. a) Recall that given function f(x), the second order derivative of f(x), f ′′(x) can be approx- imated by the forward difference approximation, D2+f(x) = f(x + 2h)− 2f(x + h) + f(x) h2 . Let f(x) be a function of your pick (do not use f(x) = ex), and compute f ′′(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: D2+f(a), column 3: f ′′(a) − D2+f(a), column 4: (f ′′(a) − D+f 2(a))/h, column 5: (f ′′(a) − D2+f(a))/h2. column 6: order. Output your table in a professional way by formatting the tabular data appropriately. b) Repeat for the centered difference approximation, D20f(x) = f(x + h)− 2f(x) + f(x− h) h2 , which also approximates f ′′(x). c) Modify the Matlab code given in class to plot the error in D2+f(a) and D 2 0f(a) for step size h = 1/2j with j = 0 : 64. Use log scales for the error |f ′′(a)−D2f(a)| and step size h. Plot both cases on the same graph in a professional way. (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 ti- tle, course, section, date, name, department/program, etc.; 2) (hand written or print) the page for deriving the convergence order of D2+f(x) and D 2 0f(x); 3) (print) the published re- sults 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.

admin

Author admin

More posts by admin