Maple Tool2.mws

Maple Tool 2

This worksheet is designed for use with Activity 2 in Section 5.2.

>    with(plots):

>    g:=32.2;
K:=52.6;

g := 32.2

K := 52.6

Enter the symbolic solution and graph this solution. (Use K  for the constant in the differential equation. The symbol k  already is being used for the iteration step counter.)

>    V:=t->(g/K)*(1-exp(-K*t));
Vplot:=plot(V(t),t=0..0.2, color=green,thickness=2):%;

V := proc (t) options operator, arrow; g/K*(1-exp(-K*t)) end proc

[Maple Plot]

The following steps carry out the iteration and compare the numerical and symbolic solutions.

>    n:=80;
Delta:=0.2/n;
t:=k->k*Delta;
v := proc(k)

>         v(k) := v(k-1)+(g-K*v(k-1))*Delta;

>    end:                                                  

>    v(0):= 0:
solution:=[seq([t(k),v(k)],k=0..n)]:

>   
solPlot := plot(solution, t=0..0.2, v=0..1, style=POINT,symbol=circle, color=blue, thickness=2):
display(Vplot, solPlot);

n := 80

Delta := .2500000000e-2

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

[Maple Plot]

>   

>