FlightControl-Master / MOOSE

Mission Object Oriented Scripting Environment (MOOSE) for lua mission scripting design in DCS World
http://flightcontrol-master.github.io/MOOSE/
GNU General Public License v3.0
290 stars 94 forks source link

Function UTILS > KnotsToAltKIAS equation seems to be incorrect. #2070

Closed Negajoule closed 6 months ago

Negajoule commented 8 months ago

The equation for the UTILS function KnotsToAltKIAS appears to be incorrect. Currently the equation is: knots 0.018 (altitude / 1000)) + knots with "knots" being the desired GROUND SPEED at 0.0 MSL and "altitude" being the ALTITUDE at which the plane will fly

I believe the correct equation is: knots ( 1 - ((altitude 0.018) / 1000))

Based on calculation comparison with E6B flight computers.

If I am mistaken as to the use of this function please let me know. Thanks

funkyfranky commented 8 months ago

I think the naming of the function can be a bit misleading. The equation converts indicated airspeed (IAS) to true airspeed (TAS). It uses the approximation to add ~2% IAS for every 1000 ft altitude to convert IAS to TAS. See https://skybrary.aero/articles/true-airspeed

The equation that you quote is very similar but it subtracts 2%. But that would not give the correct TAS unless I am overlooking something?

Negajoule commented 8 months ago

I am misunderstanding the use of this function then. I thought it was for converting GROUND SPEED, as you would enter in the DCS Mission Editor, and get a KIAS at a specific altitude that the aircraft would fly at and you would see on the HUD or status bar. My assumption for this was with that Ground Speed being the most consistent way to plan and coordinate mission timings, a mission creator could step back and forth between the ME and MOOSE code and use the same number for consistency in planning.

For example: (given the atmosphere is set to ICAO standard 29.92 inHg and 15C at Mean Sea Level) A KC-135 tanker at 450 knots GROUND SPEED flying at 25,000ft will have a KIAS of approximately 295 knots thus fighters attempting to refuel will need to fly 295 KIAS to fuel

funkyfranky commented 8 months ago

Well, first thing that is important is the in the Mission Editor, the speed you set is true air speed (TAS). The DCS manual is incorrectly stating that it is ground speed (GS) but it is not! It is only GS if the wind in the mission is zero as GS=TAS+Wind.

And yes, the function is doing it the other way around. If you want the tanker to fly at 295 KIAS at 25,000 ft, it calculates the TAS you need to enter in the mission editor.

There is another function UTILS.TasToIas, which does it the way you want.

Negajoule commented 8 months ago

When planning a mission I set the "GS" checkbox on the aircraft for the speed so that I am working in ground speed. I find this makes rejoin and marshal times and speed calculations much easier with airframes traveling different distances. This is especially true with enroute tankers and their push times. What I was looking for was a function that converts the ground speed to the KIAS at altitude so I could set the ground speeds desired and it would compensate for the different altitudes of the of the airframes (F-16s and F-15 being 25,000ft and A-4s being at 15,000ft atc) Screenshot 2023-12-26 140236_MARKUP Screenshot 2023-12-26 140359_MARKUP