Jump to content

Calculating Velocity During Accent


Recommended Posts

I\'m trying to calculate the velocity of my rocket at a given time, assuming I ascend straight up with no worries about wobbling and steering issues. Here is what I have so far:

v(tf) = tf + ?0tf(F(t)/m(t)) dt

where

F(t) = T(t) + Fg(t) + Fd(t)

T(t) = thrust at time t

Fg(t) = force of gravity at time t ? -gm(t) at low altitudes

g = Kerbin\'s gravitational accel at sea level = 9.8066 m/s

Fd(t) = force of drag at time t = -½ge-x(t)/5000Cd(t)v2(t) source

x(t) = altitude at time t = ?0tv(t)dt

Cd(t) = mass-weighted drag factor at time t

m(t) = mass at time t

If I work all this out, I get v(tf) as an integral equation involving not only ?v2(t) dt but also ?e?v(t)dt dt. How does one solve this? My first thought was to take derivatives until the integrals go away, then solve the ODE. But unless I goofed up, the exponential term causes the integral to remain forever.

My rocket is simple: stock chute, stock pod, Z02 main, stock solid booster. So it\'s easy to account for everything except drag (of course!). Any hints would be appreciated.

Link to comment
Share on other sites

You\'re gonna have to solve this numerically, but I would do this:

dx/dt = v(t)

dv/dt = (T(t) - ½*m(t)*0.0098*e-x(t)/5000Cd(t)*v2(t) - mu*m(t)/(RK+x(t))2)/m(t)

where mu = 3530.35 km3/s2

Then solve it using a standard 4th order Runge-Kutta scheme. It\'ll give you velocity and altitude as functions of time.

If you\'re looking for an analytic solution then I think you\'re out of luck.

Edit: forgot mass in the gravity force term. :P

Link to comment
Share on other sites

Attached is a PDF of some restricted solutions I found analytically, on the assumption that 'g' and the drag factor are both constant, and that the Thrust/Weight ratio is held constant (different from constant-thrust).

Even with these simplifications, the functions are hard to evaluate (exponential integrals), and it would be better to use a numerical method such as RK4, although if you use a smaller time-step (0.01s) you can use a simple step-wise linear method, as jebbe and I did for the Goddard Problem challenge thread, here: http://kerbalspaceprogram.com/forum/index.php?topic=7161

Kosmo-not implemented something similar just by using an Excel spreadsheet to update the mass, velocity, thrust etc. in each timestep (referenced in the same thread above). We all learned a lot about the atmosphere and optimal ascent strategies in that thread!

For constant thrust (therefore dm/dt = constant), even assuming a constant-density atmosphere I cannot get an analytical solution. If someone is interested enough I can post the C++ code I use, but you have to edit the thrust, mass, and drag factors for each particular rocket, using information from the KSP Parts Wiki.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...