restart;p(z(t))=P(t):pprime:=solve(diff(%,t),D(p)(z(t))); p2prime:=solve(diff(%%,t,t),D(D(p))(z(t)));D(p)(z(t)):=pprime;p2prime;ode:=z(t)^2*p2prime+z(t)*pprime+(a*z(t)^2+b*z(t)+c)*P(t);z(t):=r*exp(I*t):save ode, z, `ode.sav`;P(t):=U(t)+I*V(t):re:=combine(evalc(Re(ode)),trig);im:=combine(evalc(Im(ode)),trig);re:=collect(collect(re,U(t)),V(t))=0:
im:=collect(collect(im,U(t)),V(t))=0:odes:= re,im;init:=V(0)=0,U(0)=-.563,D(V)(0)=.869,D(U)(0)=0: a:=1: b:=0.5: c:=-0.444444443: r:=1:
F1:=dsolve({odes, init}, {U(t),V(t)},numeric);numpts:= 200: Tend:= 6*Pi:
L1:= [seq(subs(F1(j*Tend/numpts),[U(t),V(t)]),j=0..numpts)]:plot(L1);init:=V(0)=0,U(0)=-.944,D(V)(0)=.658,D(U)(0)=0:
r:=0.6:
F2:=dsolve({odes, init}, {U(t),V(t)},numeric):
L2:=[seq(subs(F2(j*Tend/numpts),[U(t),V(t)]),j=0..numpts)]: plot({L1,L2},labels=[Re,Im],linestyle=[0,3],color=black,
font=[HELVETICA,12]);# Matlab Solutionrestart;
read `ode.sav`:
ode = 0;