feat: polish & windviz & deploy
This commit is contained in:
parent
81b8e763bd
commit
465ad00f7b
78 changed files with 20622 additions and 2154 deletions
25
internal/numerics/atmosphere.go
Normal file
25
internal/numerics/atmosphere.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package numerics
|
||||
|
||||
import "math"
|
||||
|
||||
// NasaDensity returns air density in kg/m^3 at the given altitude in metres,
|
||||
// using the NASA piecewise standard-atmosphere model.
|
||||
// See https://www.grc.nasa.gov/WWW/K-12/airplane/atmosmet.html.
|
||||
//
|
||||
// The model is split into three altitude bands (troposphere, lower
|
||||
// stratosphere, upper stratosphere); density is pressure / (0.2869 * T_K).
|
||||
func NasaDensity(alt float64) float64 {
|
||||
var temp, pressure float64
|
||||
switch {
|
||||
case alt > 25000:
|
||||
temp = -131.21 + 0.00299*alt
|
||||
pressure = 2.488 * math.Pow((temp+273.1)/216.6, -11.388)
|
||||
case alt > 11000:
|
||||
temp = -56.46
|
||||
pressure = 22.65 * math.Exp(1.73-0.000157*alt)
|
||||
default:
|
||||
temp = 15.04 - 0.00649*alt
|
||||
pressure = 101.29 * math.Pow((temp+273.1)/288.08, 5.256)
|
||||
}
|
||||
return pressure / (0.2869 * (temp + 273.1))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue