Chap1.mw
Maple Text Commands for Chapter 1 -
DIFFERENTIAL EQUATIONS
| > |
restart:with(DEtools):with(plots): |
Example 1: Solve the differential equation
| > |
deqn1:=diff(y(x),x)=-x/y(x):
dsolve(deqn1,y(x)); |
 |
(1) |
Figure 1.1: Plot solution curves for Example 1.
| > |
implicitplot({C1=1,C1=4,C1=9},x=-4..4,y=-4..4,numpoints=1000,color=blue,scaling=CONSTRAINED,font=[TIMES,ROMAN,15],labels=[`t`,`x`]); |
Example 3: The logistic equation modelling population growth.
| > |
Logistic:=diff(P(t),t)=P(t)*(b-d*P(t)):
dsolve(Logistic,P(t)); |
 |
(2) |
Example 8: The chemical reaction between nitrous oxide and oxygen to form nitrogen dioxide. Initial value problem
| > |
k:=0.00713:a0:=4:b0:=1:
deqn2:=diff(c(t),t)=k*(a0-(c(t))^2)*(b0-c(t)/2); |
 |
(3) |
Figure 1.6: Plot a solution curve.
| > |
DEplot(deqn2,c(t),t=0..1000,[[c(0)=0]],c=0..2.2,thickness=2,linecolor=blue); |
Example 10: Solve the differential equation
| > |
ode:=diff(i(t),t,t)+5*diff(i(t),t)+6*i(t)=10*sin(t):
dsolve({ode,i(0)=0,D(i)(0)=0}); |
 |
(4) |
Exercise 7: Solve the system
| > |
sys1:=diff(x(t),t)=-a*x(t),diff(y(t),t)=a*x(t)-b*y(t),diff(z(t),t)=b*y(t); |
 |
(5) |
| > |
dsolve([sys1,x(0)=M,y(0)=0,z(0)=0]); |

 |
(6) |
Example: Plot a solution curve for
| > |
sys1:=diff(x(t),t)=z(t)-x(t),diff(y(t),t)=-y(t),diff(z(t),t)=z(t)-17*x(t)+16:
DEplot3d({sys1},{x(t),y(t),z(t)},t=0..10,[[x(0)=0.8,y(0)=0.8,z(0)=0.8]],scene=[x(t),y(t),z(t)],stepsize=0.05,linecolor=blue,thickness=1); |
Example: A time series plot.
| > |
DEplot({sys1},{x(t),y(t),z(t)},t=0..10,[[x(0)=0.8,y(0)=0.8,z(0)=0.8]],scene=[t,x(t)],stepsize=0.05,linecolor=blue,thickness=1); |
Example 7: Solve the initial value problem
| > |
LDE:=diff(x(t),t)+t*x(t)=t^3; |
 |
(7) |
| > |
dsolve({LDE,x(0)=1},x(t)); |
 |
(8) |
| > |
seriessolLDE:=dsolve({LDE,x(0)=1},x(t),series); |
 |
(9) |
Example 8: Solve the van der Pol differential equation
using numerical methods and a series solution. Compare the results near to the initial conditions.
| > |
restart:with(DEtools):with(plots):
vanderPol:=diff(x(t),t,t)+2*(x(t)^2-1)*diff(x(t),t)+x(t)=0;
numsol:=dsolve({vanderPol,x(0)=5,D(x)(0)=0},numeric,range=0..0.08):
p1:=odeplot(numsol):
seriessol:=dsolve({vanderPol,x(0)=5,D(x)(0)=0},x(t),series);
approxpoly:=convert(rhs(seriessol),polynom);
p2:=plot({approxpoly},t=0..0.08,colour=blue):
display({p1,p2},font=[TIMES,ROMAN,15],title=["Numerical and Series Solutions"]); |
End of Chapter 1 Commands