Visualisation
Analytic techniques for the solution of ODEs give a closed form solution describing the dependent variable as the independent variable varies. However, a lot of information may be obtained by visualising ODEs. This section focuses on the approximate representation of solutions using the direction field.
Direction fields
Recall the definition of tangent lines: if defines a function of whose derivative, exists on an interval (where, and are constants), then gives the slope of the graph of this function at each point whose coordinate is in . A geometric view of the DE is given by direction fields which help us visualise the solutions to the DE and their late-time behaviour.
To illustrate these ideas, we consider the example of a falling object. Consider a particle of mass falling under the action of gravity. It is assumed that only two forces act on the subject: air resistance and gravity , as shown in Fig. 11.2.
The total force, , acting on the object is given by the sum of the two forces,
note, here we chose the upward direction to be negative, while the downward direction is taken to be positive, . By Newton's second law, the total force acting on the object is directly proportional to the acceleration, , produced by it,
We model the two forces and as follows. We take the air resistance to be proportional to the velocity of the object, , which in turn is taken to be a function of time, , i.e. . Using is as the constant of proportionality, the air resistance may be modelled by
while the gravitational force is given by,
where is the gravitational acceleration. To make calculations in this section easier, is approximated to . Equations (11.13) - (11.15) may be combined to give,
With acceleration represented as the rate of change of velocity with time, , Eq. (11.16) may be expressed in terms of a differential equation for ,
Suppose and , Eq. (11.17) becomes,
Figure 11.2: Labelled force balance for the falling object; denotes air resistance and is the force under gravity.
Equation (11.18) represents a first-order, ordinary differential equation for and note that the dependence of (the independent variable) only appears implicitly through . Now, any solution to this ODE, has as the gradient at a value of . We illustrate this by choosing a series of values for and simply drawing arrows at each - along the -axis - with slope .
Suppose that at some point, the velocity of the object reaches ; plugging this value in Eq. (11.18) yields
This implies that, for all time for which the velocity of the object reaches 5 , the acceleration is zero. In a graph, zero acceleration is depicted by a zero-slope gradient shown by arrows drawn horizontally. This is shown in Fig. 11.3 for and . Let us now assume that at some time , the velocity reaches ; in Eq. (11.18), this
Figure 11.3: Direction arrows corresponding to Eq. (11.18) when .
gives a gradient of -2 , indicating that at , the velocity of the object is decreasing. Adding this information to Fig. 11.3, we have arrows depicting a negative gradient equal to -2 when . Again note that when for all values of . For , for all values of . Figure 11.4 adds to Fig. 11.3 showing the direction field for (red arrows) and (green arrows).
Figure 11.4: Direction field corresponding to ODE (11.18) for (blue arrows) and (red arrows), and (green arrows).
Continuing this way, i.e. by plugging in values for to determine the slope, gives us a way to visualise the direction field within the entire interval of interest which, in turn, helps us understand how the solutions to the ODE behave. Figure 11.5 shows the direction field generated for various values of . Note that the direction fields in both panels, (a) and (b) are equivalent; arrowheads are not always included on the line segments. When omitted, the plot is referred to a slope field since it lacks direction.
(a)
(b)
Figure 11.5: Direction field corresponding to ODE (11.18). The slopes of the line segments are identical in both panels; the arrows in panel (a) indicate slope and direction while in panel (b), the line segments merely indicate slope.
How can we use a plot showing the direction field to extract information on the behaviour of the ODE solutions? The arrows we have been drawing so far represent the tangents to the solutions to the differential equation (11.18). For instance, suppose we are given that, at , the velocity of the object is (this is the initial condition). At , we know that the solution [i.e. ] is increasing since the gradient is positive. At , we have a single point on the plot; as time evolves, we follow the direction of the arrows and, as the gradient becomes less and less positive, the solution becomes less and less steep. This is shown in Fig. 11.6; starting with the IC at and following the direction of the arrows, we trace the green solution on the plot. The graphical view of the solution to a DE using the direction field is known as an integral curve. Figure 11.6 shows two more integral curves. The black solution corresponds to the IC ; following the zero-slope arrows, we stay at for all time. The red solution corresponds to the IC ; immediately after , the solution for decreases fast (indicated by the steep negative gradient) and slows down as it approaches .
Figure 11.6: Direction field for ODE (11.18) with three integral curves (solutions): the red, black, and green curves correspond to initial conditions given at and , and 4 , respectively.
Solving differential equations exactly or even numerically is generally not an easy task. Therefore, having a method to visualise the solution like, for example, using the direction field is useful. An ODE given in terms of an equation, for instance
is an analytic representation. A direction field, is the geometric representation of the ODE. Moreover, the analytic representation of a solution is again given in terms of an equation, for instance in explicit form,
while the integral curve is the geometric analogue.
Isoclines
In the example of the falling object, the resulting ODE was simple enough such that the direction field was easily drawn by plugging in various values of in the ODE. Now, take a more general form of a first-order ODE, for example
where and is the independent variable. Assuming that is a complicated function of and then the method we used in Subsec. 11.2.1 to obtain the direction field would prove to be tedious. The method of isoclines gives a quick way to obtaining the direction field. An isocline is a set of points (a line or a curve) where all direction field arrows that lie on it have the same slope.
The method
Algebraically, we obtain the isoclines corresponding to an ODE by solving the following equation
where is some constant. We show how to obtain the isoclines with the help of the following ODE,
Note that in Eq. (11.20), the independent variable is explicitly present as opposed to the ODE from the falling object example.
Step 1:
Set the differential equation given in Eq. (11.20) to some constant, say
which, rearranged, gives
The equations in (11.22) define the isoclines. Please note that these are not solutions to the ODE.
Step 2:
Draw several isoclines by choosing different values for the constant . For example, in Eqs. (11.22), for , the isocline is given by the line [see Fig. 11.7(a)].
Step 3:
On each isocline, draw line segments (or arrows) along the line, each having a slope . In Fig. 11.7(b), the isocline is generated with and therefore the line segments drawn on the line are of slope All line segments drawn on the line have the same slope (a slope of 1 ). Apart from the isocline , there exist no other regions with a slope field equal to 1.
Step 3 is repeated with different values of thus finding all the regions of equal slope, gradually generating the direction field corresponding to the differential equation. A value of yields the isocline on which the line segments have a slope equal to
Note that, in this case, the isocline and the line segments are perpendicular to each other because the product of their slopes is -1 .
(a)
(c)
(b)
(d)
Figure 11.7: (a) Isocline corresponding to in Eq. (11.22) with equation . (b) Isocline [from panel (a) and line segments of slope . (c) Additional isocline for (equation of line: ) and line segments (blue) with slope . (d) Direction field to ODE (11.20) and several isoclines generated with different values of
[see Fig. 11.7(c)]. Figure 11.7(d) shows the direction field in and (note that only a few isoclines are shown here).
Visualising the solution
We can obtain insight on the behaviour of the ODE solutions, once we have the direction field by following the arrows as done in the falling object example. Integral curves are drawn by choosing a particular point in the plane, keeping in mind that the integral curve (i.e. the solution) is tangent to the line segments/arrows. We can probably see from Fig. 11.7(d), that the solution forms a circle; see Fig. 11.8 for a particular solution (actually two solutions) to the ODE shown together with the direction field. From Definition 11.1, a particular solution is valid if it is continuous and satisfies the initial condition. The derivative is undefined at [see Eq. (11.21)]; hence the solution shown in Fig. 11.8 is made up of two semi-circles. The first one (shown in red) is defined for and was generated using as the IC while the second one (shown in black) is defined for and was generated using as the IC. Which part is to be accepted as the solution to an IVP ultimately depends on the initial conditions.
Figure 11.8: Direction field to ODE (11.21) and the corresponding integral curves. The red solution is generated using as the IC while the black solution is generated using as the IC.
Horizontal & vertical isoclines
If we were to use the method of isoclines for the falling object example earlier in this chapter, then all isoclines would be horizontal. In fact, any ODE of the form,
where , has horizontal isoclines. The slope of the line segments on the isoclines of course depends on the corresponding value of .
Any ODE of the form,
where, again, has vertical isoclines.
The shape of the isoclines corresponding to the differential equations that take the more general form,
depend on the actual form of the original equation.