Jump to content

Optimal angle for a rocket.


mardlamock

Recommended Posts

Hello everyone, as you may have already noticed im building a small rocket and I want to know what would be the furthest distance my rocket could go only hoirzontally, without any vertical acceleration. I started off by saying that the force exerts a certain force f which is a constant, the mass of the rocket as a function of t is m0-mr*t

where m0 is the initial mass, mr is the mass flow rate, and t is time).

So what I thought was that the best idea would be to say that the vertical component of the force f would at all times have to be equal to the mass of the rocket times g. This could be written as: sin (theta)= m*g/f. as i said before was m0-mr*t, so: sin(theta)= (m0-mr*t)*g/f. In order to find the angle I apply the inverse sine function, this gives us: theta(t)=sin^-1((m0-mr*t)*9.81/f)). Is this correct, because when i plug it into a wolfram to graph it it gives me some weird angle and i dont really understand what im doing wrong. I know that the optimal angle would be 45 degrees but that also means the rocket would displace upwards which i am not trying to analyze here (i want to think of my rocket as if it was to be used like an rpg or something like that).

Thanks!

Link to comment
Share on other sites

Without air resistance, you are best off accelerating as much as possible. But with air resistance, there is actually an optimal angle at which the rocket should hover in order to consume minimum amount of fuel per distance traveled. It's a bit complicated for real rocket in real atmosphere, but for KSP, it's a very simple optimization problem. I don't recall the exact answer and don't have a moment to derive it just now, but I'll drop back later and show you how to get optimal angle a bit later, if nobody beats me to it.

Link to comment
Share on other sites

So you might be misunderstanding the problem - if you have no vertical acceleration whatsoever and only balance for gravity, you'll simply fly like a plane right above the ground until you run out of fuel. How far you go would simply depend upon the amount of fuel you put in, your specific impulse, dry mass, wet mass, etc, so it will never get out of the atmosphere. If you really wanted to know this, you'd have to solve for a function that instantaneously gives your acceleration at any given moment and then doubly integrate it from your starting time to your ending time. So it would take the form sort of like:

\int_{0}^{t_{\infty}}\int_{0}^{t_{\infty}}\frac{F(t)\cos(\theta(t))-\frac{1}{2}\rho v^{2}C_{D}A}{m(t)}dt dt

(You can use http://www.codecogs.com/latex/eqneditor.php to see the LaTeX code in math format.) Where F(t) is your instantaneous force applied by the rocket, theta(t) is your angle function, which will vary over time, approaching 0 as the mass of the rocket goes to zero, C_d is your drag coefficient, rho is the density of the air, A is your cross sectional area, and m(t) is your instantaneous mass (and t_infinity is the time when you run out of fuel). This should give you your total displacement, approximating Kerbin while close to the ground as a flat plane.

Feel free to reply or pm me if you have any other questions!

Ben

Link to comment
Share on other sites

I expressed myself wrong, what im trying to find is the angle of the rocket as a function of time. I want the rocket to fly like a plane, that is exactly what i meant by saying that i wanted 0 vertical acceleration. You can think of it as if it was a missile launched parallel to the ground and i want it to remain at the exact same height through the time the engines are activated. By solving for this angle then i can calculate what the horizontal part of the force vector would be with respect to time, if I do the definite integral for that formula then i can calculate the maximum horizontal speed for my rocket and also the maximum horizontal displacement for the time the engines run. That is what i am looking for, the maximum horizontal displacement without atmosphere for the time the engines run.

Link to comment
Share on other sites

Disregarding air lift and drag, and assuming the ground is level, 45° is indeed your optimal angle... IF the rocket only accelerates at the start of its path. The travel path would then be a ballistic arc. If you want a straight path at some altitude above the ground, you need to compensate for Fg, so the angle is given by the acceleration of the rocket, which is itself a function of time. Once you have that function (you'll need Tsiolkovsky's equation and force balance in differential form, then an integration), derive with respect to [theta] and see where the derivative equals zero.

Once atmospheric effects are taken into account, well... the equations might get a little nasty.

Edit: sorry, misunderstood you. It seems you won't need to derive. The first part still stands, though. The sine (assuming 0° is parallell to ground) of your angle is directly proportional to the rockets mass, which is given by Tsiolkovsky.

Edited by Ravenchant
Link to comment
Share on other sites

Basically, you need a formulae to calculate the angle of attack needed to maintain a constant altitude for a specific TWR.

Maybe i am wrong, but isn't it just a percentage from a vertical angle ?

Basically, if my math not too rusted, you always need to 'divert' a twr of 1 towards the ground.

So your 'horizontal' TWR will be :

current TWR - 1

for maintaining altitude in the current gravity (already, you should be able to calculate the maximum horizontal distance from that.

From that, wouldn't it be simply a matter of percentage to deduce the necessary angle ? (I'm much less sure if my maths are correct in this one) but, basically, If your rocket has a TWR of 2, you will have half the thrust dedicated to maintain altitude. So 50% of the vertical angle (90º at a twr of 1) you would end up with a 45º angle above the horizon. In my reasoning, the formula would end up looking like this : 90*(1/TWR). Of course, given that we are using rocket engines and fuel, your TWR will go up with time :)

(With my twr of 2, the formula would read 90*(1/2) = 45°, With a TWR of 3, 90*(1/3) = 30°, and so on)

You can complicate the formulaes after you defined the basics, by replacing the various terms as you need it. (Ex, if you know your weight and 'horizontal' twr, you will be able to calculate the horizontal thrust from it.)

Edited by sgt_flyer
Corrected 1 formula
Link to comment
Share on other sites

I was asking if the function i proposed was right:theta(t)=sin^-1((m0-mr*t)*9.81/f)). It gives me some weird numbers when i graph it, ie, the angle is like 1 degree which is kind of odd.

Sounds like you're just not familiar with radians. Trig functions conventionally deal in radians, not degrees. 1 radian is 180/pi or roughly 57.3 degrees, sounds reasonable.

Link to comment
Share on other sites

That makes total sense tavert. I dont really know much about trig functions, seriously i just dont understand them. I can do some operations with trig identities and such and sort of understand where they come from but how the trig functions are graphed and how radians work just eludes me. Thanks, i will look into it when. But is my reasoning right, If it is right i know i can then integrate it just fine.

Link to comment
Share on other sites

The horizontal acceleration with respect to t is =cos(sin^-1((m0-mr*t)*9.81/f)))*f/(m0-mr*t). First i need to find the indefinite integral and then the definite integral right? So

i can get the f out of the way by factoring it out, then i have no idea what to do. How can i do integration by substitution here? Im sorry for being so dumb, I never had anyone explain calculus irl for me so all i know is from the interwebz and it is not much. Thanks!

Link to comment
Share on other sites

The bounds after substitution will bo m0 and m(dry mass of the rocket). But you need to put the whole thing into differential form.

Edit: mass is going to be your new variable. m = m0 - mr*t , and dm = -mr*dt , which means dt = dm/(-mr). Since acceleration = dv/dt, you have to put dt to the right side and substitute. You'll also have to integrate twice.

Edit 2: just calculated the whole thing, thanks to WolframAlpha. Yup, it's messy.

Edited by Ravenchant
Link to comment
Share on other sites

Are you trying to calculate velocity, distance, or both? Velocity is the first integral of acceleration, distance is the second integral of acceleration.

Worth noting that cos(sin^-1(x)) = sqrt(1 - x^2), which you can work out by drawing a right triangle and rearranging the Pythagorean theorem.

It's a somewhat long and messy integral. You can have Wolfram Alpha walk you through the Step-by-step solution (2 times per day after signing up with a free account), see http://wolfr.am/1jrh0KR

Link to comment
Share on other sites

Ah, your question is even simpler than I thought. But yeah, the fun stuff happens when you don't fly at full thrust. Turns out, if you want to travel as far as you can on a tank of fuel, you should keep a certain horizontal velocity.

So suppose, your horizontal velocity is responsible for drag Fd = kmv2. (Reason it's k*m is because of how KSP handles drag.) And, of course, you have to support the weight of the ship, Fw = mg. Because the two forces are perpendicular, the total thrust necessary is given by the following.

T = sqrt(Fw2+Fd2) = m*sqrt(g2 + k2v4)

Now, if you wish to travel some distance d, it will take you some time t = d/v. Meanwhile, you are going to burn a quantity of fuel T*t/(g*ISP). In other words, the quantity you wish to minimize is proportional to T/v. I'm also going to cheat here and take out the mass. (There are conditions when this can be done properly, which you are almost certain to never break.) And that gives me the following.

S = T/(mv) = sqrt(g2/v2 + k2v2)

And the first order necessary condition for optimization is dS/dv = 0. Skipping over some calculus and algebra...

-2g2/v3 + 2k2v = 0

v = sqrt(g/k) = vterminal

Which everyone who've been playing KSP long enough should have seen coming. Just like in the case of optimal vertical ascent, your best use of fuel for horizontal flight is to travel at terminal velocity.

The rest is very straight forward. If you are traveling horizontally at terminal velocity, drag is equal to weight. That means your rocket needs to be at 45o, and TWR should be sqrt(2) which is about 1.4.

Naturally, all of this only applies to planets with atmosphere. In vacuum, the faster you can accelerate the better. So just push throttle to the wall, and angle will be determined by TWR as you've previously calculated.

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