kill(all)$

load(lrats)$

appendix : ode2 with resistance '-k*m*v^2'
peter.vlasschaert@gmail.com,29/07/2018.

Newton second law : F=m*a=m*dv/dt
=================================

m : mass
v : velocity
t : time
a : acceleration

second type : resistance  '-k*v^2*m'

p1:m*'diff(v,t)=m*g-k*m*v^2;

assume(k>0,g>0,m>0);

p2:ode2(p1,v,t);

p3:expand(p2);

ic1 : ?
============================================
Menu : equations => Initial value problem(1)
v=v(t)
============================================
solution:  p3                       ( or % )
point   :  t=0
value   :  v=u
============================================
t=0 , ic1 = initial condition 1
v=u   intial velocity of v at t=0

p4:ic1(%, t=0, v=u);

final equation : velocity (vector equation)
===========================================

p5:solve(p4,v);

we select v > 0

vector equation : v(velocity)
===================

p6:p5[2];

vector equation : r (distance)
===============================

p8:subst([v='diff(r,t)],p6);

p8a:ode2(p8,r,t);

t=0 , ic1 = initial condition 1
r=0   intial distance of r at t=0

p8b:ic1(p8a,t=0,r=0);

components v: vx,vy
========================
vx : x direction use 
vy : y direction use 
========================

component : equations vx,vy
===========================

1e) only gravity : neg 'y' direction 
====================================
g =-g  , g = 9.81 m/s^2 , y = direction
====================================
2e) initial velocity
====================
u = U*cos(α) , x direction
u = U*sin(α) , y direction
====================================

rem : above input 1e) ,2e)  ? , use numerical methods 
      to solve above problem 'p1'

--------------------------------------------------------------------------------------------------------