The Differential Equations Take Home Quiz
by Bob Bradshaw
Plot the differential equation on a plot with t on the x-axis and position and velocity on the y-axis. Then make a phase plane of the answer.
with(plots):
with(DEtools):
eqn1:=diff(x(t),t) = y(t);
eqn2:=diff(y(t),t) = -1/1*x(t)-0/1*y(t);
ic:=[[x(0)=0,y(0)=4]];
vars:=[x(t),y(t)]:
p:=dsolve({eqn1,eqn2,x(0)=0,y(0)=4},vars,type=numeric):
y1plot:=odeplot(p,[[t,x(t)]],0..10,numpoints=100,color=red,labels=["Time","Position"],title="Position as a Function of Time"):
display(y1plot);
y2plot:=odeplot(p,[[t,y(t)]],0..10,numpoints=100,color=blue,labels=["Time","Velocity"],title="Velocity as a Function of Time"):
display(y2plot);
Here is the phase plane diagram of the systems of differential equations:
eqn1:=diff(x(t),t) = y(t);
eqn2:=diff(y(t),t) = -1/1*x(t)-0/1*y(t);
ic:=[[x(0)=0,y(0)=4]];
vars:=[x(t),y(t)]:
DEplot({eqn1,eqn2},vars,t=0..24,ic,linecolor=[black],title="Undampened Pendulun Phase Plane",stepsize=0.01,scaling=constrained);
Home
Hosted by www.Geocities.ws

1