## Numerical Integration of Differential Equations 151 General

It was our intention in presenting Section 1.4 to provide the motivation for the use of numerical analysis, as opposed to analytical integration, for modelling the dynamics of complicated reaction schemes. It will become obvious that numerical integration can be a robust and reliable means of solving arrays of nonlinear differential equations. The only disadvantage of this approach is that an analytical or general expression is not obtained, only a series of numbers expressed as InterpolatingFunction objects in Mathematica. Hence a feeling for how changes in parameter values affect a solution really only emerges from repeated simulations rather than from inspecting and manipulating an analytical expression. On the other hand, numerical integration turns out to be the only tractable computational method for modelling time courses of schemes with myriad reactants. Therefore, we proceed by developing an understanding of this part of numerical analysis to a level that is sufficient for our current purposes.®

We concentrate first on solving a single first-order ordinary (with no partial derivatives) differential equation that has one initial condition. Importantly, the methods that we develop can be easily extended to arrays of simultaneous differential equations. In general, the single differential equation that describes a simple first-order reaction is expressed as

Equation [1.21] can be viewed as the specification of a family of curves for which the slope at any point (t, y) is given by the formula f[t, y]; and Eqn [1.22] ties down the actual function, y[t], to being one particular member of the family of curves. In other words, a solution of Eqns [1.21] and [1.22] is defined as the expression for y given in terms of various parameters, as well as t, that satisfies both of the equations. This is illustrated with the three functions in the next example. If we declare that the initial condition is y = 1, then the particular function that we have identified is the one labelled y2 in the example below.

Q: What is the effect on the shape, or the relative position, of the exponential curves that are solutions of Eqn [1.21], brought about by changing the value of the pre-exponential coefficient?

A: The plots are as follows:

AxesLabel ^ {"t", " y y1 y2 y3"}];

y' = f [t,y] , where the prime denotes the first derivative, and the initial condition is y[t o] = yo .

y yi y2 y3 Figure 1.8. Plots of the function y = A e' for three different values of A: 2, 1, and 0.5, respectively.

Figure 1.8. Plots of the function y = A e' for three different values of A: 2, 1, and 0.5, respectively.