Read this lesson as text

Systems of ODEs

Numerical Analysis · Axiom Academy

Extending numerical methods to solve systems of coupled differential equations using vector formulation. Vector Formulation: Writing Systems as y' = f(t, y) Consider a system of n first-order ODEs: We can write this compactly using vectors: Applying Scalar Methods: Euler and RK4 Extend to Vectors The same pattern applies to Runge-Kutta methods: Consider a body orbiting a central mass with gravitational parameter : Converting to a first-order system with state vector : Predator-Prey (Lotka-Volterra) x = prey population y = predator population Populations oscillate cyclically q = charge on capacitor i = current through inductor Damped oscillations Chemical Kinetics: Reaction rates depend on concentrations of multiple species Epidemic Models (SIR): Susceptible, Infected, and Recovered populations interact Neural Networks: Coupled neurons with firing rates and membrane potentials Mechanical Systems: Multi-body dynamics with constraints Implementation Considerations: Array Operations Vectorization: Use NumPy arrays or similar for element-wise operations Avoid Loops: Let array operations handle the component-wise math State Packing: Combine all variables into a single state vector Memory: Pre-allocate arrays for storing trajectory history

This is the written version of the interactive lesson above. See the full Numerical Analysis course.