You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
There is a discrepancy in the calculation of air density and atmospheric pressure when using the temperature deviation from standard atmosphere (atmosphere/delta-T) parameter, especially at altitudes above sea level. Notably, the atmospheric pressure value should remain constant for a fixed altitude regardless of temperature deviations, but JSBSim produces different pressure values.
What is the expected behavior?
The air density and atmospheric pressure values computed by JSBSim should closely align with standard reference values for the given temperature and altitude conditions, such as those provided by the Atmospheric Calculator.
What is the motivation / use case for changing the behavior?
Correct air density values are critical for accurate aerodynamic and flight dynamics simulations, especially for scenarios where temperature deviations from the standard atmosphere are involved.
code
importjsbsim# Global variables that must be modified to match your particular need# The aircraft name# Note - It should match the exact spelling of the model fileAIRCRAFT_NAME="737"# Path to JSBSim files, location of the folders "aircraft", "engines" and "systems"PATH_TO_JSBSIM_FILES="../.."# Avoid flooding the console with log messagesjsbsim.FGJSBBase().debug_lvl=0fdm=jsbsim.FGFDMExec(PATH_TO_JSBSIM_FILES)
# Load the aircraft model# Load the aircraft modelfdm.load_model(AIRCRAFT_NAME)
fdm['atmosphere/delta-T'] =0*1.8# dISA °C to dISA Rfdm['ic/h-sl-ft'] =0fdm.run_ic()
print(" STANDARD ATMOSPHERE \n",
f"Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.0f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: 15 °C \n",
"Density_ref: 0.0023772 slug/ft3 \n",
"Pressure_ref: 2116.20 psf \n")
fdm['atmosphere/delta-T'] =25*1.8# dISA °C to dISA Rfdm['ic/h-sl-ft'] =0fdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.0f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: 40 °C \n",
"Density_ref: 0.0021874 slug/ft3 \n",
"Pressure_ref: 2116.2 psf \n")
fdm['ic/h-sl-ft'] =10000fdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.4f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: 20.1975 °C \n",
"Density_ref: 0.0016061 slug/ft3 \n",
"Pressure_ref: 1455.60 psf \n")
fdm['ic/h-sl-ft'] =20000fdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.4f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: 0.4140 °C \n",
"Density_ref: 0.0011516 slug/ft3 \n",
"Pressure_ref: 973.27 psf \n")
fdm['ic/h-sl-ft'] =30000fdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.4f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: -19.3506 °C \n",
"Density_ref: 0.00080305 slug/ft3 \n",
"Pressure_ref: 629.67 psf \n")
fdm['ic/h-sl-ft'] =40000fdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.4f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: -31.5 °C \n",
"Density_ref: 0.00052659 slug/ft3 \n",
"Pressure_ref: 393.13 psf \n")
fdm['atmosphere/delta-T'] =35*1.8# dISA °C to dISA Rfdm.run_ic() # Initialize the aircraft with initial conditions print(f" Altitude: {fdm['position/h-sl-ft']:.0f} ft \n",
f"Temperature_JSBSIM: {(fdm['atmosphere/T-R']-491.67)*5/9:.4f} °C \n",
f"Density_JSBSIM: {fdm['atmosphere/rho-slugs_ft3']:.7f} slug/ft3 \n",
f"Pressure_JSBSIM: {fdm['atmosphere/P-psf']:.2f}\n",
"Temperature_ref: -21.5 °C \n",
"Density_ref: 0.00050566 slug/ft3 \n",
"Pressure_ref: 393.13 psf \n")
output
STANDARD ATMOSPHERE
Altitude: 0 ft
Temperature_JSBSIM: 15 °C
Density_JSBSIM: 0.0023769 slug/ft3
Pressure_JSBIM: 2116.23
Temperature_ref: 15 °C
Density_ref: 0.0023772 slug/ft3
Pressure_ref: 2116.20 psf
Altitude: 0 ft
Temperature_JSBSIM: 40 °C
Density_JSBSIM: 0.0021872 slug/ft3
Pressure_JSBSIM: 2116.23
Temperature_ref: 40 °C
Density_ref: 0.0021874 slug/ft3
Pressure_ref: 2116.2 psf
Altitude: 10000 ft
Temperature_JSBSIM: 20.1975 °C
Density_JSBSIM: 0.0016563 slug/ft3
Pressure_JSBSIM: 1501.25
Temperature_ref: 20.1975 °C
Density_ref: 0.0016061 slug/ft3
Pressure_ref: 1455.60 psf
Altitude: 20000 ft
Temperature_JSBSIM: 0.4140 °C
Density_JSBSIM: 0.0012305 slug/ft3
Pressure_JSBSIM: 1040.10
Temperature_ref: 0.4140 °C
Density_ref: 0.0011516 slug/ft3
Pressure_ref: 973.27 psf
Altitude: 30000 ft
Temperature_JSBSIM: -19.3506 °C
Density_JSBSIM: 0.0008943 slug/ft3
Pressure_JSBSIM: 701.29
Temperature_ref: -19.3506 °C
Density_ref: 0.00080305 slug/ft3
Pressure_ref: 629.67 psf
Altitude: 40000 ft
Temperature_JSBSIM: -31.5000 °C
Density_JSBSIM: 0.0006153 slug/ft3
Pressure_JSBSIM: 459.38
Temperature_ref: -31.5 °C
Density_ref: 0.00052659 slug/ft3
Pressure_ref: 393.13 psf
Altitude: 40000 ft
Temperature_JSBSIM: -21.5000 °C
Density_JSBSIM: 0.0006239 slug/ft3
Pressure_JSBSIM: 485.10
Temperature_ref: -21.5 °C
Density_ref: 0.00050566 slug/ft3
Pressure_ref: 393.13 psf
The text was updated successfully, but these errors were encountered:
I'm submitting a ...
Describe the issue
There is a discrepancy in the calculation of air density and atmospheric pressure when using the temperature deviation from standard atmosphere (atmosphere/delta-T) parameter, especially at altitudes above sea level. Notably, the atmospheric pressure value should remain constant for a fixed altitude regardless of temperature deviations, but JSBSim produces different pressure values.
What is the expected behavior?
The air density and atmospheric pressure values computed by JSBSim should closely align with standard reference values for the given temperature and altitude conditions, such as those provided by the Atmospheric Calculator.
What is the motivation / use case for changing the behavior?
Correct air density values are critical for accurate aerodynamic and flight dynamics simulations, especially for scenarios where temperature deviations from the standard atmosphere are involved.
code
output
The text was updated successfully, but these errors were encountered: