Maple Tool3.mws

Maple Tool 3

This tool is designed to be used with Exercise 19 in Section 5.3.

Enter your formula for the derivative, yprime.  Your formula should involve both x and y.

>    yprime:=(x,y)->(cos(x)*cos(y))/(1+sin(x)*sin(y));

yprime := proc (x, y) options operator, arrow; cos(x)*cos(y)/(1+sin(x)*sin(y)) end proc

The following steps carry out the iteration and plot the numerical solution.

>    n:=100;
Delta:=1/n;
x:=k->k*Delta;
Y := proc(k)

>         Y(k) := evalf(Y(k-1)+yprime(x(k-1),Y(k-1))*Delta);

>    end:                                                  

>    Y(0):= 0:
solution:=[seq([x(k),Y(k)],k=0..n)]:

>    solPlot := plot(solution, x=0..1, y=0..1, style=POINT,symbol=circle, color=blue, thickness=2):%;

n := 100

Delta := 1/100

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

[Maple Plot]

>   

Compare the left and right sides of the defining equation at x = 1:

>    sin(1.0)*cos(Y(n)); Y(n);

.6616187278

.6660564435

>