Ode Models

Overview

Ordinary differential equations (ODEs) describe how a quantity changes over time as a function of its current state. While the general-purpose ODE solvers handle arbitrary user-defined systems, many scientific disciplines rely on a core set of canonical models—well-studied systems with known behaviors, parameter interpretations, and real-world applications. These classic ODE models appear repeatedly across biology, chemistry, physics, and engineering, serving as both pedagogical tools and practical simulation frameworks.

This section provides pre-built implementations of these foundational models, allowing you to simulate epidemics, neuronal firing, chemical oscillations, predator-prey dynamics, and chaotic systems directly in Excel without writing differential equations from scratch.

Epidemiological Models

Compartmental models in epidemiology divide a population into discrete health states and describe the flow between them using coupled ODEs.

  • SIR model (Susceptible-Infected-Recovered): The foundational epidemic model. Individuals move from susceptible (S) to infected (I) to recovered (R). Key parameters include transmission rate (\beta) and recovery rate (\gamma). The basic reproduction number R_0 = \beta / \gamma determines whether an outbreak will occur.

  • SEIR model (Susceptible-Exposed-Infected-Recovered): Extends SIR by adding an exposed (E) compartment representing the latency period between infection and infectiousness. Critical for diseases with significant incubation times like measles or COVID-19.

These models have been instrumental in understanding disease dynamics and informing public health interventions.

Neuronal Models

Computational neuroscience uses differential equations to model the electrical activity of neurons.

  • FitzHugh-Nagumo model: A simplified two-dimensional reduction of the Hodgkin-Huxley model. It captures the essential dynamics of action potential generation and neuronal excitability using a fast activator variable (voltage) and a slow recovery variable. Exhibits limit cycles, threshold behavior, and excitability.

  • Hodgkin-Huxley model: The landmark four-dimensional model that won the 1963 Nobel Prize. Describes voltage-gated ion channels (sodium and potassium) in the squid giant axon. It accurately reproduces action potential shape, refractory periods, and propagation velocity, though at the cost of computational complexity.

Ecological Models

Mathematical ecology uses ODEs to describe population dynamics and species interactions.

  • Lotka-Volterra predator-prey model: The classic system describing oscillatory interactions between predators and prey. Exhibits characteristic cyclic dynamics where prey populations rise, followed by predator populations, then prey crash, then predators decline, repeating indefinitely. Though simple, it introduces core concepts like population cycles and trophic interactions.

Chemical Kinetics

Chemical kinetics describes how concentrations change over time according to reaction rates.

Pharmacokinetics

Pharmacokinetics (PK) describes how drug concentrations change over time through absorption, distribution, metabolism, and elimination.

  • Compartmental PK model: The basic one-compartment model treats the body as a single well-mixed volume. Drug input (dosing) and output (elimination, typically first-order) determine plasma concentration over time. Essential for dose-response calculations and therapeutic drug monitoring.

Oscillators and Chaotic Systems

Some ODE systems exhibit complex temporal behaviors that illustrate fundamental dynamical phenomena.

Native Excel capabilities

Excel has no built-in ODE solvers. The closest approximations are:

  • Manual Euler method: You can implement simple forward Euler integration by hand using formulas like =Previous_Y + dt * f(Previous_Y, t). This requires extensive spreadsheet setup, is first-order accurate (low precision), and becomes cumbersome for systems with more than two variables.

  • Solver Add-in: Can be used for boundary value problems but not initial value problems (IVPs) which are the focus of ODE models.

  • Goal Seek: Single-variable root-finding, not applicable to dynamic simulation.

Python functions provide access to robust, adaptive Runge-Kutta methods via scipy.integrate.solve_ivp, which automatically adjust step sizes for accuracy and stability.

Third-party Excel add-ins

  • Numerit: A statistical and econometric add-in that includes basic ODE solving capabilities, though primarily focused on time series analysis.

  • xlODE: A specialized (though somewhat dated) add-in specifically designed for solving ODEs in Excel. Implements several integration methods including Runge-Kutta.

  • MATLAB Excel Link: Allows calling MATLAB’s powerful ODE solvers (ode45, ode15s, etc.) from Excel via COM automation, though this requires a MATLAB license.

Most serious ODE modeling in practice uses dedicated environments (MATLAB, Python, R) or domain-specific tools like COPASI (biochemical systems) or Berkeley Madonna (general ODE modeling). The Python functions here bridge the gap by bringing these capabilities directly into Excel.

Tools

Tool Description
BRUSSELATOR Numerically solves the Brusselator system of ordinary differential equations for autocatalytic chemical reactions.
COMPARTMENTAL_PK Numerically solves the basic one-compartment pharmacokinetics ODE using scipy.integrate.solve_ivp.
FITZHUGH_NAGUMO Numerically solves the FitzHugh-Nagumo system of ordinary differential equations for neuron action potentials using scipy.integrate.solve_ivp.
HODGKIN_HUXLEY Numerically solves the Hodgkin-Huxley system of ordinary differential equations for neuron action potentials.
LORENZ Numerically solves the Lorenz system of ordinary differential equations for chaotic dynamics.
LOTKA_VOLTERRA Numerically solves the Lotka-Volterra predator-prey system of ordinary differential equations.
MICHAELIS_MENTEN Numerically solves the Michaelis-Menten system of ordinary differential equations for enzyme kinetics using scipy.integrate.solve_ivp.
SEIR Numerically solves the SEIR system of ordinary differential equations for infectious disease modeling using scipy.integrate.solve_ivp.
SIR Solves the SIR system of ordinary differential equations for infection dynamics using scipy.integrate.solve_ivp (see scipy.integrate.solve_ivp).
VAN_DER_POL Numerically solves the Van der Pol oscillator system of ordinary differential equations.