Acceleration curve fitting.

Merci Bon, and thats the limit of my French!

Suppose I should do the rest of the layers of the standard atmosphere up to 90K.

Is it worth modelling the change in Isp
248s(Sea Level)
285s(vacuum)
?

N.

 
Apologies for dredging this up, but I'm stuck on this:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_7_.jpg

I'm just trying to change the variable "Base_Temp" if the value of "h" is above a certain value. Trouble is h is a range variable going from 0m to 11Km in 100m steps.
So Base_Temp dosen't know what value to assign, and I get an "Illegal Context" error.
I can't change Base_Temp to a vector or subscripted type, it needs to be a scalar for later use.

Any ideas?

Many thanks, N.
 
It looks like you have done the right thing by putting Base_Temp(h) in the Temp(h) equation. The way I read it like this... h is a set of n elements. Base_Temp is also a set of n elements, each corresponding to a value in the set h. Seems valid to me.
 
Thanks tblaxland, here's a pic of the Base_Temp(h) values:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_9_.jpg

Its changing Base_Temp to Base_Temp(h) that was concerning me, I wasn't sure if it would have null values for other values of h. Still haven't got the hang of these rang e variables! But getting there.
I need to change the the temperature gradient with h, and set the p and p(1) values as well. Basically, I'd like to model the first three atmosphere layers, up to 33Km. That was about the limit of the RZ_2 engine burn.
I'm guessing, I'll need three nested "if - otherwise" statements, or is there a better way of doing it.
As you can see from the Programming toolbar, there aren't a lot of keywords.

The atmosphereic pressure change has a nice change on the engine thrust:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_10_.jpg

N.
 
Trying the "if otherwise" on the two formula for the atmospheric pressure, getting strange results, as usual:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_11_.jpg

The first one should be correct, not sure I've interpreted the constant temp one.

Anyone see anything obvious?

Many thanks, N.

---------- Post added at 11:04 ---------- Previous post was at 10:09 ----------

Had the "a1" variable in the second formula instead the Temp at 11000m

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_12_.jpg

Still not right though! At least the units in error message has gone.

---------- Post added at 09:57 ---------- Previous post was Yesterday at 11:04 ----------

Think I've found most errors, and its looking better:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_13_.jpg

It does have a kink at the 11000m point, any one any ideas?

Shows up in the thrust/altitude graph better

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_14_.jpg

Many thanks, N.
 
Notebook, I notice you are using the same lapse rate in the stratosphere as in the troposphere (-6.5e-3K/m).
This is incorrect as the temperature actually increases in this region, the lapse rate should be +1e-3K/m or +2.8e-3K/m.

As for your problem. It is the second equation (for h=11km->20km) that is incorrect. The pressure given by the first one is right (22.63kPa@11km). I don't have time to pinpoint exactly what caused the error. Your specific gas constant is a little low, but I don't think that should cause such a large error (4kPa).
 
Thanks simompro, yes it was a bodge!(sorry) to get the three layers of the atmosphere into a "if otherwise" structure. I just copied the first formula, and its variables? into the last. Just compounded my lack of....

As always, thanks for the input, and I'll have a bit more think.

N.
 
I've had a think, not much enlightentment!

Simplified it down to just the two atmos layers, 0m to 11000m, 11000m to 20000m. If I've interpreted the second formula wrong, I can't see the error. Here's the latest document.

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_15_.jpg

There are the two equations at the right hand side, with discrete values of 11000m, they give different results, with a difference of 4750 Pa. As simonpro confirms above.

Any ideas why I get that error.
Second question! Should I be surprised there is a discontinuity at the change of formula?

All input appreciated, N.
 
You should be surprised. A discontinuity implies that something is wrong witht he model. Your second equation is somehow incorrect.

---------- Post added at 01:26 PM ---------- Previous post was at 01:20 PM ----------

I suggest reading this:
http://www.atmosculator.com/The Standard Atmosphere.html

---------- Post added at 01:28 PM ---------- Previous post was at 01:26 PM ----------

And, in short, changing R to 287.053
 
Yes, I've stared at it lots, can't see the problem!

I got
p(h) = p1 e - [g0 / (R*T) ] * (h - h1)
from page 39 API_Guide.pdf, 2.3.2 A more sophisticated atmosphere:

Unless I've made some error in the formatting in Mathcad?
N.




---------- Post added at 13:28 ---------- Previous post was at 12:30 ----------

I think I've found my error, p1 should be the atmospheric value at the start of the layer, not the pressure at sea level. Using 2.265E4 Pa smooths out the curve:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_16_.jpg

Should have spotted it earlier as the exponent of e will collapse to zero at h=11000m, so the formula simlifies to p1*e^0, which is p1*1, I think! It has to match the value from the previous layer..

Took up a DG with the flight data recorder measuring Altitude and Pressure
Orbiter Flight Data Log Record
==============================
Columns:
TIME: simulation time (seconds)
ALT: altitude (km)
AIRSPEED: airspeed (m/s)
MACH: Mach number
TEMP: freestream temperature (K)
STP: static pressure (kPa)
DNP: dynamic pressure (kPa)
AOA: angle of attack (deg)
SLIP: horizontal slip angle (deg)
LIFT: total lift force (kN)
DRAG: total drag force (kN)
L/D: lift/drag ratio
MASS: vessel mass (kg)
# Log started for GL-01
# ____TIME _______ALT _______STP _______DNP

276.24 10.9236 22.9737 54.6051
277.25 10.9713 22.8027 55.0872
278.26 11.0175 22.6379 55.5751
279.26 11.0618 22.4807 55.9923

# Log stopped for GL-01

Looks to match STP as it went through 11Km.

N.

---------- Post added at 11:27 ---------- Previous post was Yesterday at 13:28 ----------

Think I've got the right format for the two "If _ otherwise" part:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_17_.jpg

Is it correct to use "if h > 11000m OR h < 22000m" to get the formula for the second layer?

I realise the last formula for >22000m isn't correct yet, have to put some constants in that rather than the range variables.

Many thanks, N.
 
Last edited:
Should be 'and', not 'or'. Otherwise I'd guess it will use the second formula for everything.
 
Tried it, dosen't look too good:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_18_.jpg

N.

Tried putting the base temp as a constant in for layer 3(20000m to 32000m), and making a3 the lapse rate(or temperature gradient) for that layer,and putting the pressure as a constant too.

At least we can see the three layers now!

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_20_.jpg

Besides the spike at 11Km..., the pressures are incorrect, should be 5475Pa at 20Km, and 825Pa at 32Km.

Must be something wrong with the third equation, I can't see it.

Anyone see the problem?

Many thanks, N.
 
Last edited:
Given up on trying to get the three if-otherwise to work at the moment, and just let the second equation run up to 32Km.

I have this now for the thrust/altitude curve for a RZ_2 engine:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_21_.jpg

Could someone check my algebra on the deriving of pe(exhaust pressure) please?

I get Exhaust Pressure = ((RZ2_Thrust(h)-mdot*Ve)/Ae)+p(h) from the thrust equation.
Had to use a constant value for thrust , Mathcad didn't like the () terms.

Many thanks, N.



---------- Post added at 10:21 ---------- Previous post was Yesterday at 11:06 ----------

Assuming the pe value is correct, I now have a thrust/altitude curve that seems reasonable.

To go back to the original problem, how do I get thrust(t) from thrust(h)?

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_22_.jpg

All replies appreciated.
N.
 
To go back to the original problem, how do I get thrust(t) from thrust(h)?
By step-wise integration?. The roughest approximation to a solution would be to assume the thrust for each time step is the same value as it was at the previous time step (pseudocode):

Code:
t0 = 0
h(t0) = 0
h(t+n) = h(t+(n-1)) + someFunction(thrust(t+(n-1)),mass(t+(n-1)),pitchProgram(t+(n-1)),drag(t+(n-1)))
*defining someFunction is left as an exercise for the reader but the arguments to it should give some idea as to its form
 
Argh! is there no end to this math torment...? Integration, I blame Sir Isaac, or that German chap who invented it first.

Either way, I'll have a go. Thanks as always

N.
 
Last edited:
Re above question, its nothing to do with the height(t) equation, its the launch mass that had to be changed, doh... Afraid I got a bit fixated on the launch mass being the F1 variant; simonpro, and brianj point out I have to be careful with what data I use.
Can't argue with the figures so upped the payload mass to 17600kg to get a t(0) acceleration of 11.8m/s^2 and a cut-off of 73m/s^2.
Here's a mix of the flight data graph and the Mathcad result:-

http://i89.photobucket.com/albums/k207/Notebook_04/AccelCurveFitt.jpg

Not a bad match, as drag, pitch and other real world stuff I don't know about aren't
considered.
I'll stop here, getting the thrust/alttitude equation to work with the simple atmosphere was intersting in Mathcad, though I'm a bit worried about not being able to nest more than two "If -- otherwise". Might try with something simpler.

For completeness, here's the last Mathcad document:-

http://i89.photobucket.com/albums/k207/Notebook_04/Mathcad_25_.jpg

Many thanks to tblaxland, simonpro, brianj, starbird for the help.

N.
 
Back
Top