1Demonstration 1 of 5
Solve a decay problem and watch the stability limit
Is a stable sign-changing trajectory an accurate decay solution?
Compare a computed trajectory with exact exponential decay, including an unstable step.
Euler step h (s). Initial y=1; explicit Euler; normalized decay rate 10/s. Stability alone does not establish accuracy.
Predict first. Is a stable sign-changing trajectory an accurate decay solution?
Choose an example
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.
Calculated values
- Step (s)
- 0.15
- Amplification factor
- -0.5
- Stable (|factor| ≤ 1)
- True
- Last simulated time
- 1.05
- Last absolute error
- 0.00784004
Euler multiplies the state by -0.5 per step. The factor is negative, so the stable trajectory oscillates in sign; stability does not guarantee accuracy.
Use the idea
Use rule 22.3.1 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.
Where the conclusion applies
Initial y=1; explicit Euler; normalized decay rate 10/s. Stability alone does not establish accuracy.
Check your understanding: Is a stable sign-changing trajectory an accurate decay solution?
Book source: Rule 22.3.1: Check explicit Euler against the stability disk. Demonstration C22-D01. Worked illustration.
2Demonstration 2 of 5
Verify RK4 by step halving
What error reduction does fourth order predict?
Run the RK4 update to a common endpoint and measure error against the exact solution.
RK4 step h. Smooth scalar decay, exact common endpoint, floating-point accuracy limits at very fine steps.
Predict first. What error reduction does fourth order predict?
Choose an example
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.
Calculated values
- Selected step
- 0.125
- Endpoint absolute error
- 8.30751e-07
- Coarser / selected error
- 17.7649
These trajectories solve y′=−y, y(0)=1 to t=1. Halving h approaches a factor-of-sixteen global error reduction. Roundoff eventually limits such a trend.
Use the idea
Use rule 22.3.2 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.
Where the conclusion applies
Smooth scalar decay, exact common endpoint, floating-point accuracy limits at very fine steps.
Check your understanding: What error reduction does fourth order predict?
Book source: Rule 22.3.2: Expect RK4 global error to fall by sixteen on step halving. Demonstration C22-D02. Worked illustration.
3Demonstration 3 of 5
Check an oscillator through its energy
Does bounded energy error prove an accurate phase?
Compare explicit and symplectic Euler over forty time units. Energy drift exposes behavior not captured by a local residual.
Integrator step h. Normalized harmonic oscillator; symplectic Euler does not exactly preserve original energy or certify phase accuracy.
Predict first. Does bounded energy error prove an accurate phase?
Choose an example
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.
Calculated values
- Step
- 0.1
- Explicit final energy
- 26.7621
- Symplectic final energy
- 0.526307
The normalized oscillator q′=p, p′=−q has exact energy .5. Explicit Euler gains energy every step and ends at 26.76, about 54 times too much. Symplectic Euler stays within 0.026 of .5. That bounded error is why long orbit and molecule runs use symplectic methods. It still does not prove the timing (phase) is right.
Use the idea
Use rule 22.1.3 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.
Where the conclusion applies
Normalized harmonic oscillator; symplectic Euler does not exactly preserve original energy or certify phase accuracy.
Check your understanding: Does bounded energy error prove an accurate phase?
Book source: Rule 22.1.3: Use symplectic integrators for long Hamiltonian trajectories. Demonstration C22-D03. Worked illustration.
4Demonstration 4 of 5
Watch stiffness force tiny explicit steps
Why does explicit Euler blow up at λ=1000 when the solution is smooth?
The true solution just follows cos t, yet explicit Euler fails as λ grows. Implicit Euler takes the same step safely.
Decay rate λ (1/s). y(0)=0, step h=0.025 s, t from 0 to 2 s. Explicit curve clipped at ±3 for display.
Predict first. Why does explicit Euler blow up at λ=1000 when the solution is smooth?
Choose an example
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.
Calculated values
- Decay rate λ (1/s)
- 60
- Step h (s)
- 0.025
- Explicit factor 1−hλ
- -0.5
- Explicit stable step limit 2/λ (s)
- 0.0333333
- Explicit steps needed on [0,2]
- 60
- Explicit max error
- 0.723242
- Implicit max error
- 0.176946
The solution just follows cos t, which a step of 0.025 s resolves easily. Explicit Euler, though, needs h below 2/λ=0.0333 s to stay stable. At λ=60 the step is stable but the factor -0.5 is negative, so explicit Euler overshoots and zigzags around the true curve for the first few steps, until repeated factors of −0.5 die out; implicit Euler does not.
Use the idea
Use rule 22.1.1 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.
Where the conclusion applies
y(0)=0, step h=0.025 s, t from 0 to 2 s. Explicit curve clipped at ±3 for display.
Check your understanding: Why does explicit Euler blow up at λ=1000 when the solution is smooth?
Book source: Rule 22.1.1: Suspect stiffness when stability, not accuracy, dictates tiny steps. Demonstration C22-D04. Worked illustration.
5Demonstration 5 of 5
Count steps per period before trusting an oscillation
RK4 is fourth order. Is 4 steps per period enough?
Integrate q′=p, p′=−q with RK4 for ten periods and look at the last two. Too few steps per period lose amplitude and timing.
RK4 steps per period. Harmonic oscillator, period 2π, q(0)=1, p(0)=0; fixed step RK4.
Predict first. RK4 is fourth order. Is 4 steps per period enough?
Choose an example
Constructed teaching inputs; calculations executed locally. Supported menu choices are precomputed.
Calculated values
- Steps per period
- 10
- Step h
- 0.628319
- Amplitude after 10 periods
- 0.960178
- Amplitude loss (%)
- 3.98218
- Phase error after 10 periods (degrees)
- -4.03473
With 10 steps per period, after 10 periods RK4 keeps 96.02% of the amplitude and is 4.03° off in phase. That is usable for a few periods, but the errors grow every cycle, so long runs need more steps. Count steps per shortest period before trusting any oscillation.
Use the idea
Use rule 22.1.5 when its stated conditions fit. Compare the calculation with your own decision threshold; retain the relevant error or uncertainty.
Where the conclusion applies
Harmonic oscillator, period 2π, q(0)=1, p(0)=0; fixed step RK4.
Check your understanding: RK4 is fourth order. Is 4 steps per period enough?
Book source: Rule 22.1.5: Resolve oscillations with several steps per shortest period. Demonstration C22-D05. Worked illustration.
Bring the idea to a question of your own
Choose the relationship that answers your question, check its conditions, and compare the result with the accuracy or decision threshold you need.
The chapter skill can adapt these calculations to your inputs. It should name the assumptions, explain what the result supports, and say what still needs evidence. The chapter workbook adds a lab and three exercises with answers.