Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Overview: Making Time Flow

ODE Methods & Conservation | Numerical Methods Module 3 | COMP 521

The Big Picture: Learning Dynamics Through Failure

A problem we can test before solving an orbit

An isolated harmonic oscillator has an exact solution and constant energy. That makes it a useful first test for an orbit integrator: if our discrete update creates energy here, we can identify the mechanism before adding gravitational encounters or complicated initial conditions.

Start with a position and velocity, advance both along their current derivatives, and repeat. This is Euler’s method. Each step looks reasonable, yet the phase-space radius grows. A different arrangement of almost the same force evaluations—leapfrog—has different geometry and different long-time behavior. We will derive both outcomes rather than infer them from a plot.

The historical difficulty of the many-body problem does not mean every three-body motion is chaotic or that analytic solutions never exist. The practical numerical question is narrower: for the equations, initial state, duration, and observable we chose, what evidence supports the result?

That question leads through the whole module. We compare state error, energy error, phase error, and computational work because each measures something different. A trajectory that looks closed may have the wrong period; an energy that stays bounded may accompany an accumulating phase error.

Your Mission: Preserve Physics Through Time

You’re about to discover that simulating the universe’s evolution is a battle against accumulating errors:

The central lesson is that local accuracy, stability, and geometric preservation answer different questions. None automatically dominates the others. A second-order symplectic method can be useful for long conservative integrations; a fourth-order adaptive method can be preferable for a precise short trajectory. Both choices need an accuracy target and verification.

Why this matters in computational astrophysics

Orbit propagation, stellar evolution, chemical networks, and radiation hydrodynamics all involve time evolution. They do not all have the same conservation laws or timescales. A cooling gas should lose thermal energy; a conservative oscillator should not. Before selecting a method, state which equations and diagnostic apply to the system being modeled.

In these readings, the oscillator provides a shared, dimensionless benchmark. The physical applications explain how to transfer the reasoning, not how to replace a full scientific model with a toy problem. The goal is to understand what a solver’s accuracy and stability statements actually promise.

Quick Navigation Guide

🎯 Choose Your Learning Path

🚶 Standard Path

Full conceptual understanding

Everything in Fast Track, plus:

🧗 Complete Path

Deep dive with all details

Complete module including:

A guide to reading the experiments

Before running an example, write down what the exact system should do. For the oscillator, energy is constant and the phase advances at a known rate. Then predict which numerical defect should appear and which plot would reveal it. A trajectory plot is useful, but often hides a small systematic error.

After running, compare at least two resolutions over the same physical time. Changing both the step and final time makes an error ratio ambiguous. Record whether the method is in its stable range, whether the predicted leading order is visible, and whether rounding has become significant.

Finally, ask what the experiment does not establish. Preserving an oscillator invariant does not validate a gravitational force calculation; passing an energy test does not prove accurate phase; repeatable output does not prove the equations match the physical problem. These boundaries are part of the scientific interpretation, not reasons to avoid numerical experiments.

Mathematical Foundations

Module Contents

Part 1: The Failure of Naive Integration

Derive Euler’s update, then compare its predicted and measured energy and phase errors on an undamped oscillator. Distinguish this instability from its behavior on a decay problem. Use the equations and the observable to choose the next diagnostic.

Part 2: Building Better Methods - Runge-Kutta

Construct the Runge-Kutta family from Taylor series. Connect RK weights to quadrature rules from Module 2. Implement adaptive timestep control. Discover why fourth-order state accuracy does not imply exact energy conservation.

Part 3: Symplectic Integration - Geometry Over Accuracy

Learn what preserving phase-space structure adds to an accuracy calculation. Prove leapfrog’s symplecticity. Understand modified Hamiltonians and bounded energy error. Master the art of choosing between accuracy and conservation.

Part 4: Stability Analysis

Analyze when and why numerical methods explode. Diagnose stiff equations that force tiny timesteps. Understand stability regions in the complex plane. Learn when implicit methods become essential despite their computational cost.


Ready to begin? Let’s start with Part 1 and watch Euler’s method destroy the physics it’s trying to simulate — then learn how to do better!