Tutorials › Calculus I › Positivity and Equilibrium Preservation in Euler Steps

Euler's Method and Numerical Solutions · Tutorial 1446 of 1495

Positivity and Equilibrium Preservation in Euler Steps

Determine when a forward Euler update leaves an equilibrium unchanged and what conditions on the slope and step size prevent nonnegative estimates from becoming negative.

Advanced 10 min read

What You'll Learn

  • Identify equilibria that forward Euler preserves exactly.
  • Distinguish an equilibrium from a state with zero slope at just one instant.
  • Derive a step-size condition that guarantees nonnegative scalar Euler values.
  • Explain why an inward-pointing slope at zero alone may not ensure positivity.
  • Apply componentwise positivity conditions to a coupled linear system.
  • Distinguish positivity preservation from numerical stability.

Why Preservation Properties Matter

Numerical solutions are often expected to respect features of the differential equation being approximated. If a system has a stationary state, an Euler computation should ideally leave that state stationary. If a quantity represents a population, concentration, or amount, negative numerical estimates may be meaningless even when the differential equation's solution remains nonnegative.

Forward Euler does not preserve every desirable feature automatically. The update uses the slope at the beginning of a step and extends that slope across the full step. A sufficiently large step can therefore move an estimate past zero. Understanding the update itself gives precise tests for when equilibrium and nonnegativity are preserved.

Forward Euler and Equilibria

For an initial-value problem \(y'=f(t,y)\), forward Euler with step size \(h>0\) uses \(t_{n+1}=t_n+h\) and the update \(y_{n+1}=y_n+h f(t_n,y_n)\). For an autonomous equation \(y'=f(y)\), an equilibrium is a value \(y_*\) satisfying \(f(y_*)=0\). At an equilibrium the differential equation has zero slope, so the constant function \(y(t)=y_*\) is a solution.

Definition: An Euler step preserves an equilibrium \(y_*\) if starting at \(y_n=y_*\) gives \(y_{n+1}=y_*\). For an autonomous equation, every equilibrium is preserved by forward Euler for every step size \(h\), because \(f(y_*)=0\).

The reason is direct: substituting the equilibrium into the update gives \(y_{n+1}=y_*+h\cdot 0=y_*\). Applying the same calculation at every later step shows that the computed values remain at \(y_*\). This property is exact; it does not depend on the size of the step.

For a nonautonomous equation \(y'=f(t,y)\), a constant state \(y_*\) is an equilibrium solution on an interval only if \(f(t,y_*)=0\) for every time in that interval. If the slope is zero only at the current point \((t_n,y_n)\), then that particular Euler update leaves the value unchanged, but the slope may be nonzero at the next time. One zero-slope step does not by itself establish an equilibrium solution.

Worked Example: Preserving an Equilibrium

Consider the autonomous equation \(y'=y(1-y/10)\). Find its equilibria and check what forward Euler does when \(y_0=10\) and \(h=0.4\).

An equilibrium solves \(y(1-y/10)=0\), so \(y=0\) or \(y=10\). At \(y_0=10\), the slope is \(f(10)=10(1-10/10)=10(0)=0\). The Euler update is therefore

$$ y_1=10+0.4(0)=10. $$

The next update has the same slope, \(f(10)=0\), and gives \(y_2=10+0.4(0)=10\). Thus the equilibrium is preserved at every step. Substitution checks the result: \(10(1-10/10)=0\), so the computed value remains an equilibrium.

What Positivity Preservation Requires

Suppose a scalar quantity begins nonnegative, so \(y_n\geq 0\). The next Euler value is nonnegative exactly when

$$ y_n+h f(t_n,y_n)\geq 0. $$

This is the exact one-step test at the state being used. If \(y_n>0\), it can also be written \(f(t_n,y_n)\geq -y_n/h\). In other words, the downward slope must not be so steep that its Euler line crosses zero during the step. When \(y_n=0\), the test reduces to \(f(t_n,0)\geq 0\).

A useful uniform sufficient condition is to bound how negative the slope can be relative to the state. Suppose \(c\geq 0\), and throughout the nonnegative states of interest the equation satisfies \(f(t,y)\geq -cy\). Then an Euler step with \(hc\leq 1\) cannot produce a negative value. This condition can be checked before carrying out the steps and is often easier to use than checking each update separately.

Theorem: Suppose \(y_n\geq 0\), \(h>0\), and \(f(t,y)\geq -cy\) for all relevant times \(t\) and states \(y\geq 0\), where \(c\geq 0\). If \(hc\leq 1\), then \(y_{n+1}\geq 0\). If these conditions hold at every step, all Euler values remain nonnegative.

Why the Step-Size Bound Works

The proof is an estimate using the assumed lower bound on the slope. Because \(h>0\), multiplying \(f(t_n,y_n)\geq -cy_n\) by \(h\) preserves the inequality. Adding \(y_n\) to both sides gives

$$ y_{n+1} =y_n+h f(t_n,y_n) \geq y_n-hcy_n =(1-hc)y_n. $$

The step-size condition \(hc\leq 1\) implies \(1-hc\geq 0\). Since \(y_n\geq 0\), the product \((1-hc)y_n\) is nonnegative, and therefore \(y_{n+1}\geq 0\). Repeating this argument at each step proves the final claim.

The bound is sufficient, not always necessary. A particular update may remain nonnegative even when \(hc>1\), because its actual slope may be less negative than the lower bound allows. Conversely, the condition \(f(t,0)\geq 0\) alone is not enough: it checks the slope at the boundary, not whether a step from a positive state can jump across that boundary.

Decay: Positivity and Step Size

For the decay equation \(y'=-ky\), where \(k>0\), the Euler update is \(y_{n+1}=(1-kh)y_n\). Nonnegative input values stay nonnegative when \(1-kh\geq 0\), which requires \(h\leq 1/k\). This is the positivity bound for this equation. It should not be confused with a broader stability condition: a computation can avoid negative values yet still have other numerical behavior that needs checking.

Worked Example: A Step-Size Bound for Exponential Decay

Apply forward Euler to \(y'=-3y\), starting with \(y_0=8\) and using \(h=1/4\). The update factor is \(1-3(1/4)=1-3/4=1/4\), so

$$ y_1=8+\frac14(-3\cdot 8) =8-6 =2. $$

At the next step the slope is \(-3(2)=-6\), giving

$$ y_2=2+\frac14(-6) =2-\frac32 =\frac12. $$

Both values are nonnegative. The general bound is \(h\leq 1/3\), and \(1/4\leq 1/3\), as required. Checking the update factor gives \(1-3h=1/4\), so the two computed values also satisfy \(y_1=(1/4)8=2\) and \(y_2=(1/4)2=1/2\). If instead \(h=1/2\), then \(y_1=8+(1/2)(-24)=-4\); the step exceeds the positivity bound and produces a negative estimate.

Boundary Slopes Are Not Enough

Consider \(y'=4-y\). At the boundary \(y=0\), the slope is \(4\), pointing toward positive values. But for a sufficiently large positive \(y\), the slope is negative, and a large Euler step can cross below zero. In fact, the Euler update is \(y_{n+1}=(1-h)y_n+4h\). For all \(y_n\geq 0\), the inequality \(4-y_n\geq -y_n\) holds, so the theorem applies with \(c=1\) whenever \(h\leq 1\).

Worked Example: An Inward Boundary Slope Does Not Guarantee Positivity

For \(y'=4-y\), start at \(y_0=16\) and take \(h=3/2\). The initial slope is \(f(16)=4-16=-12\), so the Euler estimate is

$$ y_1=16+\frac32(-12) =16-18 =-2. $$

Thus a positive initial value has produced a negative estimate, even though \(f(0)=4>0\). The general update confirms the calculation: \(y_1=(1-3/2)16+4(3/2)=(-1/2)16+6=-8+6=-2\). With the smaller step \(h=1\), the same initial value instead gives \(y_1=16+(4-16)=4\). Substitution into the update formula gives \((1-1)16+4(1)=4\), which is nonnegative, consistent with the sufficient bound \(h\leq 1\).

Positivity in a Coupled Linear System

The same reasoning applies component by component to a system. For a vector \(\mathbf{y}\), nonnegative means that every component is nonnegative. For the linear system \(\mathbf{y}'=\mathbf{A}\mathbf{y}+\mathbf{b}\), Euler gives \(\mathbf{y}_{n+1}=(\mathbf{I}+h\mathbf{A})\mathbf{y}_n+h\mathbf{b}\), where \(\mathbf{I}\) is the identity matrix. A sufficient condition for preserving nonnegative vectors is that every entry of \(\mathbf{I}+h\mathbf{A}\) and \(h\mathbf{b}\) is nonnegative. For example, if the off-diagonal entries of \(\mathbf{A}\) and the entries of \(\mathbf{b}\) are nonnegative, it remains to require \(1+hA_{ii}\geq 0\) for each diagonal entry.

Worked Example: Checking Positivity for a Two-Variable System

Consider \(\mathbf{y}'=\mathbf{A}\mathbf{y}\), with \(\mathbf{A}=\begin{pmatrix}-2&1\\2&-3\end{pmatrix}\), initial vector \(\mathbf{y}_0=\begin{pmatrix}2\\1\end{pmatrix}\), and \(h=1/4\). The Euler matrix is

$$ \mathbf{I}+h\mathbf{A} = \begin{pmatrix}1&0\\0&1\end{pmatrix} +\frac14\begin{pmatrix}-2&1\\2&-3\end{pmatrix} = \begin{pmatrix}1/2&1/4\\1/2&1/4\end{pmatrix}. $$

Every entry is nonnegative. Multiplying by the initial vector gives

$$ \mathbf{y}_1 = \begin{pmatrix}1/2&1/4\\1/2&1/4\end{pmatrix} \begin{pmatrix}2\\1\end{pmatrix} = \begin{pmatrix}1+1/4\\1+1/4\end{pmatrix} = \begin{pmatrix}5/4\\5/4\end{pmatrix}. $$

The result is componentwise nonnegative. Directly checking the slope, \(\mathbf{A}\mathbf{y}_0=\begin{pmatrix}-4+1\\4-3\end{pmatrix}=\begin{pmatrix}-3\\1\end{pmatrix}\), gives \(\mathbf{y}_0+h\mathbf{A}\mathbf{y}_0=\begin{pmatrix}2-3/4\\1+1/4\end{pmatrix}=\begin{pmatrix}5/4\\5/4\end{pmatrix}\), matching the matrix update.

Common Mistakes and Practical Checks

A frequent error is to reason that because the differential equation points into the nonnegative region at zero, Euler must remain nonnegative. That conclusion overlooks the size of a step from states away from zero. The affine example showed a positive slope at zero alongside a negative Euler result for a large step.

Another mistake is to identify positivity with equilibrium preservation. Equilibrium preservation follows from substituting a zero slope into the update and holds for any positive step size. Positivity requires a separate inequality involving the step size and the negative slopes that may occur. For \(y'=-3y\), for instance, the equilibrium \(y=0\) is preserved for every \(h\), while nonnegative values are guaranteed to remain nonnegative only when \(h\leq 1/3\).

Before computing a sequence of Euler values for a model that should remain nonnegative:

  • Identify the state region that is physically or mathematically relevant.
  • Write the Euler update and test whether its value is nonnegative at the boundary and at positive states.
  • Look for a bound such as \(f(t,y)\geq -cy\), then impose \(hc\leq 1\).
  • For a coupled system, check the signs of the Euler matrix and any added vector.
  • Verify the resulting update directly for representative states, without treating those checks as a replacement for a general condition.

These tests concern preservation of a property, not the overall accuracy of the approximation. A nonnegative output need not be accurate, and preserving an equilibrium does not ensure that nearby numerical values behave like nearby solutions.

Check Your Understanding

Use the Euler update to answer each question. For questions involving positivity, state the conditions you use.

  1. For an autonomous equation \(y'=f(y)\), what condition defines an equilibrium, and why does forward Euler preserve it?
  2. For \(y'=-5y\), what step-size bound guarantees that nonnegative values remain nonnegative?
  3. For a scalar update, write the exact one-step condition that ensures \(y_{n+1}\geq 0\).
  4. Why does \(f(t,0)\geq 0\) alone not guarantee positivity for every Euler step?
  5. For a linear system, what entrywise conditions on the Euler matrix and added vector suffice to preserve componentwise nonnegativity?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon