• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Mathematical guidance please.

Messages
1,468
Country
italy
Code:
(A:Turb eng1 pressure ratio, ratio) abs 0.7125 - (A:AMBIENT PRESSURE,inHg) * (A:AMBIENT PRESSURE,inHg) < if{ (A:AMBIENT PRESSURE,inHg) (>L:Eng_1_P7,number) } els{ (A:Turb eng1 pressure ratio, ratio) abs 0.7125 - (A:AMBIENT PRESSURE,inHg) * (>L:Eng_1_P7,number) }

<Value>(L:AMBIENT PRESSURE,number) 15.475 / (L:AMBIENT PRESSURE,number) * (>L:P7_limit, number)</Value>
Produces a straight line which is an average obviously. What/how can/do I add to the the formula to make it into a curve?
In the real situation there is very little movement from ambient pressure when the engines has reached idle power from start up. As power is applied P7 increases much more.
Alternatively I could try a steeper straight line. But I'm not sure how to calculate that.

The current calcuation starts at a higher point on the gauge with a lower top end.
Guidance appreciated.
 
Hi Volo,

Are you looking for the equation of a curve representing the relationship between A:TURB ENG1 PRESSURE RATIO (ie, "X") and L:Eng_1_P7? (ie, "Y") ??

If that's right, do you have MS excel spreadsheet? For very quick and dirty, you could try excel's curve fitting/regression function. Make a table of X-Y pairs that you believe more accurately reflect the relationship you want to see than your current straight line relationship, chart your table of X-Y values using Scatter, then add Trendline and see which curve type fits best. It will tell you the equation of the curve, which is what you need, and the R-squared value ("closeness" of curve fit, if you will. 1.000 equals perfect fit) if you check those boxes. To get more significant digits in the equation parameters result, format your input X-Y values to have, say, at least 4 decimal places. You will see what I mean if you play around with it.

There's no physics behind this method, per se, and its realism depends totally upon the values you in some way come up with to populate your table. If the real world relationship doesn't really fit one of the excel curve types closely enough, then your curve just won't be so real world accurate, but it might be better than straight line. Oh well. I said it's quick and dirty :)

Bob
 
Last edited:
Libre/OpenOffice als has a function for regressions. The resulting curve depends on the amount of known points that you have available.
I've found that a polynomial curve produced the best results every time I needed a regression curve.
 
and Libre/OpenOffice is more affordable than excel :)

Expressed in an equation:
Code:
Libre/OpenOffice_Cost = MS_Excel_Price - MS_Excel_Price

Personal opinion: LO's/OO's interface is also much, much better.
 
I have an old version of excel that does trend lines. But I'm not sure if it does the curve equation. I'll have to check.
Thanks for your input.
 
I have an old version of excel that does trend lines. But I'm not sure if it does the curve equation. I'll have to check.
Thanks for your input.
Yeah, it should have the equation and R-squared. Be sure to select X-Y Scatter Type chart then look at Trendline Options:

upload_2015-7-27_23-27-33.png


Been a while since I last looked at OpenOffice spreadsheet but it's probably very similar in capability and function. And it's free.

Bob
 
Ok Bob,
It has given me an equation but it still doesn't make too much sense to my grey pea.
I put a trend line to my n2 thrust calculations to see how it works
x----y
60 9.5
65
9.9
70
11.5
75
16.5
80
24
85
37
90
54
95
75
100
100

The equation it gave was y=1.8905x2 - 7.8581x + 15.914



1.8905x2 being to the power of 2
What does the x stand for? Is it a multiplier or referring to the x coordinates?

Can you explain the equation is simpler terms?
Thanks
 
Your equation is equivalent to:

y=1.8905*x^2 - 7.8581*x + 15.915

However it doesn't seem to fit your table. At x = 100 and y = 100

y = 1.8905*100000 - 7.8581*100 + 15.915 = 18955 - 785.81 + 15.915 = 18135.11

I think it should be 100.





 
Using your data.

Excel gives me polynomial order of 2 or 3

Code:
x    y
60    9.5
65    9.9
70    11.5
75    16.5
80    24
85    37
90    54
95    75
100    100
  
  
60    10.878        y = 0.0756x2 - 9.8897x + 332.1
65    8.6795
70    10.261
75    15.6225
80    24.764
85    37.6855
90    54.387
95    74.8685
100    99.13
  
60    9.689        y = 0.0005x3 - 0.0445x2 - 0.4308x + 87.737
65    9.035
70    11.031
75    16.052
80    24.473
85    36.669
90    53.015
95    73.886
100    99.657

There is a dip at the start 60-65 goes lower then up.
 
Excel also gives me y = 0.0756x2 - 9.8897x + 332.1 but for

Y X
60 9.5
65
9.9
70
11.5
75
16.5
80
24
85
37
90
54
95
75
100
100

It gives y = -0.0048x2 + 0.8821x + 58.139 for


X Y
9.5 60
9.9
65
11.5
70
16.5
75
24
80
37
85
54
90
75
95
100
100

Capture.JPG
 
Libreoffice.

4th order polynomial is a near perfect fit!

But Volo, just make sure that if you use any of these polynomial equations your X value will never go below 60! If it does, you won't like the results.

By the way, how are you using this, to drive a needle gauge? If that were the case, then you likely couldn't tell the difference between any of these curves and your original straight line anyway.

Bob
 
Hi Guys,
The x y parameters I gave you were not in fact P7 but were taken from the excel chart for table 1506. Reason being that the 1506 curve was similar and I wanted to try to understand from that how the equation works. The code right at the top of this thread is what I'm using at the moment for P7 values which gives me a straight line. Too high at the bottom and too low at the top.

The purpose of this exercise:banghead: first the EO's panel has P7 gauges so they should always display within the ball park so to speak. Second, the EO provides the pilots with a Max P7. This number "must" be achieved by the engines either on a full power take-off or a factored power take-off. Factored power is used when ISA conditions are above ISA+10 when the throttle is not moved to its maximum stop. If for example P7 is not reached at 93% throttle on a hot day (say 31c) then the throttle is moved to max. This has happened rarely in reality apparently. The danger of max throttle at 31c is n2 exceeding its limitations as the RR Conways have no FADEC control. There is though a fuel restrictor valve which kicks in at around 105%n2. Bear in mind that the limitations allow 105%n2 for no more than 20 seconds!!

So in effect what I'm working to achieve is two scales one for the gauge itself and one for the max. As straight lines go they work but as before too high at the bottom and too low at the top. So that's why I'm trying to construct a curve. Phew!!:confused:

I'll do a little more work on trying to understand the equations you've given. BTW how does one translate the equation into xml??
 
The 4th order poly from Heretic:

(L:X_Var, number) 4 pow 0.0000265 * (L:X_Var, number) 3 pow 0.008989 * + (L:X_Var, number) 2 pow 1.0522 * - (L:X_Var, number) 52.1529 * + 929.5855 - (>L:Y_Var, number)
 
I'm afraid my grey pea still doesn't quite understand the equation. Sorry!!
For example x=60 y=9.5
I've tried to get 9.5 by using the equation but instead get ridiculous answers. How does the equation translate to an excel formula.
=POWER(60,4)*-0.0166+POWER(60,3)*0.3941-POWER(60,2)*-1.2622+60*1.16605+8.7222 is clearly very wrong!!!
 
oops. the first parm, I missed the negative sign.

Try the following. The more decimal places used in the constants, the closer the fit:

(L:X_Var, number) 4 pow -0.0000265268 * (L:X_Var, number) 3 pow 0.0089889148 * + (L:X_Var, number) 2 pow 1.0521961927 - (L:X_Var, number) 52.1528606578 * + 929.5854700846 - (>L:Y_Var, number)

(You can see more decimal places in the formula by double clicking the formula in excel chart and changing the decimal places format)

For the X=60 value, an excel formula would look like:

=-0.0000265268*60^4+0.008988914*60^3-1.052196192*60^2+52.1528606578*60-929.5854700846
 
Last edited:
Thanks Bob,
I'll play with your suggestions. When I do the fourth polynomial trend line i get
y=-0.0166x^4+0.3941x^3-1.2622x^2+1.6605*x+8.722
Which is giving me a totally different answer. Thus leading to some confusion.
in excel that is =-0.0166*60^4+0.3941*60^3-1.2622*60^2+1.6605*60+8.7222
which gives a result of -134446 marginally different to 9.5 I would say. So it would appear (on the face of it) that my Excel gives a totally different answer. Quite why and how is mysterious.
poly.jpg
 
Last edited:
hmmm. This is what I'm working with:

upload_2015-7-28_16-58-54.png
 

Attachments

  • upload_2015-7-28_16-55-0.png
    upload_2015-7-28_16-55-0.png
    23.4 KB · Views: 388
I see that your Y axis is the same as your X axis. Whereas my Y axis relates to the actual values ( or at least to the number of actual inputs). How did you achieve that?
 
Last edited:
Back
Top