Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. Often we are concerned mainly with how accurate a given numerical algorithm i

ID: 3888186 • Letter: 2

Question

2. Often we are concerned mainly with how accurate a given numerical algorithm is, i.e. how small the error is for a given step size h. In some cases though, using a particular numerical method might result in a solution that is completely off. To see this, consider the initial value problem y(0)- where y-y(t) is a function of time 0st in minutes (a) Use numero s.m plot the estimated solution for step sizes h 0.5, 0.25, 0.1 and 0.05 min- utes. How do these compare to the exact solution y e8 What step sizes give a fairly accurate result? What step sizes give extremely bad approximations? b) If instead we use Runge-Kutta in part (a), does our estimated solution track the real solution better? Use numerics.m to plot your results. What step sizes give a fairly accurate result? What step sizes give extremely bad approximations? Hint: One way to plot the exact solutions and the numerical solutions on the same graph is to use following codes after you plot the numerical solutions: hold on t-e = 0:0.01:3; plot (te exp(-8.e)'newidth',2) legend ( 'Numerica 'Exact)

Explanation / Answer

Forward Euler: y1 = y0 + h*f(x0,y0)

Backward Euler solve in y1: y1 - h*f(x1,y1) = y0

Your method: y1 = y0 +h*f(x0,x0+h*f(x0,y0))

Your method is not backward Euler.

You don't solve in y1, you just estimate y1 with the forward Euler method. I don't want to pursue the analysis of your method, but I believe it will behave poorly indeed, even compared with forward Euler, since you evaluate the function f at the wrong point.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote