Jump to content

Please help me validate these maths


BlazeFallow

Recommended Posts

Hello Folks,

I have been kind of obsessed with Optimizations as of late. So today I sat down and started making some formulas. Now I wish to validate my formulas by submitting them to you good people.

Please assume the following values:

X = Mdry

Y = Mwet

Z = # of Engines

P = Payload tonnage

Q = tank dry/wet ratio (ussually around 0.11)

S = Engine Weight

T = Engine Thrust

So that given the following static values:

dV, Isp, P, Q, S, T, TWR = some number > 1

Calculate the following:

X = Mdry

Y = Mwet

Z = # of Engines


With the above we can apply it to the dV equation, yielding:

dV = Isp * Ln(Y/X)

Keeping in mind that the values that KSP gives us for Isp of engines are in seconds so we must multiply them by 9.82 to get the Isp for this equation

Deriving this yields:

dV/Isp = Ln (Y/X)

edV/Isp = Y/X

Which then yields:

Y = X * edV/Isp

The thing is that X and Y are dependant on one another. As tanks are not massless when empty, X=P simply isn't true unless X=Y in which case dV will = 0

For this I came up with the formula (please validate my maths below, as I'm not 100% sure on it)

X = (Y - P - SZ)*Q + P + SZ

I then algebra'd the equation to relate it to Y

X = QY - QP - QSZ + P + SZ

X - QY = -QP - QSZ + P + SZ

-QY = -QP - QSZ - X + P + SZ

QY = QP + QSZ + X - P - SZ

Y = P + SZ + (X - P - SZ)/Q

That's great and all, but how do we optimize for a good enough TWR to get off Kerbin.

For this we have the TWR equation:

TWR = Z*T/Y*9.82

Related to Y this becomes:

Y = (1/TWR)*Z*T/9.82

So here we have three equations for optimizing:

Y = X * edV/Isp

Y = P + SZ + (X - P - SZ)/Q

Y = (1/TWR)*Z*T/9.82

This is where my brain starts to hurt. Can someone let me know if I'm actually on to something here, or if my brain is broken?

Edited by BlazeFallow
Edited to include end goal of equations
Link to comment
Share on other sites

I would confirm this: Y = X * edV/Isp

and this: Y = (1/TWR)*Z*T/9.82

Ok. I gonna try you second formula, wich seems bugged to me.

Number of Engines times Enigne count.

S*Z

add Payload () just for convinience....

P+(S*Z)

add dry mass

X+P+(S*Z)

Divide dry mass by tank ratio

(X/Q)+P+(S*Z)

equals wet mass.

Y=(X/Q)+P+(S*Z)

Algebra'd to X

Y=(X/Q)+P+(S*Z) | -Y -(X/Q)

-(X/Q)=P+(S*Z)-Y | * (-Q)

X= -Q*(P+(S*Z)-Y)

X= -PQ-(Q*S*Z)+(Q*Y) |rearange for convinience

X= (Q*Y)-(P*Q)-(Q*S*Z)

Link to comment
Share on other sites

Can you provide, how you came to this:

X = (Y - P - SZ)*Q + P + SZ

?

I don't get it.

Absolutely.

Also i completely forgot to include the reason for my doing this. I want to end up with a way in which to omptomize the following problem:

Given the following static values:

dV

Isp

TWR = some number > 1

P = Payload tonnage

Q = tank dry/wet ratio (ussually around 0.11)

S = Engine Weight

T = Engine Thrust

Calculate the following:

X = Mdry

Y = Mwet

Z = # of Engines

On to your question:

X = (Y - P - SZ)*Q + P + SZ

(Y - P - SZ) represents the full mass of the fuel tanks. Multipliying by Q (the dry/wet tank ratio) results in the dry mass of the tanks (as derived from Y wet mass) then adding back in the payload mass and engine mass you get the dry weight of the entire craft, here represent by X = Mdry.

Link to comment
Share on other sites

Ah. I see, where I missunderstood the basic concept. The definitions were given, but I didn't catch'em.

X and Y are based on the CRAFT.

Q is based on the FUEL TANK.

I have to rethink.

Link to comment
Share on other sites

I would confirm this: Y = X * edV/Isp

and this: Y = (1/TWR)*Z*T/9.82

Ok. I gonna try you second formula, wich seems bugged to me.

Number of Engines times Enigne count.

S*Z

add Payload () just for convinience....

P+(S*Z)

add dry mass

X+P+(S*Z)

Divide dry mass by tank ratio

(X/Q)+P+(S*Z)

equals wet mass.

Y=(X/Q)+P+(S*Z)

Algebra'd to X

Y=(X/Q)+P+(S*Z) | -Y -(X/Q)

-(X/Q)=P+(S*Z)-Y | * (-Q)

X= -Q*(P+(S*Z)-Y)

X= -PQ-(Q*S*Z)+(Q*Y) |rearange for convinience

X= (Q*Y)-(P*Q)-(Q*S*Z)

You are actually making the exact same error I was originally making when I first develope dthe formula.

It originally looked like:

X = P + Q*Y +S*Z

Then I realized that Y included P and S*Z in it, so applying Q to the full Y can't happen, as Q only applies to the fuel tanks.

The same is said about X. X is the full mass of the dry craft, so X includes P, S*Z and the dry mass of the tanks. Thus you cannot apply Q to X itself, but first need to remove P and S*Z from X so that you are only applying Q to the tanks.

Does that make sense?

Link to comment
Share on other sites

Can you provide, how you came to this:

X = (Y - P - SZ)*Q + P + SZ

?

I don't get it.

If I understand it correctly, it is:

DryMass = TankMass*TankRatio + Payload + TotalEngineMass

= (WetMass - Payload - EngineMass)*TankRatio + Payload + SingleEngineMass*NumberEngines

In the variation you've posted, you've used the dry mass of the tanks only as X, which won't yield the correct results in the delta V calculation.

Edit: I am slow.

Link to comment
Share on other sites

Alright... I think I have come up with a monstrous equation the relates all things to Y.

With

Y = X * edV/Isp

And

X = (Y - P - SZ)*Q + P + SZ

But Z is still in the mix. Let's solve that problem

TWR = Z*T/Y*9.82

TWR*Y*9.82 = Z*T

Z = (TWR * Y * 9.82)/T

So then we have:

Y = ((Y - P - (S * TWR * Y * 9.82)/T)*Q + P + (S * TWR * Y * 9.82)/T) * edV/Isp

Link to comment
Share on other sites

This is not trivial, sir. Because the tank and fuel weight are included in X and Y respectively, and Q is based on TankEmpty and (TankEmpty + Fuel), the whole thing gets quadratic. I am on it.

Link to comment
Share on other sites

I think that the last equation I came up with which relates everything to Y is valid.

I just put it in to Wolfram and let it do all the complex math I am incapable of (yeah, lazy way out, but I did the hard leg work of deriving the equations from my understanding of KSP's implimentation of orbital mechanics... so there's that)

It came up with a value that was pretty much what I was expecting. Which is that with a dV of 5000 and an Isp of 420 and a payload mass of 2000T I would need lifter of roughly 11000T And now that Y is given, I can then derive from it X, and Z, giving me the number of engines, and the total quantity of fuel.

Huzzah!

Granted, that 11000 could likely be a lot lower with multiple stages, as the number given is for effectively a SSTO design. Splitting it into smaller DV chunks and then using the Y value given as the new P for the next roung could possibly result in an overall lower Y value....

MATH

Link to comment
Share on other sites

Is the idea:

given the desired delta V, engine type and tank type, calculate the number of tanks and engines?

Then would it be better to have the unknown variables just Z, number of engines, and Nt, number of tanks? Then you would just have two variable to solve for? I'll have a play over lunch.

Link to comment
Share on other sites

Thanks OP. I wake up, sign into KSP, and this is the first thing I read... I'll be pondering this for most of the day XD.

Edit: so i did a quick over view and noticed you had a bit of a redundancy. You don't need SZ. Just make S the total mass of the engines of that stage and you're good to go. Furthermore, these formulas can't give you stats for your whole vehicle. Only a single stage. I've done this before. I'll do some meditating on it through out the day and post my results later on tonight.

Edited by AmpsterMan
Link to comment
Share on other sites

/ignore this ON

Sorry, BlazeFallow, I don't think your formula is correct.

/ignore this OFF

Hail to you, BlazeFallow, I think your formula might work.

Y=X+(Z*S)+P+Fuel | Enter more Detail

Y=X-TankEmpty+(Z*S)+P+Fuel+TankEmpty

TankEmpty/(TankEmpty+Fuel)=Q

1/(TankEmpty+Fuel)=Q/TankEmpty

TankEmpty/Q=(TankEmpty+Fuel)

Y=X-TankEmpty+(Z*S)+P+TankEmpty/Q

/ignore this ON

As long as you don't take care of the empty Tank's mass, you will not get a valid solution. It may be, that the overall mass of the tank is small enough that your formular results in plausible numbers.

But I think, it is not correct. And the bug is in the different calculation bases (craft for one set of numbers, fueltank for Q).

:(

/ignore this OFF

Full weight of the vessel is

Y

substract Payload and Thrusters

Y - P - (S*Z)

gives. Full tanks

Times Q

(Y-P-(S*Z))*Q

results in EmptyTank

OMFG. This dollar fell down in cents....

Edited by Kialar
Link to comment
Share on other sites

Hi all,

If we're all having a go I'll chip in my attempt! From what I understand you want the number of tanks (Nt) and number of engines for a give engine type (empty mass Me, full mas Mf), fuel tank type, payload and delta V.

I get an equation for number of engines:

gif.latex?z=\frac{(P+M_{fulltank}N_t)}{S}\alpha

which tells you how many engines you need to lift the craft off the ground,

and an equation for the number of tanks,

gif.latex?N_t=(P+SZ)\Omega

Which tells you how many tanks you need to give you the delta-V.

Where alpha

gif.latex?\alpha=\frac{1}{\frac{T}{S\cdot TWR}-1}

Gives the ratio of the desired TWR to the "excess" thrust to weight after you take off the weight of the engines

and Omega

Isp}}-M_{emptytank}  }

Is something like the Delta-V left for accelerating everything but the empty tank.

I should be able to substitute one into the other to get an analytic solution... give me a moment

Edit: Got it! Even better got it in a way that might mean something:

The number of tanks you need is Nt:

gif.latex?N_t=P&space;\frac{\Omega(1+\alpha)}{1-\Omega&space;M_{fulltank}&space;\alpha}

Edited by Doozler
(nice looking) MATHS!
Link to comment
Share on other sites

Hey Guys,

So I have my final Equation and the method for solving it.

Y = ((Y - P - (S * TWR * Y * 9.82)/T)*Q + P + (S * TWR * Y * 9.82)/T) * edV/Isp

To solve we then re-label the function to match the standard algebraic function y = f(x)

y = ((x - P - (S * TWR * x * 9.82)/T)*Q + P + (S * TWR * x * 9.82)/T) * edV/Isp

At this point we will find our solution where y=x.

So we can plot out both of these functions in a graphing calculator and find the intersect. You could also find the intersect by hand if you hate yourself or are just a huge fan of simplifying complex algebraic functions in your head. The sounds about as fun as Seppuku to me though.

Either way, as AmpsterMan stated this is just for a single stage structure. You can take the equation and turn it iterative though. Meaning run it once for your last stage for whatever amount of dV you want it to have, and then take the resulting Y value and plug it into the equation again as the X value and whatever dV value you want that stage to have. Do this as many times as you want stages and your end Y value will be the full weight of your whole vehicle as each stage treats the stage above it as its payload.

Then with the Y values you plug that into the Z TWR formula to get the number of engines you need to get the TWR you desired.

Note also that this equation is set up for linear staging, not asparagus or boosters, as it is not set up to use the thrust of the next stage in the calculations. That would require a slight modification which I may mull over and put up as a follow up post.

Cheers!

BlazeFallow

Link to comment
Share on other sites

Doozler has the right take on it. This is a much simpler problem if your variables are number of engines and the amount of fuel. And this isn't really an optimization problem. It's a simple algebraic equation.

Link to comment
Share on other sites

Hi all,

If we're all having a go I'll chip in my attempt! From what I understand you want the number of tanks (Nt) and number of engines for a give engine type (empty mass Me, full mas Mf), fuel tank type, payload and delta V.

I get an equation for number of engines:

<img src="http://latex.codecogs.com/gif.latex?z=\frac{(P+M_{fulltank}N_t)}{S}\alpha" title="z=\frac{(P+M_{fulltank}N_t)}{S}\alpha" />

which tells you how many engines you need to lift the craft off the ground,

and an equation for the number of tanks,

<img src="http://latex.codecogs.com/gif.latex?N_t=(P+SZ)\Omega" title="N_t=(P+SZ)\Omega" />

Which tells you how many tanks you need to give you the delta-V.

Where alpha

<img src="http://latex.codecogs.com/gif.latex?\alpha=\frac{1}{\frac{T}{S*TWR}-1}" title="\alpha=\frac{TWR9.82}{T/S-1}" />

Gives the ratio of the desired TWR to the "excess" thrust to weight after you take off the weight of the engines

and Omega

<img src="http://latex.codecogs.com/gif.latex?\Omega&space;=&space;\frac{1}{\frac{M_{fuel}}{1-e^{dV/Isp}}-M_{emptytank}}" title="\Omega = \frac{1}{\frac{M_{fuel}}{1-e^{dV/Isp}}-M_{emptytank}}" />

Is something like the Delta-V left for accelerating everything but the empty tank.

I should be able to substitute one into the other to get an analytic solution... give me a moment

Edit: Got it! Even better got it in a way that might mean something:

The number of tanks you need is Nt:

<img src="http://latex.codecogs.com/gif.latex?N_t=P&space;\frac{\Omega(1+\alpha)}{1-\Omega&space;M_{fulltank}&space;\alpha}" title="N_t=P \frac{\Omega(1+\alpha)}{1-\Omega M_{fulltank} \alpha}" />

Your latex is failing... if only KSP forums have its own latex parser...

Edited by Aghanim
deduplication
Link to comment
Share on other sites

I suppose HTML tags doesn't work here...

gif.latex?z=\frac{(P+M_{fulltank}N_t)}{S}\alpha" title="z=\frac{(P+M_{fulltank}N_t)}{S}\alpha

Change your <img src=> /> to %7Boption%7D [/ IMG] one (remove the space between the slash and img), or use the forum built in image insert function

Edited by Aghanim
Link to comment
Share on other sites

Yup, that worked. I think I might have done that last time, it was appearing in the preview yesterday for some reason so I must have got lazy.

Now where's that KSP Forum Latex Parser Petition for me to sign...

Link to comment
Share on other sites

One thing to consider is that when you take into account variable Isp, staging, varying TWR, varying TWR requirements (as you change your speed), drag, and miscellaneous parts like decouplers, these formulas lose their usefulness pretty quickly. Honestly, your best bet is to download Kerbal Engineer Redux and go build stuff.

Link to comment
Share on other sites

I completely agree Jim. My equation is just meant to give a rough estimate of what it would require. So those individuals trying to launch a 2KT payload to orbit can just do the maths quickly and realize "Holy Kerb! I will need an 10KT rocket to do that!"

Of course, it gets even more difficult when you are doing horizontal staging rather than vertical, as the engines from the first stage continue to fire throughout the rest of the stages as well, so their weight would be added as the payload weight at the beginning of your iteration, but should not be accounted for (only the new stages as you grow outward). But that's just their mass, their thrust would still be present.

The math gets pretty fuzzy and I admire and respect the folks who made MechJeb and Engineering Redux for implementing a bunch of crazy maths my brain has a hard time wrapping itself around. I do try though, as I'm sure is evident by my attempts shown in this thread.

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...