- #1
Levis2
- 43
- 0
I am trying to write a java program to simulate the motion of a projectile undergoing a drag proportional to the velocity squared, but i am having some issues writing the acceleration part. This is my attempt, not sure if its right though;
a=g-kv^2
da/dt=-k dv^2/dt
since dv^2/dt=2vdv/dt;
da/dt=-2vkdv/dt
da=-2vkdv
and
a=dv/dt
dv=adt inserting;
da=-2vkadt
trying to incorporate some indexes; (bear with me, first prog. algorithm :)
a_(n+1)-a_n=-2vka_n Δt
a_(n+1)=a_n-2vka_n Δt
Is this all wrong ?
a=g-kv^2
da/dt=-k dv^2/dt
since dv^2/dt=2vdv/dt;
da/dt=-2vkdv/dt
da=-2vkdv
and
a=dv/dt
dv=adt inserting;
da=-2vkadt
trying to incorporate some indexes; (bear with me, first prog. algorithm :)
a_(n+1)-a_n=-2vka_n Δt
a_(n+1)=a_n-2vka_n Δt
Is this all wrong ?