Maple Worksheet for Vertical Air Drag, for Physics 160

This worksheet describes the trajectories of a particle subject to gravity and also an air drag proportional to the square of the velocity, and in the contrary direction.

The calculations below will use the input constants, g, b, v0, which should have their numerical values entered later on in the calculations, after the formulae have already been created:

> alias(v=v(t));

v

> difeq:=diff(v,t)+g+b*v*abs(v);

difeq := diff(v,t)+g+b*v*abs(v)

> dsolve(difeq,v);

t-PIECEWISE([-1/(g*b)^(1/2)*arctanh(b*v/(g*b)^(1/2)...

> alpha:=sqrt(g*b);

alpha := sqrt(g*b)

Recast this tells me that v may be rewritten as follows, where it is more convenient to refer to it with a new symbol. Therefore, I call it ww=ww(t), and use v0 to replace the role of the constant of integration, _C1, so that delta will be defined in terms of v0=(alpha/b)*tan(alpha*delta), where alpha is used to denote the sqrt(g*b).

> ww:=t->if t<0 then I else if t<=delta then (alpha/b)*tan(alpha*(delta-t)) else (alpha/b)*tanh(alpha*(delta-t)) fi fi;

ww := proc (t) options operator, arrow; if t < 0 th...
ww := proc (t) options operator, arrow; if t < 0 th...
ww := proc (t) options operator, arrow; if t < 0 th...
ww := proc (t) options operator, arrow; if t < 0 th...
ww := proc (t) options operator, arrow; if t < 0 th...
ww := proc (t) options operator, arrow; if t < 0 th...

> ;

> delta:=(1/alpha)*arctan(b*v0/alpha);

delta := 1/(g*b)^(1/2)*arctan(b*v0/(g*b)^(1/2))

I then also want the displacement, where I start so that x begins at x0 = 0.

> xx:=t->if t<=delta then -(1/b)*ln((cos(alpha*delta)/cos(alpha*(delta-t)))) else -(1/b)*ln((cos(alpha*delta)*cosh(alpha*(t-delta)))) fi;

xx := proc (t) options operator, arrow; if t <= del...
xx := proc (t) options operator, arrow; if t <= del...
xx := proc (t) options operator, arrow; if t <= del...
xx := proc (t) options operator, arrow; if t <= del...
xx := proc (t) options operator, arrow; if t <= del...
xx := proc (t) options operator, arrow; if t <= del...

We also set out the no-drag options, i.e., the situation where there is only gravity acting:

> wno:=t->v0-g*t; xno:=t->v0*t-(g/2)*t^2;

wno := proc (t) options operator, arrow; v0-g*t end...

xno := proc (t) options operator, arrow; v0*t-1/2*g...

Finally we can input the desired numerical values for the parameters:

> g:=9.8; b:=1/40;v0:=20;

g := 9.8

b := 1/40

v0 := 20

> plot([ww,wno],0..6,title=`velocity versus time`,labels=[t,vel]);

[Maple Plot]

> plot([xx,xno],0..5,title=`height versus time`,labels=[t,h]);

[Maple Plot]