Maple Tool2.mws

Section 6.2

Maple Tool 2

This Maple file is designed to be used with Activity 3 in Section 6.2.

>    with(plots):with(DEtools):

Warning, the name changecoords has been redefined

We begin by displaying the slope field for the differential equation

diff(P(t),t) = K*P*(M-P(t))

with the values of K  and M  given below.

>    K:=0.00009;
M:=1000;

>    Slope:=DEplot(diff(P(t),t)=K*P(t)*(M-P(t)),P(t),
t=0..100,P=0..1200,stepsize=1, thickness=2, linecolor=black):%;

K := .9e-4

M := 1000

[Maple Plot]

Next we set up the Euler's Method approximation and plot this om the slope field. Enter your value of P(0)  in this calculation. (Note that this is the same calculation as was used in Maple Tool 1 in this section.)

>    n:=40;
Delta:=120/n;
t:=k->k*Delta;
P := proc(k)

>         P(k) := P(k-1)+K*P(k-1)*(M-P(k-1))*Delta;

>    end:

>    P(0):=111;
solution:=[seq([t(k),P(k)],k=0..n)]:
Euler:=plot(solution, t=0..120, P=0..1000, style=point,symbol=circle, color=blue, thickness=2, xtickmarks=[20,40,60,80,100], ytickmarks=[200,400,600,800,1000]):

>    display(Euler,Slope);

n := 40

Delta := 3

t := proc (k) options operator, arrow; k*Delta end proc

P(0) := 111

[Maple Plot]

>   

>