Logistic Equation Phase Plot
Dr. Kevin G. TeBeest
Kettering University
01/08/02
First load the library DEtools for working with differential equations.
> with( DEtools ) :
The following line defines the logistic differential equation.
Here we have set
and
.
> de := diff( x(t), t ) = x(t) * ( 1 - x(t) ) ;
The following 2 lines define points through which specific solution curves will be drawn. It also sets their line colors.
> cols := [black, black, green, blue, blue, green, green, green, green, blue] :
> ICs := [ [x(0)=1], [x(0)=0], [x(0)=2], [x(0)=1/10], [x(0)=1/2], [x(1)=1.8], [x(2)=2], [x(3)=2], [x(4)=1.8], [x(2)=1/10] ] :
The following line sets the plot's title, the title's font, and the axes labels' fonts.
> Title := "Logistic Equation Phase Portrait": tfnt := [HELVETICA,BOLD,12]: lfnt := [TIMES,ITALIC,18] :
The following line creates the phase portrait in the tx plane. Note that the t range and x range are set.
>
phaseportrait( de, x(t), t = 0.0 .. 6.0, ICs, x = 0.0 .. 2.0,
linecolor = cols, title = Title, dirgrid = [10,10],
xtickmarks = 3, titlefont = tfnt,
labelfont = lfnt, arrows = SLIM, scene = [t,x], axesfont = [ HELVETICA, 12 ] ) ;