Why Compare Euler and Exact Logistic Predictions?
The Euler method gives a step-by-step estimate of a population governed by a differential equation. When an explicit solution is available, we can evaluate it at the same times as the Euler estimates and measure how closely the numerical method tracks the model’s exact prediction.
A useful comparison must be made at matching times. Comparing an Euler estimate at one time with an exact value at another would mix numerical error with the effect of elapsed time. Once the times agree, the difference measures the discrepancy between the two predictions for that model.
This comparison helps answer practical questions: Is a step size accurate enough for the purpose? Does halving the step noticeably improve the result? Is the Euler estimate above or below the exact prediction? The calculation also requires care: rounding intermediate steps too soon can distort the final error.
The Two Predictions at Matching Times
Consider the logistic differential equation
where \(y(t)\) is population, \(r>0\) is the growth rate, and \(K>0\) is the carrying capacity. For an initial population \(y(0)=y_0\) with \(0<y_0<K\), its explicit solution is
For step size \(h>0\), Euler’s method starts with \(Y_0=y_0\) and repeatedly applies the current rate:
Here \(Y_n\) is the Euler estimate at time \(t_n=nh\), while the exact value at that time is \(y(t_n)\). At a target time \(T\), choose \(h\) so that \(T=Nh\) for a whole number \(N\) of steps, or otherwise adjust the final step to land exactly at \(T\). Then compare \(Y_N\) with \(y(T)\).
With this signed-error convention, \(e_n>0\) means the Euler estimate is below the exact value, and \(e_n<0\) means it is above. The absolute error measures the size of the difference without regard to its direction.
Why the Errors Develop
The Euler update uses the rate at the beginning of each step to estimate the change over the whole step. To describe the difference from the exact solution, write the exact change over one step as the Euler-style change from the exact starting value, plus a remainder:
This equation defines \(\tau_n=y(t_{n+1})-y(t_n)-h f(y(t_n))\), the one-step defect when the exact solution is used as the starting value. Subtract the Euler update \(Y_{n+1}=Y_n+h f(Y_n)\) from both sides:
This identity shows two sources of discrepancy: the existing error affects the next rate, and a new one-step defect is introduced. Consequently, the final difference is not merely one local error; errors from successive steps interact as the calculation proceeds. The earlier material on Euler error explains why, under suitable smoothness conditions, the global error commonly scales in proportion to the step size. The exact size and direction of the error still depend on the particular solution and the time being considered.
Worked Example: Four Euler Steps and the Exact Value
Worked Example: Four Euler Steps and the Exact Value
Use \(K=100\), \(r=0.5\), \(y(0)=20\), and \(h=0.25\) to estimate the population at \(t=1\). Compare the Euler estimate with the explicit logistic value and find the absolute error.
The step times are \(0,\ 0.25,\ 0.50,\ 0.75,\ 1.00\), so four updates reach the target. In this example, the Euler update is
Starting from \(Y_0=20\), the first increment is
The second increment is
The third increment is
so \(Y_3=24.145+2.28939871875=26.43439871875\). The fourth increment is
Thus the four increments sum to approximately \(8.8652267641\), and
Now evaluate the exact solution at \(t=1\). Since \(\frac{K-y_0}{y_0}=\frac{80}{20}=4\),
The signed error is \(29.1875133-28.8652267641\approx0.3222865\). The absolute error is therefore about \(0.3223\) population units. The positive signed error confirms that the Euler estimate is below the exact value. Both numbers refer to \(t=1\), so this is a valid matched-time comparison.
Worked Example: What Happens When the Step Size Changes?
Worked Example: What Happens When the Step Size Changes?
Keep the same logistic model and target time \(t=1\), but compare step sizes \(h=1\), \(h=0.5\), and \(h=0.25\). The exact value, calculated above, is approximately \(29.1875133\).
With \(h=1\), one update gives
The absolute error is \(|29.1875133-28|=1.1875133\), or approximately \(1.1875\) population units.
With \(h=0.5\), the first update is
The second update is
This reaches \(t=1\), and its absolute error is \(|29.1875133-28.56|=0.6275133\), or approximately \(0.6275\) population units.
For \(h=0.25\), the four-step result is \(28.8652267641\), with absolute error approximately \(0.3223\) population units. The results are:
| Step size | Euler estimate at \(t=1\) | Absolute error |
|---|---|---|
| \(1\) | \(28\) | \(1.1875\) |
| \(0.5\) | \(28.56\) | \(0.6275\) |
| \(0.25\) | \(28.8652\) | \(0.3223\) |
For this model and target time, halving the step size reduces the absolute error each time. It does not divide the error by exactly two: the ratios vary because Euler’s errors accumulate along a changing nonlinear trajectory.
Worked Example: Testing an Accuracy Requirement
Worked Example: Testing an Accuracy Requirement
Suppose the estimate at \(t=1\) must be within \(0.35\) population units of the exact logistic prediction for the same model. Which of the three step sizes in the comparison satisfies this requirement?
The requirement is that the absolute error be at most \(0.35\). For \(h=1\), the error is approximately \(1.1875\), and \(1.1875>0.35\), so this step size fails. For \(h=0.5\), the error is approximately \(0.6275\), and \(0.6275>0.35\), so this step size also fails. For \(h=0.25\), the error is approximately \(0.3223\), and \(0.3223<0.35\), so it meets the requirement.
Therefore, among these tested choices, \(h=0.25\) is adequate. This conclusion applies to the stated model, target time, and tolerance. It does not establish that the same step size is adequate for a different model or a different target time.
If an error requirement is given as a percentage instead, calculate relative percent error using the exact value as the denominator. For \(h=0.25\), for example, it is approximately
An absolute tolerance and a relative tolerance answer different questions. An absolute tolerance sets a fixed population-unit difference; a relative tolerance measures the discrepancy as a fraction of the exact prediction.
A Common Pitfall: Mixing Up the Increments and Their Sum
A multi-step Euler calculation should be checked by adding all of its increments to the starting value. In the four-step example, the increments are approximately \(2\), \(2.145\), \(2.28939871875\), and \(2.4308280453\). Their sum is approximately \(8.8652267641\), not \(6.8652267641\). Therefore the final estimate is \(20+8.8652267641\approx28.8652267641\).
A wrong calculation would report the increment sum as \(6.8652267641\) and then write \(20+6.8652267641=28.8652267641\). The addition is false: the left side is \(26.8652267641\). The correction is to sum the four increments carefully, then add that sum to \(Y_0\). A second check is to confirm that every update begins with the preceding estimate and that the final estimate is compared with the exact value at the same time.
Interpreting a Comparison Carefully
A numerical comparison is informative, but it has limits. The exact logistic value is exact for the stated differential-equation model; it is not automatically an exact description of a real population. Any mismatch between a real population and the model may be larger than the Euler error. Also, a single matched-time comparison measures accuracy at that time, not at every intermediate time.
Smaller steps often improve Euler accuracy for a smooth solution, consistent with the first-order global error behavior studied earlier. However, it is not safe to claim that the error must decrease monotonically for every step-size change and every target. The signed errors can change direction, and errors from separate steps can reinforce or partly cancel. When accuracy matters, compute the error at the target time for the chosen model, or compare against an explicit solution when one is available.
The practical procedure is straightforward: calculate the Euler estimate using the chosen step size, evaluate the exact formula at the matching time, subtract in a stated order, and compare the resulting absolute or relative error with the required tolerance. Keep enough digits during the intermediate steps, then round only the reported final values.
Check Your Understanding
Use matched times and keep signed and absolute error distinct as you answer.
- For \(K=100\), \(r=0.5\), and \(y(0)=20\), what time is reached after three Euler steps of size \(0.2\)?
- If the exact population is \(42\) and the Euler estimate is \(40.5\), what are the signed error and absolute error under the convention used here?
- Why must the exact logistic value and Euler estimate be evaluated at the same time before their difference is interpreted as numerical error?
- For the example with target time \(t=1\), which tested step sizes satisfy an absolute-error tolerance of \(0.65\) population units?
- Why does a smaller step size often improve Euler accuracy without guaranteeing that every particular error comparison will follow a perfectly regular pattern?