Rocket ascent (rocket equation)

PriestLizard

Member
Joined
Jul 10, 2009
Messages
95
Reaction score
3
Points
8
Location
Toronto
Hey guys.

Yesterday I started to work on a small tool to calculate a rocket launch, i.e. calculates some important variables on the way of the rockets climb.

The main tool of my approach is, as the title implies, the rocket equation. The rocket equation gives me the velocity v = v(t) at a certain time t. From this velocity, I can derive the acceleration and the position in a 2-dimensional space (I only calculate vertical and horizontal speed).

Because my programming skills are rather limited, I only use discrete time steps for now. So I'm calculating the for time steps i=1,...,t. I'm using the function

v(t) = vg * ln (m(0) / m(t)) - g*t

Then I derive

a(t) = v(t) - v(t-1)
and
altitude(t) = altitude(t-1)+v(t)

I know its a very basic approach but I think it should work for a certain extend. For now I only cover vertical velocity/acceleration, so for calculations I use the pitch angle to get the cathetus.

This is an example result:
Used parameters:
Gravitational constant: 6.674280000000001E-11
Main body mass: 5.974E24
Vessel mass: 2500000.0
Fuel consumption rate: 12500.0
Pitch angle: 89.0
Specific impulse: 285.4230377166157
(equivalent to a exhaust speed of 2800m/s)

Calculates values: (hopefully the format won't be too messed up - EDIT No its not,
Code:
 looking great :) )
Vs: Vertical speed, Va: Vertical acceleration, Alt: Altitude
[code]
T+1	Vs: 4.222979489607894	Va: 4.222336309377167	Alt: 0.0	Hs: 0.24494656812745266
T+2	Vs: 8.516654388279147	Va: 4.293020951187303	Alt: 4.222979489607894	Hs: 0.49112712921023316
T+3	Vs: 12.881740603454247	Va: 4.36442139140176	Alt: 12.73963387788704	Hs: 0.7385541794591978
T+4	Vs: 17.318964972554802	Va: 4.436548558336963	Alt: 25.621374481341288	Hs: 0.9872404058687331
T+5	Vs: 21.82906548661183	Va: 4.509413603903576	Alt: 42.94033945389609	Hs: 1.2371986901202017
T+6	Vs: 26.4127915196529	Va: 4.58302790936446	Alt: 64.76940494050791	Hs: 1.4884421125859106
T+7	Vs: 31.07090406400924	Va: 4.657403091253762	Alt: 91.18219646016081	Hs: 1.7409839564364111
T+8	Vs: 35.8041759717392	Va: 4.732551007492293	Alt: 122.25310052417005	Hs: 1.9948377118545615
T+9	Vs: 40.61339220235176	Va: 4.808483763686679	Alt: 158.05727649590926	Hs: 2.250017080359558
T+10	Vs: 45.499350077037704	Va: 4.88521371963596	Alt: 198.670668698261	Hs: 2.5065359792445525
T+11	Vs: 50.46285953960212	Va: 4.962753496031971	Alt: 244.17001877529873	Hs: 2.7644085461312526
T+12	Vs: 55.50474342432264	Va: 5.041115981383964	Alt: 294.63287831490084	Hs: 3.0236491436453985
T+13	Vs: 60.625837730948945	Va: 5.120314339158828	Alt: 350.1376217392235	Hs: 3.284272364216902
T+14	Vs: 65.82699190707524	Va: 5.200362015152915	Alt: 410.76345947017245	Hs: 3.5462930350086723
T+15	Vs: 71.10906913812644	Va: 5.2812727451046	Alt: 476.5904513772477	Hs: 3.809726222978347
T+16	Vs: 76.47294664519671	Va: 5.36306056254542	Alt: 547.6995205153742	Hs: 4.07458724007708
T+17	Vs: 81.91951599101307	Va: 5.445739806923938	Alt: 624.1724671605709	Hs: 4.34089164859016
T+18	Vs: 87.44968339427098	Va: 5.529325131976423	Alt: 706.091983151584	Hs: 4.608655266623755
T+19	Vs: 93.06437005263919	Va: 5.613831514394799	Alt: 793.541666545855	Hs: 4.877894173742985
T+20	Vs: 98.76451247470632	Va: 5.69927426276699	Alt: 886.6060365984943	Hs: 5.14862471676607
T+21	Vs: 104.55106282117512	Va: 5.785669026823247	Alt: 985.3705490732006	Hs: 5.4208635157198986
T+22	Vs: 110.42498925561651	Va: 5.87303180699442	Alt: 1089.9216118943757	Hs: 5.694627469962463
T+23	Vs: 116.38727630509894	Va: 5.961378964285805	Alt: 1200.3466011499922	Hs: 5.969933764477665
T+24	Vs: 122.43892523104176	Va: 6.050727230499588	Alt: 1316.7338774550913	Hs: 6.246799876348591
T+25	Vs: 128.58095441062574	Va: 6.1410937187903345	Alt: 1439.172802686133	Hs: 6.525243581415052
T+26	Vs: 134.81439972914086	Va: 6.232495934600744	Alt: 1567.7537570967588	Hs: 6.805282961122043
T+27	Vs: 141.14031498363403	Va: 6.324951786959651	Alt: 1702.5681568258997	Hs: 7.08693640956544
T+28	Vs: 147.55977229826016	Va: 6.4184796001837725	Alt: 1843.7084718095336	Hs: 7.370222640741976
T+29	Vs: 154.0738625517439	Va: 6.513098125986434	Alt: 1991.2682441077939	Hs: 7.65516069601062
T+30	Vs: 160.68369581737608	Va: 6.608826556010374	Alt: 2145.342106659538	Hs: 7.941769951772738

I used the russian Energia rocket in Orbiter for some comparison and my values are not sooo wrong. I already know about some issues though:

1. g is of course dependend on the altitude - I don't have a proper programming solution for this yet but I will def. implement it later on.
2. Pressure and air resistance should come into play later on as well.

Besides that, my questions to you are:
1. Are my values reasonable or are they totally unrealistic?
2. No matter what kind of variables I use for rocket characteristics (i.e. specific impulse and fuel consumption rate), it seems that my vertical speed is always a little bit too low, while my altitude is too high. The issue here might be, that rockets usually start with a slightly lower thrust in the beginning (at least I witnessed that with the Energia rocket) - is that reasonable?
3. What kind of improvements would you suggest?
4. Do you think this is a reasonable way to describe a rocket launch or is the discrete approach a big problem? Usually integrals can be approximated by sums so I thought it cant be too way off.

Thanks for your time and help, see you later :)
 

the.punk

Advanced Orbinaut
Joined
Nov 3, 2008
Messages
1,026
Reaction score
0
Points
0
Good calculations so far.
But what it with atmospheric pressure?
I know this has nothing to do with rocket equation but that is a point for accent.
 

Kyle

Armchair Astronaut
Addon Developer
Joined
Mar 17, 2008
Messages
3,912
Reaction score
339
Points
123
Website
orbithangar.com
Man.. I wish I had a higher math education standard than Geometry with the math I learned from Orbiter (which makes me a bright student cause Orbiter helped me learn to apply math to space flight)
 

francisdrake

Addon Developer
Addon Developer
Joined
Mar 23, 2008
Messages
1,089
Reaction score
908
Points
128
Website
francisdrakex.deviantart.com
The ISP (and in consequence the exhaust velocity) is lower at sea level, because the atmospheric pressure reduces the gas expansion. Orbiter takes this into account by specifying an ISP (in vacuum) and an ISP0 (at sea level, 1 bar ambient pressure).

Coding this into your formulas might become complex, because it requires to consider the atmospheric model, which is a non-linear function p(h), where p is the ambient pressure and h is the altitude.

You could approximate it with a linear function from 0 to ~20 km, ignoring the remaining very low pressure above this altitude.
 

the.punk

Advanced Orbinaut
Joined
Nov 3, 2008
Messages
1,026
Reaction score
0
Points
0
The ISP (and in consequence the exhaust velocity) is lower at sea level, because the atmospheric pressure reduces the gas expansion. Orbiter takes this into account by specifying an ISP (in vacuum) and an ISP0 (at sea level, 1 bar ambient pressure).

Coding this into your formulas might become complex, because it requires to consider the atmospheric model, which is a non-linear function p(h), where p is the ambient pressure and h is the altitude.

You could approximate it with a linear function from 0 to ~20 km, ignoring the remaining very low pressure above this altitude.

Exactly that I mean with the atmosphere. But I don't have the formula.
But they will become complex.
 

TJohns

Addon Developer
Addon Developer
Joined
Apr 4, 2008
Messages
69
Reaction score
0
Points
6
The fact that it takes about 6-7 seconds to clear a typical launch tower height feels wrong to me.
 

PriestLizard

Member
Joined
Jul 10, 2009
Messages
95
Reaction score
3
Points
8
Location
Toronto
Hi all. Thanks for your help and comments. TJohns, I feel the same! Actually I'm quite happy with my trajectory now except the fact, that it seems about 4-5seconds too fast.

This is the status right now:
Due to your comments I included the effect of decreasing atmospheric pressure. I used the formula

f(y) = p0 * exp ( -y / 7990 ),

with p0 = 101325 Pa to calculate the pressure w.r.t. altitude y.

Then I used the following approach to compute the influence of the pressure on my exhaust speed. Let v_eff be the efficient exhaust speed, v_actual the actual exhaust speed. Then I got:

v_eff = I_eff / m , where I_eff is the impulse and m the mass of fuel per second.

Hence v_eff = (I_actual - I_pressure)/m = (m*v_act - p*A)/m

This way I get an effective exhaust speed for vacuum (p=0) v_eff = v_act , which is good. Now with the same parameters as above (and a nozzle area of about 5m - which I chose because I wanted to simulate three nozzles with a radius of 3m each) I get these results:

Code:
T+1:2163.3562487500285:	Vs [m/s]: 1.032262095508651	Va [m/s^2]: 1.0321048769916312	Alt [m]: 0.0
T+2:2163.4384941520857:	Vs [m/s]: 2.1199718572343933	Va [m/s^2]: 1.0871319653113594	Alt [m]: 1.0326742912372886
T+3:2163.6074022600683:	Vs [m/s]: 3.2649982757648246	Va [m/s^2]: 1.143154959308136	Alt [m]: 3.1543434731351425
T+4:2163.8675369258813:	Vs [m/s]: 4.469324366514051	Va [m/s^2]: 1.2002122824378871	Alt [m]: 6.423272731222049
T+5:2164.223580296626:	Vs [m/s]: 5.73505174125502	Va [m/s^2]: 1.25834374922242	Alt [m]: 10.899789042212767
T+6:2164.680335187184:	Vs [m/s]: 7.0644053318246876	Va [m/s^2]: 1.3175906132120343	Alt [m]: 16.64640305482464
T+7:2165.24272709441:	Vs [m/s]: 8.459738256577609	Va [m/s^2]: 1.3779956145703156	Alt [m]: 23.72793578945545
T+8:2165.915805795966:	Vs [m/s]: 9.923536817699102	Va [m/s^2]: 1.4396030269942974	Alt [m]: 32.21165028824715
T+9:2166.7047464705433:	Vs [m/s]: 11.458425614639154	Va [m/s^2]: 1.502458703600162	Alt [m]: 42.16738833269077
T+10:2167.6148502695255:	Vs [m/s]: 13.067172755728308	Va [m/s^2]: 1.5666101213819892	Alt [m]: 53.66771232838173
T+11:2168.6515442630075:	Vs [m/s]: 14.752695146395197	Va [m/s^2]: 1.63210642376906	Alt [m]: 66.78805243542888
T+12:2169.8203806755023:	Vs [m/s]: 16.518063828349995	Va [m/s^2]: 1.6989984607780924	Alt [m]: 81.60685899788865
T+13:2171.1270353187265:	Vs [m/s]: 18.366509339538055	Va [m/s^2]: 1.7673388261657719	Alt [m]: 98.20576029599462
T+14:2172.5773051204856:	Vs [m/s]: 20.301427059610376	Va [m/s^2]: 1.8371818909322022	Alt [m]: 116.66972561034905
T+15:2174.177104640048:	Vs [m/s]: 22.326382500058514	Va [m/s^2]: 1.9085838324477986	Alt [m]: 137.08723354711793
T+16:2175.932461451469:	Vs [m/s]: 24.445116491982986	Va [m/s^2]: 1.9816026583869866	Alt [m]: 159.55044552705718
T+17:2177.849510267267:	Vs [m/s]: 26.661550217725505	Va [m/s^2]: 2.0562982245940113	Alt [m]: 184.15538428830243
T+18:2179.9344856657217:	Vs [m/s]: 28.979790025204778	Va [m/s^2]: 2.1327322458713125	Alt [m]: 211.0021171927047
T+19:2182.193713276071:	Vs [m/s]: 31.40413195585498	Va [m/s^2]: 2.2109682986469767	Alt [m]: 240.19494405743663
T+20:2184.633599267101:	Vs [m/s]: 33.93906590845836	Va [m/s^2]: 2.291071814321322	Alt [m]: 271.84258915708574
T+21:2187.2606179764193:	Vs [m/s]: 36.589279352020355	Va [m/s^2]: 2.3731100620425516	Alt [m]: 306.05839695584984
T+22:2190.081297510166:	Vs [m/s]: 39.35966049111815	Va [m/s^2]: 2.4571521195367145	Alt [m]: 342.9605310342553
T+23:2193.102203136499:	Vs [m/s]: 42.25530077694904	Va [m/s^2]: 2.5432688305200806	Alt [m]: 382.67217556951823
T+24:2196.3299182911487:	Vs [m/s]: 45.28149664672077	Va [m/s^2]: 2.6315327471494543	Alt [m]: 425.32173861285366
T+25:2199.771023010131:	Vs [m/s]: 48.44375036311283	Va [m/s^2]: 2.7220180558357914	Alt [m]: 471.0430562804448
T+26:2203.4320696038085:	Vs [m/s]: 51.747769814544085	Va [m/s^2]: 2.8148004847165806	Alt [m]: 519.9755968372205
T+27:2207.3195553883675:	Vs [m/s]: 55.199467125987894	Va [m/s^2]: 2.909957190960442	Alt [m]: 572.2646635041611
T+28:2211.4398922961236:	Vs [m/s]: 58.80495591943003	Va [m/s^2]: 3.0075666260736558	Alt [m]: 628.0615946607764
T+29:2215.7993731954193:	Vs [m/s]: 62.570547052970085	Va [m/s^2]: 3.107708377310011	Alt [m]: 687.5239599452984
T+30:2220.404134765003:	Vs [m/s]: 66.5027426584158	Va [m/s^2]: 3.210462983297132	Alt [m]: 750.8157505768709
Looks a bit messy yes but I quickly included the effective exhaust speed at a certain time T up front between the two :'s.

Now everything seems a bit too slow ... hmm... I wonder if I miss some kind of inertia or something?
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
641
Points
188
with p0 = 101325 Pa to calculate the pressure w.r.t. altitude y.

Shouldn't that be 1013.25 Pa?


Ignore the above, you are correct, I was thinking millibars. Thats what happens when you grow up with Imperial units..
N.
 
Last edited:

PriestLizard

Member
Joined
Jul 10, 2009
Messages
95
Reaction score
3
Points
8
Location
Toronto
Heh :) First I wasn't sure about what kind of unit I should use... but then I figured it would be best to measure pressure with N/m² and thats Pa.

Oh and btw: It would be awesome if you guys could come up with some "models" (i.e. parameters for the rockets specs) AND real data for comparison. I tried to find the real data for the shuttle but I didnt find valuable ascent data (at least for this specific time frame).

It would be great to know the parameters for orbiter-vessels, because then it would be easy to retrieve comparison data.
 
Top