Graphic Studies of Differential Equations

Maple has a number of methods for visualizing the solutions of differential equations.

> with(DEtools):

The DEplot routine shows the vector field along with some trajectories of the Lotka-Volterra model. This is a phaseportrait of this predator-prey model.

> dfieldplot([LVx, LVy], [x(t),y(t)], t=-2..2, x=-1..2, y=-1..2, arrows=MEDIUM, title=`Lotka-Volterra model`,
color=[.3*y(t)*(x(t)-1),x(t)*(1-y(t)),.1]);

[Maple Plot]

> DEplot([LVx, LVy], [x(t),y(t)], t=0..15, [[x(0)=1.2,y(0)=1.2],[x(0)=1,y(0)=.7]], stepsize=.2,
title=`Lotka-Volterra model`, color = [.3*y(t)*(x(t)-1),x(t)*(1-y(t)),.1],
linecolor=t/2, arrows=MEDIUM, method=rkf45);

[Maple Plot]

Maple has a phaseportrait command. Below we show a 2-D projection of a 3-D plot from the system of equations solved above, using 2 initial conditions.

> phaseportrait([diff(x(t),t) = 2*x(t) - y(t) - 2*z(t), diff(y(t),t) = x(t) + 2*y(t), diff(z(t),t) = 2*x(t) - z(t)], [x(t),y(t),z(t)], t=0..5, [[x(0)=0.1,y(0)=0,z(0)=0], [x(0)=-0.1,y(0)=0,z(0)=0]], stepsize=.05, scene=[x(t),y(t)], linecolour=sin(t*Pi/2));

[Maple Plot]

Maple also produces 3-D plots of differential equations. Below we show the command that produces the graph show on the opening page of this website.

> oscx := D(x)(t)=y(t);
oscy := D(y)(t)=-x(t)-0.4*y(t);

oscx := D(x)(t) = y(t)

oscy := D(y)(t) = -x(t)-.4*y(t)

> DEplot3d({oscx, oscy}, [x(t),y(t)], t=0..10, [[x(0)=0,y(0)=1], [x(0)=0,y(0)=.5], [x(0)=0,y(0)=-1], [x(0)=0,y(0)=-.5], [x(0)=1,y(0)=0], [x(0)=0.5,y(0)=0], [x(0)=-1,y(0)=0], [x(0)=-0.5,y(0)=0]], scene=[t,x(t),y(t)], stepsize=.1, title=`Damped Oscillations`, linecolour = t-sqrt(t), axes=NORMAL);

[Maple Plot]

>