>    #Lab 5

>    with(plots):

Warning, the name changecoords has been redefined

>    L:=15:tail:={y1(t),y2(t)},numeric,initstep=0.1,range=0..L;

tail := {y1(t), y2(t)}, numeric, initstep = .1, range = 0 .. 15

>    alpha:=0.5;
SYS:=diff(y1(t),t)=-y1(t)*(y1(t)^2-alpha)-y2(t),diff(y2(t),t)=y1(t); A1a:=dsolve([SYS, y1(0)=2,y2(0)=2],tail):
A1b:=dsolve([SYS, y1(0)=-2,y2(0)=2],tail):
A1c:=dsolve([SYS, y1(0)=0.3,y2(0)=0],tail): P1a:=odeplot(A1a,[y1(t),y2(t)],t=0..L,color=red,numpoints=1000): P1b:=odeplot(A1b,[y1(t),y2(t)],t=0..L,color=blue,numpoints=1000): P1c:=odeplot(A1c,[y1(t),y2(t)],t=0..L,color=black,numpoints=1000):
display(P1a,P1b,P1c,title=cat("alpha = ",convert(alpha,string)));

alpha := .5

SYS := diff(y1(t),t) = -y1(t)*(y1(t)^2-.5)-y2(t), diff(y2(t),t) = y1(t)

[Maple Plot]

>    alpha:=1.0;
SYS:=diff(y1(t),t)=-y1(t)*(y1(t)^2-alpha)-y2(t),diff(y2(t),t)=y1(t); A2a:=dsolve([SYS, y1(0)=2,y2(0)=2],tail):
A2b:=dsolve([SYS, y1(0)=-2,y2(0)=2],tail):
A2c:=dsolve([SYS, y1(0)=0.3,y2(0)=0],tail): P1a:=odeplot(A2a,[y1(t),y2(t)],t=0..L,color=red,numpoints=1000): P1b:=odeplot(A2b,[y1(t),y2(t)],t=0..L,color=blue,numpoints=1000): P1c:=odeplot(A2c,[y1(t),y2(t)],t=0..L,color=black,numpoints=1000):
display(P1a,P1b,P1c,title=cat("alpha = ",convert(alpha,string)));

alpha := 1.0

SYS := diff(y1(t),t) = -y1(t)*(y1(t)^2-1.0)-y2(t), diff(y2(t),t) = y1(t)

[Maple Plot]

>    alpha:=1.5;
SYS:=diff(y1(t),t)=-y1(t)*(y1(t)^2-alpha)-y2(t),diff(y2(t),t)=y1(t); A3a:=dsolve([SYS, y1(0)=2,y2(0)=2],tail):
A3b:=dsolve([SYS, y1(0)=-2,y2(0)=2],tail):
A3c:=dsolve([SYS, y1(0)=0.3,y2(0)=0],tail): P1a:=odeplot(A3a,[y1(t),y2(t)],t=0..L,color=red,numpoints=1000): P1b:=odeplot(A3b,[y1(t),y2(t)],t=0..L,color=blue,numpoints=1000): P1c:=odeplot(A3c,[y1(t),y2(t)],t=0..L,color=black,numpoints=1000):
display(P1a,P1b,P1c,title=cat("alpha = ",convert(alpha,string)));

alpha := 1.5

SYS := diff(y1(t),t) = -y1(t)*(y1(t)^2-1.5)-y2(t), diff(y2(t),t) = y1(t)

[Maple Plot]

>    alpha:=2.0;
SYS:=diff(y1(t),t)=-y1(t)*(y1(t)^2-alpha)-y2(t),diff(y2(t),t)=y1(t); A4a:=dsolve([SYS, y1(0)=2,y2(0)=2],tail):
A4b:=dsolve([SYS, y1(0)=-2,y2(0)=2],tail):
A4c:=dsolve([SYS, y1(0)=0.3,y2(0)=0],tail): P1a:=odeplot(A4a,[y1(t),y2(t)],t=0..L,color=red,numpoints=1000): P1b:=odeplot(A4b,[y1(t),y2(t)],t=0..L,color=blue,numpoints=1000): P1c:=odeplot(A4c,[y1(t),y2(t)],t=0..L,color=black,numpoints=1000):
display(P1a,P1b,P1c,title=cat("alpha = ",convert(alpha,string)));

alpha := 2.0

SYS := diff(y1(t),t) = -y1(t)*(y1(t)^2-2.0)-y2(t), diff(y2(t),t) = y1(t)

[Maple Plot]

>    alpha:=2.5;
SYS:=diff(y1(t),t)=-y1(t)*(y1(t)^2-alpha)-y2(t),diff(y2(t),t)=y1(t); A5a:=dsolve([SYS, y1(0)=2,y2(0)=2],tail):
A5b:=dsolve([SYS, y1(0)=-2,y2(0)=2],tail):
A5c:=dsolve([SYS, y1(0)=0.3,y2(0)=0],tail): P1a:=odeplot(A5a,[y1(t),y2(t)],t=0..L,color=red,numpoints=1000): P1b:=odeplot(A5b,[y1(t),y2(t)],t=0..L,color=blue,numpoints=1000): P1c:=odeplot(A5c,[y1(t),y2(t)],t=0..L,color=black,numpoints=1000):
display(P1a,P1b,P1c,title=cat("alpha = ",convert(alpha,string)));

alpha := 2.5

SYS := diff(y1(t),t) = -y1(t)*(y1(t)^2-2.5)-y2(t), diff(y2(t),t) = y1(t)

[Maple Plot]

>    display(odeplot(A1b,[y1(t),y2(t)],t=L/3..L,color=red,numpoints=1000), odeplot(A2b,[y1(t),y2(t)],t=L/3..L,color=blue,numpoints=1000), odeplot(A3b,[y1(t),y2(t)],t=L/3..L,color=green,numpoints=1000), odeplot(A4b,[y1(t),y2(t)],t=L/3..L,color=brown,numpoints=1000), odeplot(A5b,[y1(t),y2(t)],t=L/3..L,color=red,numpoints=1000),
title="limit cycles for alpha = 0.5, 1.0, 1.5, 2.0 and 2.5");

[Maple Plot]

>    ODE:=diff(y(t),t,t)-9*y(t)=0;

ODE := diff(y(t),`$`(t,2))-9*y(t) = 0

>    IC:=y(0)=1,D(y)(0)=-3;

IC := y(0) = 1, D(y)(0) = -3

>    dsolve({ODE,IC},y(t));

y(t) = exp(-3*t)

>    P2:=dsolve({ODE,IC},numeric,y(t),initstep=0.1);

P2 := proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _E...

>    L:=14:display(plot(exp(-3*t),t=0..L,color=blue),odeplot(P2,t=0..L));

[Maple Plot]

>    P2(14);

[t = 14., y(t) = 1.09954523805531434, diff(y(t),t) = 3.29863571416594326]

>    for i from 0 to 50 by 1 do P2(i); od;

>    SYS:=diff(y1(t),t)=y2(t),diff(y2(t),t)=9*y1(t),y1(0)=1,y2(0)=-3;

SYS := diff(y1(t),t) = y2(t), diff(y2(t),t) = 9*y1(t), y1(0) = 1, y2(0) = -3

>    Run:=dsolve([SYS],numeric,range=0..13);

Run := proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _...

>    display(fieldplot([y,9*x],x=-1..1,y=-3..3,arrows=thick),odeplot(Run,[y1(t),y2(t)],t=0..12.5,thickness=3));

[Maple Plot]

>    for i from 5 to 13 do Run(i); od;

[t = 5., y1(t) = .302010984513135324e-6, y2(t) = -.905745475480339750e-6]

[t = 6., y1(t) = .132425881140762872e-7, y2(t) = -.340367965563659914e-7]

[t = 7., y1(t) = .179853130600483452e-7, y2(t) = .565135249745789827e-7]

[t = 8., y1(t) = .298296769704767303e-6, y2(t) = .890331870211288729e-6]

[t = 9., y1(t) = .630638300687563795e-5, y2(t) = .189189097312783978e-4]

[t = 10., y1(t) = .126312352351539554e-3, y2(t) = .378937045393153031e-3]

[t = 11., y1(t) = .253665842314809492e-2, y2(t) = .760997526886394472e-2]

[t = 12., y1(t) = .509498680351047756e-1, y2(t) = .152849604105285419]

[t = 13., y1(t) = 1.02335438829690450, y2(t) = 3.07006316489071240]

>    SYS2:=diff(y1(t),t)=y2(t),diff(y2(t),t)=y1(t),y1(0)=1,y2(0)=-1;

SYS2 := diff(y1(t),t) = y2(t), diff(y2(t),t) = y1(t), y1(0) = 1, y2(0) = -1

>    Run2:=dsolve([SYS],numeric);

Run2 := proc (x_rkf45) local res, data, vars, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if ...

>    Run2(126.0);

[t = 126.0, y1(t) = -.289045395362462274e-7, y2(t) = .289045395362462274e-7]

>