Tutorials › Calculus I › A Coupled-System Euler Computation Workshop

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

A Coupled-System Euler Computation Workshop

Learn to tabulate simultaneous Euler updates for coupled differential equations and use the system’s vector field to interpret the numerical path.

Advanced 12 min read

What You'll Learn

  • Write a coupled initial-value problem as component equations with a shared independent variable.
  • Compute each component’s Euler update from the same current time and state.
  • Organize coupled-system computations in a table that exposes sign and indexing errors.
  • Check an Euler table by substituting each row into the system and update rule.
  • Compare a polygonal Euler path with the directions indicated by the system’s vector field.
  • Recognize how a numerical path can differ qualitatively from the underlying slope-field behavior.

Why Coupled Euler Computations Need Care

A coupled differential-equation system describes several changing quantities whose rates depend on one another. At each time, the rate of change of one quantity may depend on the current value of another. Forward Euler can approximate such a system, but only if every component is updated consistently.

The central bookkeeping rule is simple: calculate all rates from the same current state, then use those rates to calculate all next values. A table makes this rule visible. It also makes it easier to compare the computed points with the directions suggested by the system’s vector field.

Definition of a Coupled Initial-Value Problem

For two dependent variables \(x\) and \(y\), a coupled initial-value problem has the form

$$ \begin{aligned} x' &= f(t,x,y),\\ y' &= g(t,x,y),\\ x(t_0)&=x_0,\qquad y(t_0)=y_0. \end{aligned} $$

The independent variable is \(t\); the values \(x(t)\) and \(y(t)\) form the state of the system. The right-hand sides \(f\) and \(g\) specify the two rates at a given time and state. In vector notation, write the state as \(\mathbf{z}=(x,y)\) and the rate as \(\mathbf{F}(t,\mathbf{z})=(f(t,x,y),g(t,x,y))\).

Definition: Given a step size \(h\), forward Euler constructs approximations \((x_n,y_n)\) at times \(t_n=t_0+nh\) by evaluating both rates at \((t_n,x_n,y_n)\), then setting $$ \begin{aligned} x_{n+1}&=x_n+h f(t_n,x_n,y_n),\\ y_{n+1}&=y_n+h g(t_n,x_n,y_n). \end{aligned} $$

These formulas are simultaneous updates: both right-hand sides use \(x_n\) and \(y_n\), not a mixture of old and newly computed values. The procedure is explicit: once the current state and step size are known, the next state is calculated directly.

Why the Update Formula Works

Suppose a differentiable solution has state \(\mathbf{z}(t)\), and its derivative is \(\mathbf{F}(t,\mathbf{z}(t))\). The definition of differentiability gives, for a small positive step \(h\),

$$ \mathbf{z}(t+h) = \mathbf{z}(t)+h\mathbf{z}'(t)+\mathbf{r}(h), \qquad \frac{\|\mathbf{r}(h)\|}{h}\longrightarrow 0 \quad\text{as }h\longrightarrow 0. $$

Since \(\mathbf{z}'(t)=\mathbf{F}(t,\mathbf{z}(t))\), the first two terms give a tangent-line estimate of the state after time \(h\). Forward Euler keeps those terms and omits the remainder:

$$ \mathbf{z}(t+h)\approx \mathbf{z}(t)+h\mathbf{F}(t,\mathbf{z}(t)). $$

Taking components yields the two Euler update formulas. This justification explains both the method’s name and its limitation: each step follows the tangent direction at the start of the step, rather than tracking the changing direction throughout the interval.

Worked Example: A Coupled Oscillator

Worked Example: Tabulating an Oscillator Step by Step

Use forward Euler with step size \(h=0.5\) on the system \(x'=y,\ y'=-x\), starting from \((x_0,y_0)=(1,0)\) at \(t_0=0\). The rates at each row are \(x'=y_n\) and \(y'=-x_n\), evaluated using that row’s state.

\(n\)\(t_n\)\(x_n\)\(y_n\)\(x'=y_n\)\(y'=-x_n\)
00100\(-1\)
10.51\(-0.5\)\(-0.5\)\(-1\)
210.75\(-1\)\(-1\)\(-0.75\)
31.50.25\(-1.375\)\(-1.375\)\(-0.25\)
42\(-0.4375\)\(-1.5\)\(-1.5\)0.4375

At \(n=0\), the rates are \(0\) and \(-1\). Thus \(x_1=1+0.5(0)=1\), while \(y_1=0+0.5(-1)=-0.5\).

At \(n=1\), the rates are \(-0.5\) and \(-1\). Therefore \(x_2=1+0.5(-0.5)=0.75\), and \(y_2=-0.5+0.5(-1)=-1\).

At \(n=2\), the rates are \(x'=y_2=-1\) and \(y'=-x_2=-0.75\). Therefore \(x_3=0.75+0.5(-1)=0.25\), and \(y_3=-1+0.5(-0.75)=-1.375\).

At \(n=3\), the rates are \(-1.375\) and \(-0.25\). Hence \(x_4=0.25+0.5(-1.375)=-0.4375\), and \(y_4=-1.375+0.5(-0.25)=-1.5\).

Check: Substituting the row-\(2\) state \((0.75,-1)\) into the system gives \(x'=-1\) and \(y'=-0.75\), as recorded. Applying the update formulas gives \((0.25,-1.375)\), which is the row-\(3\) state. The later rows likewise use each row’s displayed rates and the same step size.

Reading the Numerical Path Against the Vector Field

For a two-variable system, the vector field assigns the arrow \((f(t,x,y),g(t,x,y))\) to each state at a fixed time. The arrow indicates the direction in which the state initially moves. An Euler step follows that arrow for a distance scaled by \(h\). Connecting successive computed states with straight segments creates a polygonal numerical path.

For the oscillator in the example, the rate vector is \((y,-x)\). Its dot product with the state \((x,y)\) is

$$ (x,y)\mathbin{\cdot}(y,-x)=xy-yx=0. $$

Thus the vector field is perpendicular to the radius from the origin: its arrows are tangent to circles centered at the origin. The exact solution, when started away from the origin, moves along a circle. The Euler polygon, however, need not stay on that circle.

To see the difference, take one Euler step from \((x,y)\) for this system. The next state is \((x+hy,y-hx)\), so its squared distance from the origin is

$$ (x+hy)^2+(y-hx)^2 = (1+h^2)(x^2+y^2). $$

For every \(h\ne 0\) and every nonzero state, this is larger than \(x^2+y^2\). The numerical point moves outward even though the vector field is tangent to a circle. This is a qualitative comparison, not a claim that each individual component must increase: the signs of the two rates vary with the state.

Worked Example: A Conserved Sum in a Transfer System

Worked Example: Checking an Invariant Along Euler Steps

Consider \(x'=-x+y,\ y'=x-y\), with initial state \((2,0)\) at \(t=0\), and take \(h=0.25\). Each pair of rates is computed from the current row.

\(n\)\(t_n\)\(x_n\)\(y_n\)\(x'=-x_n+y_n\)\(y'=x_n-y_n\)
0020\(-2\)2
10.251.50.5\(-1\)1
20.51.250.75\(-0.5\)0.5
30.751.1250.875\(-0.25\)0.25

From the initial state, the rates are \(-2\) and \(2\), so \(x_1=2+0.25(-2)=1.5\) and \(y_1=0+0.25(2)=0.5\). At \((1.5,0.5)\), the rates are \(-1\) and \(1\); the next state is \(x_2=1.5-0.25=1.25\), \(y_2=0.5+0.25=0.75\). At \((1.25,0.75)\), the rates are \(-0.5\) and \(0.5\); this gives \(x_3=1.25-0.125=1.125\), \(y_3=0.75+0.125=0.875\).

Check: The rate sum is zero at every state, because \((-x+y)+(x-y)=0\). Accordingly, the update changes \(x+y\) by \(0.25\) times zero. The table has \(x_n+y_n=2\) in every row: \(2\), \(1.5+0.5\), \(1.25+0.75\), and \(1.125+0.875\) all equal \(2\). The field arrows point along lines of constant sum, and the Euler points remain on the same line.

Worked Example: Including Time in the Rates

Worked Example: Evaluating a Nonautonomous Coupled System

Use \(h=0.5\) for \(x'=y+t,\ y'=x-t\), starting from \((x_0,y_0)=(1,0)\) at \(t_0=0\). Since the rates depend explicitly on time, each row must use its own \(t_n\) as well as its current state.

\(n\)\(t_n\)\(x_n\)\(y_n\)\(x'=y_n+t_n\)\(y'=x_n-t_n\)
001001
10.510.510.5
211.50.751.750.5
31.52.37512.50.875

At time \(0\), the rates are \(0+0=0\) and \(1-0=1\), giving \((x_1,y_1)=(1,0.5)\). At time \(0.5\), the rates are \(0.5+0.5=1\) and \(1-0.5=0.5\), giving \((x_2,y_2)=(1.5,0.75)\). At time \(1\), the rates are \(0.75+1=1.75\) and \(1.5-1=0.5\), so \(x_3=1.5+0.5(1.75)=2.375\) and \(y_3=0.75+0.5(0.5)=1\).

Check: At the final displayed state \((t_3,x_3,y_3)=(1.5,2.375,1)\), the system gives \(x'=1+1.5=2.5\) and \(y'=2.375-1.5=0.875\), matching the table. This row’s rates would be used to compute the next state if another step were required.

A Common Mistake: Updating One Component Too Early

In the transfer system \(x'=-x+y,\ y'=x-y\), start from \((2,0)\) with \(h=0.25\). The correct rates at the starting state are \(-2\) and \(2\), so the simultaneous update is

$$ x_1=2+0.25(-2)=1.5, \qquad y_1=0+0.25(2)=0.5. $$

A tempting but incorrect calculation first updates \(x\), then uses the new \(x_1=1.5\) to recalculate the rate for \(y\) while keeping \(y_0=0\). That gives \(y'=1.5-0=1.5\) and the wrong value \(y_1=0+0.25(1.5)=0.375\). This mixes states from different time levels. It also changes the sum from \(2\) to \(1.5+0.375=1.875\), contradicting the system’s zero total rate.

Takeaway: Compute every rate from the same row of the table. Only after all rates are known should you calculate any values in the next row.

A Reliable Table Workflow

For a coupled system, use the following sequence at every step:

1
Record the current time and state.
Write \(t_n\) and every current component value before evaluating any rates.
2
Evaluate the full rate vector.
Substitute \(t_n\) and the entire current state into every right-hand side.
3
Apply the same step size to each component.
For each variable, add \(h\) times its rate to its current value.
4
Check the new row.
Substitute the new state into the system to verify the rates that should appear there.
5
Compare with the field’s qualitative direction.
Check whether the signs and direction of each update agree with the arrow at the old state.

This table workflow is useful because errors in coupled computations are often relational: a rate may have the wrong sign, may use the wrong component, or may be evaluated at the wrong time. Checking rows against the original equations helps detect all three. Comparing the polygonal path with the vector field then gives a separate qualitative check: each Euler segment should initially point in the direction of the rate vector at its starting point.

Check Your Understanding

Use the simultaneous-update rule and the system’s rate equations to answer these questions.

  1. For \(x'=y,\ y'=-x\), what rate pair is obtained at the state \((x,y)=(0.75,-1)\)?
  2. For \(x'=-x+y,\ y'=x-y\), why does every Euler step preserve \(x+y\), regardless of the step size?
  3. When the right-hand sides depend on \(t\), which time value should be used to calculate the rates for the step from \(t_n\) to \(t_{n+1}\)?
  4. Explain why updating one component and then using that new value to calculate another component’s rate does not give the forward Euler update.
  5. For the oscillator system \(x'=y,\ y'=-x\), why does the vector field point tangent to circles centered at the origin?

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