ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL
Unit 12 -- Slope Fields
Industrial Mathematics Institute
Columbia, SC 29208
URL: http://www.math.sc.edu/~meade/
E-mail: meade@math.sc.edu
Copyright © 2001 by Douglas B. Meade
All rights reserved
-------------------------------------------------------------------
>
Outline of Unit 12
>
Initialization
> restart;
> with( DEtools ):
> with( plots ):
> with( linalg ):
Warning, the name changecoords has been redefined
Warning, the name adjoint has been redefined
Warning, the protected names norm and trace have been redefined and unprotected
>
A slope field displays information about rates of change for ordinary differential equations. For a first-order ODE
,
the slope field shows the slope of the function y for all values of
and
. That is, at the point (
,
) in the domain of f, the "minitangent" with slope
is displayed. A slope field should not be confused with a direction field. A direction field is a graphical tool for analyzing a system of ODEs (see
Unit 13).
Consider the differential equation
> ode1 := diff( y(t), t ) = 2*abs(y(t)) - t;
>
Note that this equation is not linear. It is not solvable by any of the analytic methods discussed in the ODE PowerTool. In fact, Maple is uable to find an analytic solution to this equation.
> infolevel[dsolve] := 3:
> dsolve( ode1, y(t) );
> infolevel[dsolve] := 0:
Methods for first order ODEs:
Trying to isolate the derivative dy/dt...
Successful isolation of dy/dt
-> Trying classification methods
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying Chini
differential order: 1; looking for linear symmetries
trying exact
Looking for potential symmetries
-> Trying 2nd set of classification methods
1st order, trying Lie symmetry methods
trying symmetry patterns for 1st order ODEs
trying a symmetry pattern of the form [F(x)*G(y), 0]
trying a symmetry pattern of the form [0, F(x)*G(y)]
trying symmetry patterns of the forms [F(x),G(y)] and [G(y),F(x)]
trying a symmetry pattern of the form [F(x),G(x)]
trying a symmetry pattern of the form [F(y),G(y)]
trying a symmetry pattern of the form [F(x)+G(y), 0]
trying a symmetry pattern of the form [0, F(x)+G(y)]
>
A portion of the slope field for this ODE is created with the DEplot command from the DEtools package:
> DEplot( ode1, [y(t)], t=-4..4, y=-4..4, arrows=LINE );
>
Solution curves can be added to a slope field with the inclusion of a list of initial conditions. The initial conditions can appear either as ordered pairs or as equations.
> IC1 := [ [ 0, i ] $ i=-4..4, [ y(i)=0 ] $ i=-4..4 ];
>
> DEplot( ode1, [y(t)], t=-4..4, y=-4..4, IC1, arrows=LINE );
>
Notice that the solution curves illustrate several curves with the same asymptotic behavior, but do not cross. Also note that the trajectories are drawn for -4 <
< 4, that is both forward and backward in time.
>
When the differential equation has the form
the slope field has the special property that the slopes are independent of
.
For example,
> ode2 := diff( y(t), t ) = t^2 - 2*t*sin(t);
>
> DEplot( ode2, [y(t)], t=-3..4, y=-3..3, arrows=LINE );
>
When solution trajectories are added to the slope field,
> IC2 := [ [ 0, i ] $ i=-3..3 ]:
> DEplot( ode2, [y(t)], t=-3..4, y=-3..3, IC2, arrows=LINE );
>
it is readily appparent that all solutions are vertical translations of the solution through the origin.
The following animation emphasizes this point,
>
> IC2a := [ [0,0] ]:
> IC2b := [ [ 0, i/3 ] ] $ i=-9..9:
> p0 := DEplot( ode2, [y(t)], t=-3..4, y=-3..3, IC2a,
> arrows=LINE, linecolor=BLUE ):
> p1 := seq( display( p0,
> DEplot( ode2, [y(t)], t=-3..4, y=-3..3, ic,
> arrows=LINE, linecolor=GREEN ) ),
> ic=IC2b ):
> display( p1, insequence=true );
>
This geometric observation is a direct consequence of the fact the general solution of a first-order ODE of this type can be solved by direct integration. In general, the solution is
where the presence of the integration constant explains the vertical translation of solution trajectories.
> dsolve( ode2, y(t) );
>
A second special case is the autonomous first-order ODE
.
Autonomous ODEs are always separable. However, finding an analytic expression for the solution can still be quite difficult. Consider
> ode3 := diff( y(t), t ) = y(t)^2 - 2*y(t)*sin(y(t));
>
> DEplot( ode3, [y(t)], t=-3..3, y=-3..3, arrows=LINE );
>
Here, all slopes along a horizontal line are the same. A sample of the solution trajectories following this slope field is
> IC3 := [ [ 0 , i/2 ] $ i=-6..6 ]:
> DEplot( ode3, [y(t)], t=-3..3, y=-3..3, IC3, arrows=LINE, stepsize=0.2 );
>
Without the stepsize= optional argument, the approximate solutions computed by Maple cross. We know this cannot happen! Forcing Maple to use a smaller stepsize in the computations produces approximate solutions that do not cross.
A noteworthy geometric property of solutions to autonomous differential equations is that a horizontal translation of a solution trajectory is another solution trajectory. This is illustrated in the following animation.
> p0 := DEplot( ode3, [y(t)], t=-3..3, y=-3..3, IC3, arrows=LINE, linecolor=BLUE, stepsize=0.2 ):
> p_list := NULL:
> for t0 in [ i/2 $ i=-6..6 ] do
> ic := [ [ t0, i/2 ] $ i=-6..6 ];
> p1 := DEplot( ode3, [y(t)], t=-3..3, y=-3..3, ic,
> arrows=LINE, stepsize=0.2, linecolor=GREEN ):
> p_list := p_list, display( [p0,p1] ):
> end do:
> display( p_list, insequence=true );
>
Note that while this ODE is separable, Maple is unable to obtain an analytic expression for the solution.
> infolevel[dsolve] := 3:
> dsolve( ode3, y(t) );
> infolevel[dsolve] := 0:
Methods for first order ODEs:
Trying to isolate the derivative dy/dt...
Successful isolation of dy/dt
-> Trying classification methods
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
separable successful
>
[Back to ODE Powertool Table of Contents]
>