# NAME    :- IBRAR AHMAD 
TUTORIAL:- GROUP 5TH  
ROLL NO :- 11232225        
DATE    :- 19-3-2013          

# Velocity-Acceleration Model

/* Acceleration velocity model without air resistance */
kill(all)$
eqn:'diff(v,t)=-g;
'v0=v0:49;
solx:ode2(eqn,v,t);
ic1(%,t=0,v=v0);
sol:ev(%,g=9.8);
tymax:solve(rhs(sol)=0)[1];/*tymax-time when y is max */
eqn1:'diff(s,t)=rhs(sol);
ode2(%,s,t);
sol1:ic1(%,t=0,s=0);
wxplot2d([rhs(sol)],[t,0,10],[ylabel,"Velocity"]);
'maxheight=rhs(float(ev(sol1,tymax)));
wxplot2d([rhs(sol1)],[t,0,10],[ylabel,"Height"]);

/* Acceleration velocity model without air resistance */
kill(all)$
eqn:'diff(v,t)=-g-ro*v;
ode2(eqn,v,t);
ic1(%,t=0,v=v0);
sol:ev(%,v0=49,g=9.8,ro=0.04);
eqn1:'diff(y,t)=rhs(sol);
ode2(%,y,t);
soly:ic1(%,t=0,y=0);
wxplot2d([rhs(sol)],[t,0,10],[ylabel,"Velocity"]);
tymax:float(solve(rhs(sol)=0))[1];/*tymax-time whery is max */
'maxheight=rhs(float(ev(soly,tymax)));
wxplot2d([rhs(soly)],[t,0,9.5],[ylabel,"Height"]);