mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-models.git
synced 2025-09-28 23:17:33 +00:00
Add USSA 1976 model
This commit is contained in:
58
include/sta/models/altitude.hpp
Normal file
58
include/sta/models/altitude.hpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef INC_MODELS_ALTITUDE_
|
||||
#define INC_MODELS_ALTITUDE_
|
||||
|
||||
#include <sta/math/probability/randomVariable.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace models {
|
||||
class BarometricFormula
|
||||
{
|
||||
/**
|
||||
* @brief Get the altitude from the pressure using the barometric formula. The model is valid for altitudes up to leat 9 km.
|
||||
*
|
||||
* @param p Pressure in hPa
|
||||
* @return Altitude in meters
|
||||
*/
|
||||
public:
|
||||
/*
|
||||
* @brief Constructor for the Barometric Formula
|
||||
* @param pRef Reference pressure in hPa
|
||||
* @param hRef Reference altitude in meters
|
||||
*/
|
||||
BarometricFormula(float pRef = 1013.25, float hRef = 0);
|
||||
|
||||
/*
|
||||
* @brief Get the altitude from the pressure using the barometric formula
|
||||
* @param p Pressure in hPa
|
||||
* @return Altitude in meters
|
||||
*/
|
||||
float getAltitude(float p);
|
||||
|
||||
private:
|
||||
float p0_;
|
||||
};
|
||||
|
||||
namespace USSA1976
|
||||
{
|
||||
/**
|
||||
* @brief Get the altitude from the pressure using the U.S. Standard Atmosphere 1976 model (https://ntrs.nasa.gov/search.jsp?R=19770009539)
|
||||
* and the barometric formula for multiple layers. The model is valid for altitudes up to at leat 71 km. See https://en.wikipedia.org/wiki/Barometric_formula for more information.
|
||||
*
|
||||
* @param p Pressure in hPa
|
||||
* @return Altitude in meters
|
||||
*/
|
||||
float getAltitude(float p);
|
||||
/**
|
||||
* @brief Get the altitude as Gaussian Random Variable from the pressure as Gaussian Random Variable using the U.S. Standard Atmosphere 1976 model (https://ntrs.nasa.gov/search.jsp?R=19770009539)
|
||||
* and the barometric formula for multiple layers. The model is valid for altitudes up to at leat 71 km. See https://en.wikipedia.org/wiki/Barometric_formula for more information.
|
||||
*
|
||||
* @param p Pressure in hPa as a Gaussian Random Variable
|
||||
* @return Altitude in meters as a Gaussian Random Variable
|
||||
*/
|
||||
sta::math::probability::grv getAltitude(sta::math::probability::grv p);
|
||||
} // namespace USSA1976
|
||||
} // namespace models
|
||||
} // namespace sta
|
||||
|
||||
#endif //INC_MODELS_ALTITUDE_
|
12
include/sta/models/constants.hpp
Normal file
12
include/sta/models/constants.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef STA_MODELS_CONSTANTS_HPP
|
||||
#define STA_MODELS_CONSTANTS_HPP
|
||||
|
||||
//Altitude Constants
|
||||
|
||||
#define STA_CONSTANT_R 8.3144598 //J/(mol*K)
|
||||
|
||||
#define STA_CONSTANT_G_0 9.80665 //m/s^2
|
||||
|
||||
#define STA_CONSTANT_M 0.028964425278793993 //kg/mol
|
||||
|
||||
#endif //STA_MODELS_CONSTANTS_HPP
|
Reference in New Issue
Block a user