DEplots with first order systems or single higher order equations
by Tom Linton, http://www.cs.moravian.edu/~linton
> with(DEtools):
A plot similar to Figure 1.5.3 on page 41 of our text, where we show the height (in meters) of a whiffle ball subject to air resistence, using k/m = 3, and initial velocities 5 and 15 meters per second, as a system:
> DEplot([diff(y(t),t)=v(t), diff(v(t),t)=-9.8-3*v(t)],
[y(t),v(t)],t=0..2.5,y=0..5,[[y(0)=0,v(0)=15],[y(0)=0,v(0)=5]],
method=rkf45,stepsize=.05,scene=[t,y],linecolor=black);
![[Maple Plot]](images/systems1.gif)
Same thing, but as a second order single differential equation. Note the peculiar way we give the initial condition y'(0) = 15 etc.
> DEplot([diff(y(t),t,t)=-9.8-3*diff(y(t),t)],
[y(t)],t=0..2.5,y=0..5,[[y(0)=0,D(y)(0)=15],[y(0)=0,D(y)(0)=5]],
method=rkf45,stepsize=.05,linecolor=black);
![[Maple Plot]](images/systems2.gif)
A plot similar to Figure 1.5.4, with k/m = 10, and using the sequence command to quickly generate many initial conditions.
> DEplot([diff(y(t),t)=v(t), diff(v(t),t)=-9.8-10*v(t)],
[y(t),v(t)],t=0..2.5,y=0..2,
[seq([y(0)=0,v(0)=5*k],k=1..4)],
method=rkf45,stepsize=.05,scene=[t,y],linecolor=aquamarine);
![[Maple Plot]](images/systems3.gif)