unit12.mws

ORDINARY DIFFERENTIAL EQUATIONS POWERTOOL

Unit 12 -- Slope Fields

Prof. Douglas B. Meade

Industrial Mathematics Institute

Department of Mathematics

University of South Carolina

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

>

12.A Slope Fields

A slope field displays information about rates of change for ordinary differential equations. For a first-order ODE

Diff(y,t) = f(t,y) ,

the slope field shows the slope of the function y for all values of t and y . That is, at the point ( t , y ) in the domain of f, the "minitangent" with slope f(t,y) 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).

12.A-1 Example 1

Consider the differential equation

> ode1 := diff( y(t), t ) = 2*abs(y(t)) - t;

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 way` = 3

_________________________________________

`trying way` = 4

_________________________________________

`trying way` = 5

_________________________________________

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 );

[Maple Plot]

>

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 ];

IC1 := [[0, -4], [0, -3], [0, -2], [0, -1], [0, 0],...
IC1 := [[0, -4], [0, -3], [0, -2], [0, -1], [0, 0],...

>

> DEplot( ode1, [y(t)], t=-4..4, y=-4..4, IC1, arrows=LINE );

[Maple Plot]

>

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 < t < 4, that is both forward and backward in time.

>

12.A-2 Example 2

When the differential equation has the form

Diff(y,t) = f(t)

the slope field has the special property that the slopes are independent of y .

For example,

> ode2 := diff( y(t), t ) = t^2 - 2*t*sin(t);

ode2 := diff(y(t),t) = t^2-2*t*sin(t)

>

> DEplot( ode2, [y(t)], t=-3..4, y=-3..3, arrows=LINE );

[Maple Plot]

>

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 );

[Maple Plot]

>

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 );

[Maple Plot]

>

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

y(t) = Int(f(t),t)+C

where the presence of the integration constant explains the vertical translation of solution trajectories.

> dsolve( ode2, y(t) );

y(t) = 1/3*t^3-2*sin(t)+2*t*cos(t)+_C1

>

12.A-3 Example 3

A second special case is the autonomous first-order ODE

Diff(y,t) = f(y) .

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));

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 );

[Maple Plot]

>

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 );

[Maple Plot]

>

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 );

[Maple Plot]

>

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

t-Int(-1/(_a*(-_a+2*sin(_a))),_a = `` .. y(t))+_C1 ...

>

[Back to ODE Powertool Table of Contents]

>