Few applications involve an initial-value problem with just a single dependent variable. Usually there are multiple unknowns and a system of equations to define them.
We now upgrade our IVP definition, Definition 6.1.1.
We use the terms IVP system and vector-valued IVP interchangeably; a system of scalar IVPs can be put into the form of (6.3.3) by appropriate definitions of and , as shown in Example 6.3.1.
6.3.1Numerical solutions¶
The generalization of any scalar IVP solver to handle systems is straightforward. Consider Euler’s method, which in system form becomes
The vector difference equation (6.3.4) is just Euler’s formula applied simultaneously to each component of the ODE system. Because operations such as addition and multiplication translate easily from scalars to vectors, Function 6.2.2 that we wrote for scalar IVPs works for systems as well. Practically speaking, the only changes that must be made are that the initial condition and the ODE function have to be coded to use vectors.
In the rest of this chapter we present methods as though they are for scalar equations, but their application to systems is taken for granted. The generalization of error analysis can be more complicated, but our statements about order of accuracy and other properties are true for systems as well as scalars. The codes are all written to accept systems.
6.3.2Transformation of high-order systems¶
Fortunately, the ability to solve first-order ODE systems implies the ability to solve systems of higher differential order, too. The reason is that there is a systematic way to turn a higher-order problem into a first-order one of higher dimension.
The trick illustrated in the preceding examples is always available. Suppose is a scalar dependent variable in the system. You should introduce a component of for , , etc., up to but not including the highest derivative appearing anywhere for . This is done for each scalar variable in the original system. There should be one component of for each scalar initial condition given. Many equations for the first-order system then come from the trivial relationships among all the lower derivatives. The remaining equations for the system come from the original, high-order equations. In the end, there must be as many scalar component equations as unknown first-order variables.
6.3.3Exercises¶
✍ Rewrite the given higher order problems as first-order systems.
(a)
(b)
(c) For a given constant ,
with initial values , ,
(d)
(e)
✍ Write the given IVP as a system. Then do two steps of Euler’s method by hand (perhaps with a calculator) with the indicated step size . Using the given exact solution, compute the error after the second step.
(a)
(b)
(c)
(d)
⌨ Solve the following IVPs using Function 6.2.2 using steps. Plot the solution and its first derivative together on one plot, and plot the error in each component as functions of time on another.
(a)
(b) ;
(c)
(d)
(e)
(f)
(g)
(h)
(i) ;
(j) ;
⌨ A disease that is endemic to a population can be modeled by tracking the fraction of the population that is susceptible to infection, , and the fraction that is infectious, . (The rest of the population is considered to be recovered and immune.) A typical model is the SIR model (see Britton (2003))
Starting with and , use
solve
to find the long-term steady values of and . Plot both components of the solution as functions of time.⌨ In each case below, use
solve
to solve the given ODE for with the given initial conditions. Plot the results together as curves in the phase plane (that is, with and as the axes of the plot), usingaspect_ratio=1
in the plot command.(a)
with and .
(b)
with , , and .
⌨ The FitzHugh–Nagumo equations are a simple model of the repeated firing of a neuron. They are given by
Assume , , , , . For each value of below, find and plot the solution using
solve
for . The solutions are highly sensitive to , and you need to change the requested absolute and relative error tolerances to 10-9. In each case the solution quickly approaches a periodic oscillation.(a) (b) (c) (d) .
This exploration was carried out by Baer and Erneux Baer & Erneux (1986).
- Britton, N. F. (2003). Essential Mathematical Biology. Springer.
- Baer, S. M., & Erneux, T. (1986). Singular Hopf Bifurcation to Relaxation Oscillations. SIAM Journal on Applied Mathematics, 46(5), 721–739. 10.1137/0146047