Jump to content

Calculating Burn Time


Recommended Posts

I've been working on my Maneuver Node gauge for SteamGauges, and I'm having some trouble calculating how much time the burn will take. If anyone has any insights why neither the full Rocket Equation version or a simple f=m*a calculation aren't giving me good results, I would appreciate it.


deltaV = myNode.DeltaV.magnitude; //The burn's ÃŽâ€V
deltaVRem = myNode.GetBurnVector(FlightGlobals.ActiveVessel.orbit).magnitude; //Remaining ÃŽâ€V in the burn
res r = calculateThrust(FlightGlobals.ActiveVessel); //Actually calculates thrust, mass, and Isp
double mass = r.mass / Math.Pow(Math.E, (deltaVRem / r.isp)); //Mass after burn
double rate = r.thrust / (r.isp*9.81); //Mass flow rate
double burnTime = (r.mass - mass)/rate; //Mass to burn over rate should give time, but doesn't
//Try the f = m*a method for time computation...
double t2 = deltaVRem / (r.thrust / ((r.mass+mass)/2)); //Use average mass to get closer?

I'm using a custom function that just runs through each part and get's its .mass and .GetResourceMass(), and then thrust and Isp for active engines. The latter two are spot on, but my mass is always slightly off from, say, Kerbal Engineer. Thanks for the help guys!

Link to comment
Share on other sites

I tried figuring up some total delta V examples on a page on the wiki the other day. I could only get it to work out when I used 9.816 * isp, and reduced ln(tot/dry) to 3 places past the decimal as well, otherwise I was coming up 1 or 2 off.

Not really sure how that translates to your code though as I am still a noob at this part, lol.

And yes, I know you want time, but just wondering if it's something similar to this since this was so touchy about decimal places.

Edited by Cheebsta
Link to comment
Share on other sites

Thanks, the physicalSignificance got me the right mass. That certainly helps some.

Playing around with 9.816 vs 9.82 vs 9.81 I can get kind of close, but nothing there seems to be spot on.

I'll try rounding some values I guess...

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...