← Mathematical Foundations

01 · Lesson 03

Ordinary differential equations

An ordinary differential equation, or ODE, specifies how one or more quantities change with respect to a single independent variable, usually time. It describes a rule for movement through time rather than listing the complete trajectory in advance.

Scenario: a medicine is removed from the body

A patient receives a medicine. Let \(A(t)\) be the amount in the body at time \(t\). Suppose a constant fraction of the current amount is removed per hour. More medicine present means more can be removed during the next short interval.

If \(k>0\) is the elimination-rate constant, the model is

\[\frac{dA}{dt}=-kA.\]

The left side is the instantaneous change in the amount. The right side gives the rule for that change. The minus sign represents removal.

Reading a differential equation

ExpressionMeaning
\(t\)Time, the independent variable
\(A(t)\)Medicine amount, the state variable
\(dA/dt\)Instantaneous change in amount per unit time
\(k\)Elimination parameter with units of inverse time
\(-kA\)Modelled removal rate

If \(A\) is measured in milligrams and \(t\) in hours, then \(dA/dt\) has units milligrams per hour. Therefore \(k\) must have units per hour so that \(kA\) has matching units.

The equation is not yet one particular trajectory

The rule \(dA/dt=-kA\) applies to many possible starting amounts. An initial condition selects the trajectory relevant to the patient:

\[A(0)=A_0.\]

Together, the ODE and initial condition form an initial-value problem:

\[\frac{dA}{dt}=-kA,\qquad A(0)=A_0.\]

The differential equation gives the direction and speed of change at each admissible state. The initial condition says where the trajectory begins.

Solution and biological interpretation

The solution is

\[A(t)=A_0e^{-kt}.\]

Differentiating this function returns \(-kA(t)\), so it satisfies the equation. At \(t=0\), it gives \(A_0\), so it also satisfies the initial condition.

The half-life is the time required for the amount to become half its current value:

\[t_{1/2}=\frac{\ln 2}{k}.\]

From biological flows to an ODE

A state increases through inflows and decreases through outflows:

\[\text{rate of state change}=\text{total inflow}-\text{total outflow}.\]

For a population with births \(B(N)\) and deaths \(D(N)\),

\[\frac{dN}{dt}=B(N)-D(N).\]

If births occur at per-capita rate \(b\) and deaths at per-capita rate \(d\), then \(B(N)=bN\) and \(D(N)=dN\), giving

\[\frac{dN}{dt}=(b-d)N.\]

The parameter \(r=b-d\) is the net per-capita growth rate.

Coupled equations

Biological systems often contain interacting states. In an SIR epidemic model, infection moves people from susceptible to infectious, and recovery moves them from infectious to removed:

\[\begin{aligned}\frac{dS}{dt}&=-\beta\frac{SI}{N},\\\frac{dI}{dt}&=\beta\frac{SI}{N}-\gamma I,\\\frac{dR}{dt}&=\gamma I.\end{aligned}\]

These equations are coupled because the rate for one compartment depends on other compartments. They must be considered together.

Adding them gives

\[\frac{d}{dt}(S+I+R)=0,\]

so the total population is conserved under the stated assumptions.

Autonomous and non-autonomous equations

An autonomous ODE has the form

\[\frac{dy}{dt}=f(y),\]

where time affects the state only through the current value of \(y\). A non-autonomous ODE explicitly contains time:

\[\frac{dy}{dt}=f(t,y).\]

A seasonal transmission rate or an intervention beginning on a specified date produces a non-autonomous epidemic model.

Analytical and numerical solutions

An analytical solution is an explicit formula such as \(A(t)=A_0e^{-kt}\). Many nonlinear biological systems do not have a convenient formula. A numerical method then approximates state values at selected times.

RepresentationWhat it provides
Differential equationThe modelled rule for continuous change
Analytical solutionAn exact formula when one is obtainable
Numerical solutionApproximate values computed on a time interval

A numerical solver does not replace the biological model. It approximates the solution of the specified equations and initial conditions.

Conditions and limitations

What this lesson adds

You can now distinguish an ODE from its solution, explain the role of an initial condition, construct equations from biological inflows and outflows, read coupled systems, check units and conservation, and distinguish analytical formulas from numerical approximations.