Euler’s Method — Question 2

PDF ↗

Question 2

For y′=yy'=y, y(0)=1y(0)=1, apply explicit Euler on [0,1][0,1] with NN equal steps and h=1/Nh=1/N. Let YNY_N denote its endpoint value. You may use ln⁡(1+h)=h−h2/2+O(h3)\ln(1+h)=h-h^2/2+O(h^3) and ez=1+z+O(z2)e^z=1+z+O(z^2) as the arguments tend to zero.

Tasks

  1. Derive a closed formula for YNY_N and prove that it underestimates the exact endpoint for every positive integer NN.

  2. Compute the one-step defect when Euler starts from an exact value y(tn)y(t_n). Show that this defect is of order h2h^2.

  3. Derive the leading endpoint error as h→0h\to 0 and explain why its order differs from that of the one-step defect.

  4. Calculate endpoint values and absolute errors for N=2,4,8N=2,4,8. Explain what error reduction is expected when NN doubles and what the computation cost does.

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

Question 2 – Solution

Strategy. Solve the discrete recurrence exactly, then compare its logarithm with the continuous exponential growth.

Step 1: Find and bound the endpoint. Euler gives Yn+1=(1+h)YnY_{n+1}=(1+h)Y_n, so YN=(1+1/N)N.\boxed{Y_N=(1+1/N)^N}. The exact solution is ete^t. Since ln⁡(1+h)<h\ln(1+h)<h for h>0h>0, Nln⁡(1+1/N)<1N\ln(1+1/N)<1 and hence YN<eY_N<e. This is an underestimate for every grid, not merely for the three grids below.

Step 2: Define the one-step defect. Starting with the exact value etne^{t_n}, the difference between the exact next value and one Euler step is dn=etn+h−etn(1+h)=etn(eh−1−h)=12etnh2+O(h3).d_n=e^{t_n+h}-e^{t_n}(1+h) =e^{t_n}(e^h-1-h)=\tfrac 12e^{t_n}h^2+O(h^3). On 0≤tn≤10\le t_n\le 1, this is uniformly O(h2)O(h^2). Here defect means an error in solution value; dividing it by hh would use a different convention.

Step 3: Derive the accumulated error. Because Nh=1Nh=1, ln⁡YN=ln⁡(1+h)h=1−h2+O(h2).\ln Y_N=\frac{\ln(1+h)}h=1-\frac h2+O(h^2). Exponentiating gives YN=e(1−h/2+O(h2))Y_N=e(1-h/2+O(h^2)), so e−YN=e2h+O(h2).\boxed{e-Y_N=\frac e2h+O(h^2)}. There are N=1/hN=1/h steps over the fixed interval, and their defects propagate through later updates. An O(h2)O(h^2) one-step defect therefore need not yield an O(h2)O(h^2) endpoint error; here the accumulated error is first order.

Step 4: Compare the grids. NYNe−YN22.2500000.46828242.4414060.27687682.5657850.152497\begin{array}{c|c|c} N&Y_N&e-Y_N\\\hline 2&2.250000&0.468282\\ 4&2.441406&0.276876\\ 8&2.565785&0.152497 \end{array} The errors approach a factor-of-two reduction under each doubling of NN, because their leading term is proportional to hh. Exact halving is not promised on coarse grids. The number of slope evaluations doubles, exposing the first-order accuracy versus work tradeoff.

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

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