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); |
|
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); |
|