visualizing differential equations

11
PEI DU

Upload: pd3h

Post on 12-Jul-2015

465 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Visualizing Differential Equations

PEI DU

Page 2: Visualizing Differential Equations

The Gompertz equation has been used to model self-limited population growth.

It is characterized by the differential equation dy/dt=r*y*ln(K/y) along with the initial condition y(0)=y0.

Since it is widely used in science and is a typical example for ordinary differential equations, I want to use these slides to show how to draw its graphs using Maple.

Page 3: Visualizing Differential Equations
Page 4: Visualizing Differential Equations

graph Maple codes

t1 2 3 4 5 6

y(t)

2.4

2.5

2.6

2.7

2.8

2.9

3.0

Asymptotic solution

with(DEtools): Phaseportrait(D(y)

(t))=2*y(t)*ln(3/y(t)), y(t), t=1..6,[[y(0)=0.5],[y(0)=1],[y(0)=1.5]],title=‘Asymptotic solution’, colour=magenta,linecolor=[gold, yellow, wheat]);

Page 5: Visualizing Differential Equations

Maple codes: > with DEtools: > y: =‘y’: > eqn:

diff(y(t),t)=2y(t)ln(3/y(t));

> dfieldplot(eqn, y(t),t=1..6,y=-1..4)

Page 6: Visualizing Differential Equations
Page 7: Visualizing Differential Equations

with(plots): p1:=dsolve({D(y)(t)=2*y(t)*ln(3/y(t)),y(0)=1},y(t),

type=numeric): p2:=dsolve({D(y)(t)=3*y(t)*ln(3/y(t)),y(0)=1},y(t),

type=numeric): p3:=dsolve({D(y)(t)=4*y(t)*ln(3/y(t)),y(0)=1},y(t),

type=numeric): p4:=dsolve({D(y)(t)=5*y(t)*ln(3/y(t)),y(0)=1},y(t),

type=numeric): p5:=dsolve({D(y)(t)=6*y(t)*ln(3/y(t)),y(0)=1},y(t),

type=numeric):

Page 8: Visualizing Differential Equations

a1:= odeplot(p1,[t, y(t)],-1..3, color=blue): a2:= odeplot(p2,[t, y(t)],-.8..3, color=green): a3:= odeplot(p3,[t, y(t)],-.6..3, color=yellow): a4:= odeplot(p4,[t, y(t)],-.4..3, color=orange): a5:= odeplot(p5,[t, y(t)],-.4..3, color=red): Display(a1,a2,a3,a4,a5);

Page 9: Visualizing Differential Equations

graph on Maple

Maple codes

With(plots): eqn: =D(y)(t)=C*y(t)*ln(3/

y(t)): toplot={seq(subs(C=i,

eqn), i=2..6)}; plot(toplot,

t=-5..5,-5..5);

Page 10: Visualizing Differential Equations

The graphing codes showed above can be extended to many other ordinary differential equations.

Maple has many handy graphing functions. It can be used to simple functions, direction fields, asymptotes, and families of functions. Maple also has functions to create animated functions.

Page 11: Visualizing Differential Equations

Special thanks to my tutor Kathy. : )