Euler’s Method — Question 7

PDF ↗

Question 7

For y′=1−yy'=1-y, y(0)=0y(0)=0, use explicit Euler to reach t=1t=1 with NN equal steps, h=1/Nh=1/N. Assume exact arithmetic and define the signed error En=Yn−y(tn)E_n=Y_n-y(t_n). You may use 0≤e−h−1+h≤h2/20\le e^{-h}-1+h\le h^2/2 for 0<h≤10<h\le 1.

Tasks

  1. Find the exact solution and a closed formula for the Euler sequence. Determine the sign of EnE_n.

  2. Derive an error recurrence using the one-step defect evaluated from the exact solution.

  3. Prove 0≤En≤(h/2)[1−(1−h)n]≤h/20\le E_n\le(h/2)[1-(1-h)^n]\le h/2. Use the simpler last bound to choose an integer NN guaranteeing endpoint error at most 0.0050.005.

  4. For your chosen NN, calculate the actual endpoint error from the closed formulas. Explain the difference between a guaranteed bound and an observed error, and state which arithmetic assumption the proof uses.

Original worksheet page 1: question and worked solution for 2-9-007
Show solutionHide solution

Question 7 – Solution

Strategy. Exploit the contracting error recurrence to turn a local defect bound into a rigorous global guarantee.

Step 1: Solve both continuous and discrete problems. The exact solution is y(t)=1−e−ty(t)=1-e^{-t}. Euler gives Yn+1=(1−h)Yn+hY_{n+1}=(1-h)Y_n+h, so Yn=1−(1−h)n,En=e−nh−(1−h)n≥0.\boxed{Y_n=1-(1-h)^n},\qquad E_n=e^{-nh}-(1-h)^n\ge 0. For 0<h<10<h<1, the sign follows from 1−h<e−h1-h<e^{-h}; at h=1h=1, it follows directly for n≥1n\ge 1. At n=0n=0, both solutions are zero.

Step 2: Isolate the local defect. Starting Euler at the exact value at tnt_n, its overshoot of the exact next value is dn=y(tn)+h[1−y(tn)]−y(tn+h)=e−tn(e−h−1+h).d_n=y(t_n)+h[1-y(t_n)]-y(t_n+h) =e^{-t_n}(e^{-h}-1+h). Therefore 0≤dn≤h2/20\le d_n\le h^2/2, and subtracting the exact update from the numerical one gives En+1=(1−h)En+dn,E0=0.\boxed{E_{n+1}=(1-h)E_n+d_n,\qquad E_0=0}.

Step 3: Sum the propagated defects. Since 0≤1−h<10\le 1-h<1, iteration gives 0≤En≤h22∑j=0n−1(1−h)j=h2[1−(1−h)n]≤h2.0\le E_n\le\frac{h^2}{2}\sum_{j=0}^{n-1}(1-h)^j =\frac h2[1-(1-h)^n]\le\frac h2. Thus 1/(2N)≤0.0051/(2N)\le 0.005 is sufficient. The smallest integer supplied by this simpler bound is N=100\boxed{N=100}, with h=0.01h=0.01. This is not a claim that no smaller NN could meet the tolerance using a sharper analysis.

Step 4: Evaluate the actual error. For that grid, E100=e−1−(0.99)100≈0.00184710<0.005.\boxed{E_{100}=e^{-1}-(0.99)^{100}\approx 0.00184710<0.005}. The proven bound controls the error without assuming a particular observed cancellation or leading asymptotic term. Its conservatism explains the smaller actual error. Both the recurrence and this guarantee assumed exact arithmetic; step-by-step rounding would add another error term and require a separate bound.

Original worksheet page 2: question and worked solution for 2-9-007

Original worksheet layout. Use Enlarge or open the PDF for a closer view.