MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
Peau
Posts: 44
Hi !
I want to calculate density altitude and using this formula ; Density altitude = Pressure altitude + [120 x (OAT – ISA Temp)].
In MF transform ; $*3+120*(#-?), where
$ = Pressure altitude,
#= Placeholder-OAT,
?= Placeholder-ISA temp where I use pressure altitude as reference, interpolation;500=15,1000=14, 1500=13 aso,
120 is a constant and
$*3 means I have pressure altitude in feet.
The interpolated ISA-temp-placeholder doesen't work. If I replaces "?" with "15" it works. What's wrong ?

Cheers, Peter
2022-02-09 11:25
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Thats a known Bug! ( Or better its a feature on a other spot that ocure in trouble on that point)

A Interpolation result internal not in a Integer..... It is like a String !
You can see this in the "Output Collumn" of your Config, where you calculate the ISA Temp.
For example for 1000 feet your Config not show as expected "14" .... It show instead "14 (1000)"
(Means it remain as "text" the original Value within brackets)

If we use THIS Value within a Formula by set it to a placeholder, the formula crash with a syntax error.....
Cause technical your formula now is .....

$*3+120*(#- 14(1000) ) And thats mathematical nonsense!

****************

Solution:

You can wait.... Maybe we solve this "bug" in one of the next releases.
OR
Much more profitable.... Change the Config and caluclate the ISA without a Interpolation. Use a tranform instead !
If i understand right.... ISA is 15 -(Press Alt/1000*2)
For example current Alt = 8000ft .... 15-(8000/1000*2) --> 15-(8*2) --->15-16 = -1

Or maybe much more easy.... 15-Alt/500
15-8000/500 ---> 15-16=-1

Right ?

Then you have a "real Value" instead of the interpolation String !
[Last edited by pizman82, 2022-02-09 13:13]
Good Luck !
2022-02-09 13:07
Avatar
Peau
Posts: 44
Thanks for the tip/workaround
My ISA-temp ("?") transformed ; 16-($*3/500).
Works perfect.

Cheers, Peter
2022-02-09 14:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Nice....

Just some details.....

Stephan and myself checkt this out for personal interest.

The Factor ( source Wikipedia) is NOT 16 ..... it´s 15 !
So in your case the Temp is wrong by 1 degree ( so Altitude is wrong by 120 ft at all time)

Additional the $*3 is not correct. Altitude Meters in feet is 3,28084

So ... Your Calcualtion is working.... But not accurate !

***************
By the way.... Do you use FS2020 ?
If Yes.... there you can read the Values in the needed Units directly.... AND as i know there is a Variable for the ISA without need of own calculations !
Good Luck !
2022-02-09 15:18
Avatar
Peau
Posts: 44
You are right. Replaced those values and replaced even 120 to 118.6. Hopefully reading more precise now. I am on MSFS 2020 but did not find an ISA var or similar. Searched the net and of course on MF hubhop.

Cheers, Peter
2022-02-10 09:53
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Try out the follow AVars...

STANDARD ATM TEMPERATURE Outside temperature on the standard ATM scale

Maybe this is also interesting....
AMBIENT DENSITY Ambient density
SEA LEVEL PRESSURE Barometric pressure at sea level

And always remember... You can easy change the unit within the code....

e.g.

(A:BAROMETER PRESSURE,Millibars)
Can be chaged to ....
(A:BAROMETER PRESSURE,Pascal)
(A:BAROMETER PRESSURE,inHg)
(A:BAROMETER PRESSURE,bar)
and so on.... No recalculation by yourself is needed anymore !



https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Simulation_Variable_Units.htm
Good Luck !
2022-02-10 17:40
Avatar
Peau
Posts: 44
New knowledge to me. Nice to know and shall use/test.
Thank you, Peter
2022-02-11 08:23
icon