Why Estimate an Event Time?
A numerical solution is usually recorded at discrete time points. But a question about a differential equation may concern an event that happens between those points: when a population reaches a specified level, when a temperature falls below a limit, or when a state variable attains a target value.
Euler's method gives approximate solution values at the grid times, not a continuous record of the solution. If two successive Euler values lie on opposite sides of a threshold, they indicate a possible crossing during that step. Linear interpolation provides a simple estimate of when, within the step, the crossing occurs.
The result is an estimate based on the Euler data and a straight-line approximation between adjacent values. It is not, by itself, a guarantee of the exact event time for the differential equation's true solution.
Bracketing a Threshold
Suppose Euler's method produces values \(y_n\) and \(y_{n+1}\) at times \(t_n\) and \(t_{n+1}=t_n+h\), where \(h>0\). Let \(Y\) be the threshold of interest. The adjacent values bracket the threshold if \(Y\) lies between them; that is, if either \(y_n\leq Y\leq y_{n+1}\) or \(y_{n+1}\leq Y\leq y_n\).
The hat in \(\widehat{t}\) emphasizes that this is an estimate. The fraction \(\theta=(Y-y_n)/(y_{n+1}-y_n)\) is the fraction of the step at which the segment reaches the threshold. When the threshold is strictly between two unequal endpoint values, \(0<\theta<1\), so the estimated time lies strictly inside the step.
The same formula works for an increasing or decreasing segment. For an increasing segment, both the threshold difference and the change in the Euler value are positive. For a decreasing segment, both are negative, so their ratio is still positive.
Why the Formula Works
Linear interpolation assumes that, between the two tabulated values, the approximation changes at a constant rate. Write the fraction of the step elapsed as \(\theta\). The corresponding time and interpolated value are \(t_n+\theta h\) and \(y_n+\theta(y_{n+1}-y_n)\). To estimate a threshold event, set that value equal to \(Y\) and solve for \(\theta\).
This derivation requires \(y_{n+1}-y_n\neq 0\); otherwise the segment is horizontal and does not reach a different threshold. If \(Y\) equals an endpoint value, the event estimate is that endpoint time, and the formula gives the same result when the endpoint values are unequal.
Worked Examples
Worked Example: An Increasing Euler Approximation
Consider \(y'=3-y\), \(y(0)=1\), with Euler step size \(h=0.5\). Estimate when the Euler approximation reaches the threshold \(Y=2.2\).
At \(t_0=0\), the initial value is \(y_0=1\). The initial slope is \(3-y_0=3-1=2\), so the first Euler value is \(y_1=y_0+h(3-y_0)=1+0.5(2)=2\), at \(t_1=0.5\).
At \(t_1=0.5\), the slope is \(3-y_1=3-2=1\). Thus \(y_2=y_1+h(3-y_1)=2+0.5(1)=2.5\), at \(t_2=1\). Since \(2<2.2<2.5\), the threshold is bracketed during this step.
The fraction of the step is \((2.2-2)/(2.5-2)=0.2/0.5=0.4\). Therefore, \(\widehat{t}=0.5+0.4(0.5)=0.5+0.2=0.7\).
Check the interpolated value: the segment rises by \(2.5-2=0.5\) over the step. At fraction \(0.4\), it has risen by \(0.4(0.5)=0.2\), giving \(2+0.2=2.2\). The estimated time is \(0.7\).
Worked Example: A Decreasing Euler Approximation
Apply Euler's method to \(y'=-y\), \(y(0)=4\), with \(h=0.25\). Estimate when the Euler values cross the threshold \(Y=2.6\).
At \(t_0=0\), \(y_0=4\). The slope is \(-y_0=-4\), so \(y_1=4+0.25(-4)=4-1=3\), at \(t_1=0.25\).
At \(t_1=0.25\), the slope is \(-y_1=-3\). Hence \(y_2=3+0.25(-3)=3-0.75=2.25\), at \(t_2=0.5\). The threshold is bracketed because \(3>2.6>2.25\).
The fraction of the step is \((2.6-3)/(2.25-3)=(-0.4)/(-0.75)=8/15\). Thus \(\widehat{t}=0.25+(8/15)(0.25)=1/4+2/15=23/60\), or approximately \(0.3833\).
Check the value on the segment: its change over the whole step is \(-0.75\). At fraction \(8/15\), the change is \((8/15)(-0.75)=(8/15)(-3/4)=-0.4\). Starting from \(3\), this gives \(3-0.4=2.6\). The estimated time is \(23/60\), which lies between \(0.25\) and \(0.5\).
Worked Example: Computing an Euler Bracket Before Interpolating
Consider \(y'=1+t\), \(y(0)=0\), with step size \(h=0.5\). Estimate when the Euler approximation reaches \(Y=0.8\).
At \(t_0=0\), the slope is \(1+0=1\), so \(y_1=0+0.5(1)=0.5\), at \(t_1=0.5\).
At \(t_1=0.5\), the slope is \(1+0.5=1.5\), so \(y_2=0.5+0.5(1.5)=0.5+0.75=1.25\), at \(t_2=1\). The threshold \(0.8\) lies between \(0.5\) and \(1.25\).
The fraction of the second step is \((0.8-0.5)/(1.25-0.5)=0.3/0.75=0.4\). Therefore, \(\widehat{t}=0.5+0.4(0.5)=0.7\).
Check: at fraction \(0.4\), the straight segment has increased from \(0.5\) by \(0.4(1.25-0.5)=0.4(0.75)=0.3\). Its value is \(0.5+0.3=0.8\), as required.
Conditions and Limits of the Estimate
The calculation is most directly justified when adjacent, unequal Euler values bracket the threshold. Then the straight segment has exactly one point with value \(Y\), and the fraction \(\theta\) lies between 0 and 1. If the threshold is outside the range of the two values, the same algebra may produce \(\theta<0\) or \(\theta>1\). That is an extrapolation beyond the step, not an event located within it.
Endpoint data do not reveal everything that happens between endpoints. A true solution could cross a threshold and return before the next grid time, even if both Euler values are on the same side. Conversely, a pair of Euler values that brackets a threshold does not prove that the true solution crosses at the interpolated time. Interpolation makes a local straight-line approximation; its reliability depends on how well that segment represents the solution near the crossing.
A smaller step can give a more local view of the trajectory, but interpolation does not eliminate the numerical error in the Euler values or the error from approximating a curved path by a line. The estimate should therefore be reported as an approximation based on the stated Euler data. If a threshold event is important, it is sensible to examine the step size and the local behavior of the solution rather than treating the interpolated number as exact.
A Common Mistake: Reversing the Fraction
A frequent error is to divide the step's change in the solution by the threshold's change from the starting value. These quantities belong in the opposite order. The fraction of the step must be the threshold change divided by the total change between endpoint values.
For the first worked example, reversing the ratio gives \((y_{n+1}-y_n)/(Y-y_n)=(2.5-2)/(2.2-2)=0.5/0.2=2.5\). This would predict \(0.5+2.5(0.5)=1.75\), which is beyond the step ending at \(t=1\). The threshold is between the endpoint values, so an interpolation fraction greater than 1 is a warning that the ratio has been reversed.
The correct fraction is \((Y-y_n)/(y_{n+1}-y_n)=0.2/0.5=0.4\), giving \(0.5+0.4(0.5)=0.7\). Substitution into the segment gives \(2+0.4(2.5-2)=2.2\), confirming the correction.
A Reliable Calculation Sequence
Check that the threshold lies between the two Euler values, regardless of whether they increase or decrease.
Use \(\theta=(Y-y_n)/(y_{n+1}-y_n)\), with the threshold change in the numerator and the full step change in the denominator.
Calculate \(\widehat{t}=t_n+\theta h\), using the left endpoint time and the step size.
Verify \(0\leq\theta\leq1\) for an event within the step, and substitute the fraction into the segment value to recover \(Y\).
Why Event-Time Interpolation Matters
Many questions about a numerical trajectory concern when something happens, rather than only what the state is at a selected grid time. Interpolation turns a bracketed threshold crossing into a usable within-step estimate without requiring a new differential-equation solution. Its value is practical, but its interpretation must stay precise: it is a threshold time on the line segment joining two Euler approximations.
Always report the time together with the data and method that produced it. A clearly stated estimate, a bracket check, and a substitution check make it easier to distinguish a reasonable interpolation from a calculation error or an unsupported claim about the exact solution.
Check Your Understanding
For each question, use the linear segment between the stated adjacent Euler values.
- At times \(t_n=2\) and \(t_{n+1}=3\), the values are \(y_n=5\) and \(y_{n+1}=9\). Estimate when the segment reaches \(Y=7\).
- At times \(t_n=1\) and \(t_{n+1}=1.4\), the values are \(y_n=6\) and \(y_{n+1}=4\). Estimate when the segment reaches \(Y=5.5\).
- Why does a threshold outside the range of the adjacent values not give an event time inside that step by linear interpolation?
- What does checking the interpolated value establish, and what does it not establish about the true differential-equation solution?