This document is compiled from classroom lectures and in-depth discussions. Starting from the predator-prey (Lotka-Volterra) equations, it systematically introduces the concept and verification of invariants (conserved quantities), why the standard Euler method fails, the principles and implementation of structure-preserving (symplectic) methods, and extends to the general theory of Hamiltonian systems.
1. Predator-Prey Model (Lotka-Volterra Equations)
1.1 System of Equations
Here is the predator population, is the prey population, and the dot denotes differentiation with respect to time .
1.2 Ecological Logic (Teacher's Classroom Derivation Process)
The teacher did not give the answer directly but guided students to infer which variable, or , represents which species through constraints from the ecological cycle:
| Ecological Phenomenon | Mathematical Meaning |
|---|---|
| Prey increase → Predator increase (abundant food) | When increases, |
| Predator increase → Prey decrease (being eaten) | When increases, |
| Prey depletion → Predator extinction | When , (stops growing) |
Comparing with the equations:
- : When , (predator grows); when , it decreases ✓
- : When , (prey decreases); when , it increases ✓
1.3 Autonomous Equation
【Term】Autonomous Equation: A differential equation whose right-hand side function does not explicitly depend on time . This means the system's evolution law is determined solely by the current state, not by time itself.
Key Property of Autonomous Equations: In the phase plane ( - plane), the solution curves are closed curves (for conservative systems), corresponding to the periodic coexistence of the two populations, with neither species going extinct.
1.4 Concept of Flow
For a given initial value , the equation has a unique solution , which depends on the initial value:
is called the Flow of the equation, which can be understood as an operator: mapping the initial state to the state at time .
Teacher: "The concept of flow is equivalent to an operator. Given an initial value, you get a solution."
2. Invariants (Conserved Quantities)
2.1 Definition
If there exists a function such that along the true solution of the equation, the derivative of with respect to time is always zero:
Then is called an Invariant (conserved quantity) of the system of equations.
2.2 Invariant of the Lotka-Volterra Model
The invariant for this system is:
2.3 Verification of (Complete Derivation)
Differentiate with respect to , using the chain rule:
Calculate the partial derivatives:
Substitute the system of equations , :
The two terms cancel exactly; this is an inherent property of the system's structure, not a coincidence.
2.4 Geometric Meaning of
is not the trajectory itself, but a "contour label" on the phase plane.
- Each pair corresponds to a numerical value , like altitude on a map.
- Fixing (some constant) draws a closed curve on the phase plane.
- Different values correspond to closed curves of different sizes, like concentric contour lines.
Behavior of the true solution: Since , starting from the initial value , never changes; the solution always moves along that closed curve.
3. Why Does the Standard Euler Method Fail?
3.1 Formats: Explicit Euler vs. Implicit Euler
Explicit Euler Method:
Both components are updated simultaneously using old values.
Implicit Euler Method:
Both components use new values simultaneously, requiring iterative solution.
3.2 Numerical Experiment Results
| Method | Phase Plane Trajectory | Ecological Meaning |
|---|---|---|
| True Solution | Closed curve (perpetual cycle) | Periodic coexistence of both populations |
| Explicit Euler | Spiral outward explosion | Populations tend to infinity |
| Implicit Euler | Spiral inward contraction | Populations tend to extinction |
Teacher's original words: "You run it, and originally you think it should be a circle, but it might disappear as it runs, or it might run outward and explode."
3.3 Root Cause of Failure: is Destroyed
Each step of the numerical method calculates with an error compared to the true solution. If:
Then the numerical solution lands on another contour line. The next step deviates again, switching to another loop... Switching loops at each step forms a spiral:
- Each step slightly increases ($\varepsilon > 0$) → switch to a larger loop → spiral outward (Explicit Euler)
- Each step slightly decreases ($\varepsilon < 0$) → switch to a smaller loop → spiral inward (Implicit Euler)
3.4 Deeper Mechanism: Area and the Jacobian Matrix
Jacobian Matrix
For the system , , the Jacobian matrix is defined as:
Calculation for the Lotka-Volterra model ($f1 = uv - 2u$, $f2 = v - uv$):
Physical meaning of the Jacobian matrix: Describes the local linear stretching, rotation, and deformation of the system at a point. The determinant of the matrix equals the scaling factor for area under that mapping.
Liouville's Theorem
For Hamiltonian (conservative) systems, the evolution of the true solution preserves phase plane area: any region in phase space may change shape over time, but its area remains unchanged.
This corresponds to energy conservation in the system—neither dissipation nor increase.
Area Scaling by Numerical Methods
Each step of a numerical method is equivalent to applying a mapping to the state. Taking Explicit Euler as an example, the mapping approximates ($I$ is the identity matrix):
For conservative systems, the trace (it can be verified: is zero at equilibrium points but generally not zero; a more precise analysis is at the symplectic structure level), therefore:
| Method | Mapping Matrix per Step | Determinant (Area Ratio) | Result |
|---|---|---|---|
| True flow | Closed orbit | ||
| Explicit Euler | Area expansion → Outward spiral | ||
| Implicit Euler | Area contraction → Inward spiral | ||
| Implicit Midpoint | Symplectic map | Area preservation → Closed orbit |
Intuitive Understanding
- Explicit Euler: Each step goes along the tangent direction; the tangent is always slightly "outside" the arc, causing the trajectory to gradually expand.
- Implicit Euler: Implicit methods "pull inward," each step slightly shrinking, causing the trajectory to gradually contract.
- Area preservation: Only methods with a determinant exactly equal to 1 can keep the orbit faithfully moving on the original contour line.
4. Structure-Preserving Methods
4.1 Core Idea
If the equation itself possesses certain geometric structures (invariants, area preservation, energy conservation, etc.), the numerical method should also preserve these structures at the discrete level. Such methods are collectively called structure-preserving methods (also known as geometric integration methods / symplectic integrators).
Teacher: "If after discretization, it can satisfy this discrete invariant, then it shows your method is definitely good; you basically don't need to consider its stability, it will definitely converge."
Core Conclusion: Existence of a discrete invariant → Numerical solution automatically stable and convergent, no extra verification needed.
4.2 Implicit Midpoint Method
Format
Expanded for Lotka-Volterra:
Why Does It Preserve Structure?
Time symmetry: Replacing (time reversal) leaves the format completely unchanged. This symmetry mathematically guarantees that its update mapping is a symplectic map—the determinant is precisely equal to 1, no more, no less, preserving phase plane area exactly.
Characteristics
| Item | Situation |
|---|---|
| Method Order | Second order |
| Structure-Preserving? | ✓ (Symplectic method) |
| Computational Cost | High, each step requires solving a system of nonlinear equations (usually via Newton iteration) |
| Applicable Scenarios | Higher accuracy requirements, larger step sizes |
4.3 Split Euler Method (Symplectic Euler)
Format
Ordinary Euler updates both components simultaneously, at the same time level; the key to Split Euler is staggering the time levels:
Version A (Update first, then use new to update ):
Version B (Update first, then use new to update ):
Note: After the first equation is computed, the second equation immediately uses the newly calculated value, not the old value.
Teacher's version (for Lotka-Volterra):
$v_{n+1} = v_n + h\cdot f_v(v_{n+1}, u_n)$
Why Does Staggering Preserve Structure?
The Split Euler update can be decomposed into the composition of two triangular transformations, each with determinant 1:
Both lower (upper) triangular matrices have determinant 1, so their composition also has determinant 1, preserving area exactly.
Characteristics
| Item | Situation |
|---|---|
| Method Order | First order |
| Structure-Preserving? | ✓ (Symplectic method) |
| Computational Cost | Low, each step only requires solving one scalar equation (one component is explicit) |
| Applicable Scenarios | Computational efficiency priority, long-term simulation |
4.4 Comparison of the Two Structure-Preserving Methods
| Implicit Midpoint | Split Euler | |
|---|---|---|
| Format | Uses value at | Staggered time levels for the two components |
| Order | Second order | First order |
| Computational Cost | High (nonlinear system) | Low (semi-explicit) |
| Structure-Preserving | ✓ (Symplectic, time-symmetric) | ✓ (Symplectic, triangular decomposition) |
| Time Symmetric | ✓ | ✗ (has directionality) |
Teacher: "You can use the implicit midpoint because it is symmetric, and because it's symmetric, this leads to a class of methods called structure-preserving methods."