#13

The problem involves the following information

> MODEL := diff( y(t) , t ) = 2 - y(t) ; # define the differential equation model

[Maple Math]

> IC := y(0) = 1; # specify the initial condition

[Maple Math]

> DOMAIN:= t = 0 .. 4 ;

[Maple Math]

> ptsEa := Euler( MODEL, IC, DOMAIN, 4 ); # with N = 4, we have dt=1.0

[Maple Math]

> ptsEb := Euler( MODEL, IC, DOMAIN, 8 ); # with N = 8, we have dt=0.5

[Maple Math]

> ptsEc := Euler( MODEL, IC, DOMAIN, 16 ); # with N =16, we have dt=0.25

[Maple Math]
[Maple Math]

> plotE3 := plot( [ptsEa,ptsEb,ptsEc], color = [GREEN,CYAN,BLUE], thickness = 2 ):

> plotE3;

>

> VAR := { y(t) }; # specify the variables in the model

[Maple Math]

> RANGE := y = 0 .. 2 ; # specify a reasonable interval for the dependent variable

[Maple Math]

> plotSLOPE := DEplot( MODEL, VAR, DOMAIN, RANGE, [[0,1]], arrows = NONE, linecolor=RED ):

> display( [ plotSLOPE, plotE3 ] );

>