Open dbookstaber opened 10 months ago
The cIcaoFreezingPointTemperatureR
is wrong: °R = °F + 459.67. Freezing point in °F = 32, so freezing point in °R = 491.67. However, making this correction breaks test_computer.py::test_temp_atmo
. Actually it looks like the variable is just misnamed: It appears that everywhere in the code it is used to convert units between Rankine and Fahrenheit.
References for validation of the remaining logic:
C_d (drag coefficient) is a function of Mach number. Drag force is a function of air density * C_d.
drag = density_factor * velocity * self.drag_by_mach(velocity / mach)
where
density_factor, mach = atmo.get_density_factor_and_mach_for_altitude(alt0 + range_vector.y)
and
density_factor = density / cStandardDensity
Atmo.get_density_factor_and_mach_for_altitude()
returns incorrect density. The adjusted pressure equation there is just wrong.
References to validate:
Others:
Python package: https://unidata.github.io/MetPy/latest/api/generated/metpy.calc.density.html#metpy.calc.density
During testing (the old
test_danger_space
unittest), with an absurdly dense atmosphere (1000 hPa) that led to a trajectory drop through 4000ft, thet
inconditions.py::get_density_factor_and_mach_for_altitude()
went negative. As best I can tell this is a temperature, so this shouldn't be possible no matter how extreme the variables. This function is probably supposed to do calculations in Kelvin, but it appears to be doing them in whatever Temperature units were set. So we need some test cases here.Specific values found in this test case:
t
= -.008055_p0
= 1000_t0
= 15cP
= -5.255876ta
= 57.82tb
= 72.8altitude
= -3878x
= 1038y
= -4208