A coarse approximation can invent instability in a stable system.
By the end: Use step refinement and an exact reference to diagnose numerical behavior.
Approximate a continuously changing quantity
A differential equation states a rate of change. Consider a dimensionless amount y that decays at rate minus y per second, starting at one. Its exact value at time t seconds is exp(−t), always positive and approaching zero. No chaos is involved.
Forward Euler holds the current rate for one step of length h seconds. The next amount is the current amount multiplied by one minus h. A larger step uses an old rate for longer. This creates discretization error even with exact arithmetic.
Derive an update with units
A rate compares a change in amount with a time interval. If an amount falls by 0.6 over half a second, its average rate over that interval is minus 1.2 per second. An instantaneous rate describes what happens over an interval made very short. A differential equation specifies that instantaneous rate from the present state. You do not need differentiation rules to use the decay equation here. Its statement is that a larger current amount loses more per second, in direct proportion to how much remains.
Write the positive decay constant as k, measured in inverse seconds. The rate is minus k times y, measured in amount per second. Multiplying this rate by h seconds gives an amount change. Adding that change to the old amount gives the Euler update. Factoring out the old amount leaves the multiplier one minus k times h. Only the product k times h can be subtracted from one because it has no units. Writing one minus h alone is shorthand for the lesson's particular rate of one per second.
Convert a rate into a change
Quantity
Value
Units
Amount y
3
Amount units
Decay constant k
0.4
Per second
Rate −ky
−1.2
Amount units per second
Step h
0.5
Seconds
Change h × rate
−0.6
Amount units
This constructed calculation freezes the initial rate for half a second. Multiplying rate by elapsed seconds produces an amount change. The dimensionless retention is 0.8, while the exact half-second retention is about 0.818731.
Consider a separate constructed example starting with amount three and k = 0.4 per second. At the beginning, its loss rate is 1.2 amount units per second. With h = 0.5 seconds, freezing that rate removes 0.6 and leaves 2.4. At the next step, recompute the rate from 2.4 rather than from three. It is now minus 0.96 per second. Another half second removes 0.48 and leaves 1.92. These are numerical predictions from a chosen rule, not observations of a decaying substance or new settings in the lab.
Convert rate to an Euler update
y is amount in arbitrary units, k = 0.4 per second, h = 0.5 seconds. The product kh is dimensionless.
Calculate retention
q is the dimensionless Euler retention per half-second step, not the exact exponential retention.
Compute the first amount
Reuse the new amount
The exact solution uses the exponential function. For this example, multiply three by exp of minus 0.4 times elapsed seconds. The exponent is dimensionless because the inverse seconds in the rate cancel the seconds in time. An exponential decay has the same fractional retention over any interval of a given duration. Over half a second, that exact fraction is about 0.818731, rather than Euler's 0.8. Repeating either fraction generates its own sequence. Their difference begins on the first step, even before any floating-point representation enters the calculation.
Why does Euler remove too much here? While the amount falls, the magnitude of its negative rate also falls. Euler instead keeps the larger initial loss rate throughout the entire step. It therefore subtracts more than the continuously changing rate would remove. Starting from an exact positive amount, the exact endpoint lies above this frozen-rate endpoint. Shortening the step reduces the interval during which the old rate is used. This argument depends on this decay rule and positive starting value; it is not a statement that Euler always underestimates every differential equation.
Half-second Euler samples versus exact decay
Amount; initial value 3
Elapsed seconds; k = 0.4 per second
Solid: Exact samples
Dashed: Euler, h = 0.5 s
Both series start from three and cover two seconds at rate 0.4 per second. Lines connect five sampled values, not exact within-step paths. Euler loses too much because each step retains an outdated larger loss rate.
A discrete map and a numerical update can look identical algebraically while answering different questions. If a process is defined to multiply by 0.8 every half second, that multiplication is its stipulated rule. There is no continuous reference to approximate unless one supplies it. Here the intended rule is continuous decay at 0.4 per second, so multiplying by 0.8 is an approximation to another specified evolution. Calling a recurrence exact therefore requires naming what it is exact for. Exact arithmetic for the recurrence does not make that recurrence the exact differential-equation solution.
A stable process can look unstable
For h = 0.25, Euler decays too fast but stays positive. At h = 1, it jumps straight to zero. At h = 2, it alternates between one and minus one without decay. At h = 2.5, it alternates with growing magnitude. The physical rule did not change; the numerical approximation did.
Reducing step size should improve short-time agreement with a reference when the numerical method is appropriate. For chaotic systems, improved short-time accuracy still does not preserve indefinite trajectory agreement. Study statistics as well as trajectories when the question calls for them.
Separate decay, positivity, and accuracy
For this scalar decay equation, Euler's long-run behavior follows from repeated multiplication by q, where q means one minus k times h. After n updates the starting amount has been multiplied by q to the power n. If the magnitude of q is below one, those magnitudes approach zero. If q is negative, the signs alternate along the way. Thus numerical decay toward zero and physically acceptable nonnegative amounts are separate properties. A bounded sequence can still represent an impossible amount, and a positive sequence can still have a large quantitative error.
The inequalities follow from elementary algebra. For positive k and h, nonnegative retention requires k times h to be at most one. Decay in magnitude requires k times h to be strictly between zero and two. At a product of two, the multiplier has magnitude one rather than being a contraction. These conditions concern this equation and forward Euler, not every integration method. They also do not specify an accuracy tolerance. A multiplier of zero can remove the entire amount in one numerical step even though the exact exponential still retains a positive fraction.
Require shrinking magnitudes
q = 1 − kh is Euler retention; k and h are positive. These conditions apply only to this scalar decay equation.
Solve the stability inequality
At kh = 2, the multiplier is −1, giving undamped sign flips rather than decay.
Separately require nonnegative retention
Magnitude decay permits negative amounts; nonnegativity is a stronger restriction. Neither condition specifies accuracy.
Test three properties separately
Step at k = 0.4/s
Multiplier
Result
0.5 s
0.8
Positive decay; approximate
2 s
0.2
Positive decay; large error
3 s
−0.2
Shrinking sign flips
5 s
−1
Undamped sign flips
These multipliers apply only to forward Euler for the stated scalar rate. Decay in magnitude does not imply nonnegative amounts. Neither property supplies an accuracy tolerance or validates a different differential equation or integration method.
Return to k = 0.4 per second. With a three-second step, the multiplier is minus 0.2. The computed magnitudes shrink, but a positive initial amount becomes negative on the first update. A two-second step has multiplier 0.2 and keeps positive values, yet its exact retention is about 0.449329. Starting from three, those endpoints are 0.6 and about 1.347987. Both numerical sequences decay, but that fact alone does not make either useful for measuring the amount. The desired observable and acceptable absolute error must also be stated.
Local error means the discrepancy introduced by one step that starts from the exact state. Global error compares the accumulated numerical answer with the exact answer at a stated later time. For smooth unit-rate decay, expanding the exponential begins with one minus h, then adds h squared divided by two and smaller terms. Euler omits that curvature contribution. Its one-step discrepancy therefore scales like h squared when h is small. Over a fixed interval, however, reducing h also increases the number of opportunities to introduce error, so endpoint error generally scales like h.
Check that distinction with amount three, rate one per second, and a fixed endpoint of two seconds. Steps of 0.5, 0.25, and 0.125 seconds require four, eight, and sixteen updates. Their endpoint amounts are about 0.187500, 0.300339, and 0.354201. The exact endpoint is about 0.406006. Halving the step improves the comparison, but it does not quarter the accumulated endpoint error. A further halving gives about 0.380366. This is a bounded refinement example with an exact reference, not a guarantee inferred from two similar-looking plotted traces.
Hold elapsed time fixed
N counts updates to t = 2 s; k = 1 per second and initial amount is 3. yE is Euler amount; yexact is the reference amount.
Use four half-second steps
Compare with the exact endpoint
The error uses the exact value at the same two seconds, not at the same sample index.
Measure absolute discrepancy
Endpoint error under bounded step refinement
Absolute amount error; exact denominator not used
Step h, seconds; endpoint fixed at 2 s
Solid: Euler absolute error
All points compare amount three under unit-rate decay at two elapsed seconds. Connections interpolate results across tested steps, not a time trajectory or an exact error law. Smaller steps improve these four independently calculated endpoint errors.
The accumulation can be understood without adding absolute errors as if all steps had equal influence. An error introduced early in stable scalar decay is multiplied by later retention factors, so it shrinks before the endpoint. Later errors experience fewer such multiplications. In nonlinear equations, the corresponding error propagation depends on the evolving state and may amplify differences instead. Agreement under refinement must therefore name the equation, interval, and quantity compared. The factor-of-two global-error trend for small Euler steps is an asymptotic statement under suitable assumptions, not an error certificate for arbitrary step choices.
Inspect the rules and their result
Forward Euler for unit-rate decay
The decay rate is 1 per second; h is the step in seconds. The dimensionless multiplier is 1 − h × 1 per second.
Changing the step recalculates from y = 1 over ten seconds. The vertical scale adapts to include the numerical error; both curves always share that scale.
Solid blue: Exact exp(−t). Dashed amber: Euler, h = 0.25 s.
Time, s
Exact
Euler
0.00
1.000000
1.000000
0.25
0.778801
0.750000
10.00
0.000045
0.000010
Straight segments connect numerical samples; they are not exact within-step solutions.
h in seconds
Multiplier 1 − h
Behavior
0.25
0.75
Positive decay
1
0
Immediate zero
2
−1
Undamped sign flips
2.5
−1.5
Growing sign flips
Euler stability for this one decay equation.
Compare the displayed samples fairly
The precision lab offers four named step buttons, not a rate slider or a control for the initial amount. Each selection recomputes from one with the fixed rate of one per second. The horizontal axis measures elapsed seconds and the endpoint is ten seconds for all four offered choices. There is no playback whose duration represents the decay. The exact curve and numerical samples share a vertical scale, which can change between choices. A taller plotting range can make the exact curve look flatter without changing a single exact value.
Begin with Small step, 0.25 s, and inspect values at shared physical times rather than matching sample numbers from different runs. At one second, four Euler updates give about 0.316406, compared with the exact 0.367879. At two seconds, eight updates give about 0.100113, compared with 0.135335. These comparisons retain the same initial amount and rule. Only the numerical approximation differs. The added table gives selected values without requiring visual estimation from the chart, whose lines cannot resolve every small separation near zero at the ten-second endpoint.
Read equal elapsed times
Elapsed seconds
Exact amount
Euler, h = 0.25 s
1
0.367879441
0.316406250
2
0.135335283
0.100112915
4
0.018315639
0.010022596
The initial amount is one and the rate is one per second. Each row compares the same elapsed time, despite differing sample indices. Rounded entries show numerical bias without treating connecting line segments as exact continuous evolution.
An exact exponential curve does not consist of straight segments. The lab draws it using samples every tenth of a second, while Euler's samples occur at multiples of the chosen step. Connecting these points helps compare sequences, but the connections are graphical interpolation. Even for Euler, interpreting a segment as a frozen-rate path within that step is an additional convention, not a new computed sample. Compare endpoints when assessing the numerical method here. The location of a drawn segment between endpoints does not establish the exact nonlinear behavior of a different equation.
Absolute and relative error answer different questions near decay to zero. Absolute error is the magnitude of the difference between the numerical and exact amounts, measured in amount units. Relative error divides that absolute error by the magnitude of the exact reference. At ten seconds, the exact amount is about 0.000045400, and the quarter-second Euler amount is about 0.000010057. Their absolute difference is only about 0.000035343, but relative to the small exact denominator it is about 77.85 percent. Calling the curves close requires specifying which of these comparisons matters for the intended use.
The displayed helper accepts steps between 0.1 and 2.5 seconds, but the buttons expose only four choices. Internally it keeps complete steps at or before ten seconds. A paper choice of 0.3 seconds would therefore stop at 9.9 seconds after thirty-three updates, not at ten. This is not an extra control to find in the page. It explains why extending numerical experiments requires checking actual endpoint times. Comparing that endpoint directly with exp of minus ten would mix a timing difference with the approximation error one intended to measure.
Two error measures at ten seconds
Quantity
Calculation
Value
Exact amount
exp(−10)
0.000045400
Euler amount
0.75 to power 40
0.000010057
Absolute error
Magnitude of difference
0.000035343
Relative error
Absolute / exact
77.85%
Both runs cover ten seconds from amount one under unit-rate decay. Relative error uses the exact endpoint as denominator, not the initial amount. A small absolute difference can therefore coexist with a large relative error near zero.
A useful exact comparison holds the endpoint fixed and evaluates the exact formula at each numerical sample time. Refinement then changes the step while retaining that endpoint, as in the separate two-second example. With no exact formula, comparison against a substantially finer run can detect disagreement, but both runs might share errors or lie outside a convergent regime. A practical bound needs more information about the method and equations. The stable decay lab supplies an unusually strong reference precisely because exp of minus time is known independently of the numerical updates.
Three different uncertainties
Initial-condition error is uncertainty about the starting state. Model error is a mismatch between the assumed rule and the real system. Numerical error arises while approximating the chosen rule, including discretization and floating-point roundoff. They can interact but are not interchangeable.
Keep the physical time interval fixed when comparing step sizes. Otherwise a fine-step run with the same number of steps covers less time, which can falsely make it look more predictable. The chart labels elapsed seconds, not array positions.
Keep the error sources distinct
Initial-state error changes the starting value while keeping the rule unchanged. In the constructed decay problem with rate 0.4 per second, starting at 3.03 rather than three adds 0.03 initially. Under the exact rule, that difference shrinks by the same exponential retention as the amount itself. At two seconds the difference is about 0.013480. This system therefore reduces absolute initial differences rather than amplifying them. Sensitivity cannot be inferred merely because a simulation contains uncertain inputs, and a numerical error example need not involve chaotic dynamics to teach error diagnosis.
Model error changes the assumed evolution rule relative to the intended physical system. Suppose the intended rate were 0.42 per second but the model used 0.4. From the same initial amount three, the exact two-second endpoints would be about 1.295132 and 1.347987. A smaller Euler step for the 0.4 model approaches the latter answer, not the former. Numerical convergence can therefore solve the wrong physical model more accurately. These stipulated rates isolate the distinction algebraically; neither is a measured estimate for a real material or an atmospheric forecast.
Change one assumption at a time
Case at two seconds
Endpoint amount
Change from reference
Exact, y₀ = 3, k = 0.4/s
1.347986892
Reference
Exact, y₀ = 3.03, k = 0.4/s
1.361466761
+0.013479869
Exact, y₀ = 3, k = 0.42/s
1.295131570
-0.052855322
Euler, y₀ = 3, k = 0.4/s
1.228800000
-0.119186892
The reference is exact decay from three at rate 0.4 per second. Rows change the initial amount, physical-rate assumption, or discretization separately. The Euler row uses half-second steps. These constructed differences are not measured forecast-error components.
Discretization error keeps both the initial amount and the intended continuous model fixed while changing how its evolution is approximated. For rate 0.4, amount three, and half-second Euler steps, the two-second amount is 1.2288 rather than about 1.347987. Refining that step targets this particular discrepancy. It does not correct an incorrect starting amount or choose a better physical rate. In a real forecast those sources can interact, so their total error is not usually a sum of three separately observable numbers. The constructed comparisons change one assumption at a time.
Roundoff is another numerical effect, caused by representing and manipulating numbers with finitely many digits. It exists even if the chosen update formula introduces no discretization error for its intended discrete model. As an illustrative calculation, suppose each update with retention 0.8 adds a rounding discrepancy of plus 0.001. Starting with zero error, the errors after successive updates are 0.001, 0.0018, 0.00244, and 0.002952. This is a specified arithmetic perturbation sequence, not random physical forcing. Actual floating-point rounding need not have this sign, size, or pattern across a calculation.
The error recurrence in that illustration is old error times 0.8 plus the newly introduced discrepancy. If every new discrepancy has magnitude at most 0.001, the triangle inequality, which says that the magnitude of a sum is at most the sum of its magnitudes, bounds the error after n steps by 0.001 times the sum of successive powers of 0.8. That geometric sum is below five, giving a bound below 0.005 for any finite n when starting error is zero. This bound relies on contraction by 0.8 at every step. It does not transfer unchanged to an unstable recurrence or a state-dependent nonlinear system.
Propagate specified arithmetic discrepancies
Update, 0.5 s each
Old error × 0.8
New error after +0.001
1
0
0.001
2
0.0008
0.0018
3
0.00144
0.00244
4
0.001952
0.002952
A separate illustrative recurrence adds exactly 0.001 amount units per update to retention 0.8. The two-second horizon covers four steps. This arithmetic scenario explains accumulation and contraction; it does not model actual machine rounding as physical noise.
Reducing a step changes discretization error, update count, and the arithmetic operations performed. It therefore need not improve every reported digit indefinitely. An appropriate diagnosis distinguishes exact-rule comparisons from assumed perturbation bounds and from physical observations. For this decay equation, the exponential reference and multiplier algebra explain the numerical behavior directly. For a more complicated model, short-time refinement can supply evidence about a chosen output without certifying its entire long-time trajectory. Finite irregular traces alone remain insufficient evidence of chaos, especially when the integration method itself has not passed a relevant accuracy check.
Exercises
Diagnose artificial chaos
A decay simulation oscillates wildly with h = 2.5. Should you conclude the differential equation is chaotic?
Hint
Compare with exp(−t) and the Euler multiplier.
Worked answer
Time in seconds
Euler h = 2.5
Exact value
0
1
1
2.5
−1.5
About 0.0821
5
2.25
About 0.00674
At equal physical times, the disagreement is large.
No. The numerical multiplier is −1.5, which explains the growing oscillation. The exact solution decays smoothly. This is numerical instability, not evidence of chaotic physical dynamics.
Compare equal horizons
Run A takes 100 steps of 0.1 seconds and B takes 100 steps of 0.01 seconds. Is that a fair ten-second comparison?
Hint
Multiply step count by step size.
Worked answer
Run
Steps
Step seconds
Total seconds
A
100
0.1
10
B as proposed
100
0.01
1
B corrected
1000
0.01
10
Step size does not set elapsed time alone.
No. A covers ten seconds and B only one. B needs 1,000 steps to cover ten seconds. Use the same physical endpoint before judging accuracy.
Sources and further reading
Selected reference passages support the definitions and modeling distinctions below. The examples, explanations, and implementations are original. Terminology and assumptions are stated within each lesson; source review is not an independent audit of this course. Optional links are not runtime dependencies.
Atmospheric dynamics, physical processes, model limitations, and probabilistic forecasting. No current operational resolution or skill claim is inferred.