ElasticRaven Posted May 15, 2012 Share Posted May 15, 2012 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)) dtwhereF(t) = T(t) + Fg(t) + Fd(t)T(t) = thrust at time tFg(t) = force of gravity at time t ? -gm(t) at low altitudesg = Kerbin\'s gravitational accel at sea level = 9.8066 m/sFd(t) = force of drag at time t = -½ge-x(t)/5000Cd(t)v2(t) sourcex(t) = altitude at time t = ?0tv(t)dtCd(t) = mass-weighted drag factor at time tm(t) = mass at time tIf 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 More sharing options...
ferram4 Posted May 15, 2012 Share Posted May 15, 2012 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/s2Then 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. Link to comment Share on other sites More sharing options...
closette Posted May 17, 2012 Share Posted May 17, 2012 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=7161Kosmo-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 More sharing options...
ElasticRaven Posted May 18, 2012 Author Share Posted May 18, 2012 Thanks both. This is great stuff. Link to comment Share on other sites More sharing options...
Panichio Posted May 19, 2012 Share Posted May 19, 2012 My brain nearly exploded. Link to comment Share on other sites More sharing options...
Recommended Posts