Download Julia 1.9 or later, if you haven't already. You can add AtmosphericModels from Julia's package manager, by typing
using Pkg
pkg"add AtmosphericModels"
at the Julia prompt.
AtmosphericModel
@enum ProfileLaw EXP=1 LOG=2 EXPLOG=3 FAST_EXP=4 FAST_LOG=5 FAST_EXPLOG=6
clear(s::AM)
calc_rho(s::AM, height)
calc_wind_factor(am::AM, height, profile_law::Int64=am.set.profile_law)
The EXPLOG profile law is the fitted linear combination of the exponential and the log law.
using AtmosphericModels
am = AtmosphericModel()
const profile_law = Int(EXPLOG)
height = 100.0
wf = calc_wind_factor(am, height, profile_law)
The result is the factor with which the ground wind speed needs to be multiplied to get the wind speed at the given height.
using AtmosphericModels, Plots
am = AtmosphericModel()
heights = 6:1000
wf = [calc_wind_factor(am, height, Int(EXPLOG)) for height in heights]
plot(heights, wf, legend=false, xlabel="height [m]", ylabel="wind factor")
using AtmosphericModels, ControlPlots
am = AtmosphericModel()
AtmosphericModels.se().alpha = 0.234 # set the exponent of the power law
heights = 6:200
wf = [calc_wind_factor(am, height, Int(EXP)) for height in heights]
plot(heights, wf, xlabel="height [m]", ylabel="wind factor")
using AtmosphericModels, BenchmarkTools
am = AtmosphericModel()
@benchmark calc_wind_factor(am, height, Int(EXPLOG)) setup=(height=Float64((6.0+rand()*500.0)))
Profile law | time [ns] |
---|---|
EXP | 12 |
LOG | 16 |
EXPLOG | 33 |
FAST_EXP | 6.6 |
FAST_LOG | 6.6 |
FAST_EXPLOG | 6.6 |
The FAST versions are an approximations with an error of less than
using AtmosphericModels, BenchmarkTools
am = AtmosphericModel()
@benchmark calc_rho(am, height) setup=(height=Float64((6.0+rand()*500.0)))
This gives 4.85 ns as result. Plot the air density:
heights = 6:1000
rhos = [calc_rho(am, height) for height in heights]
plot(heights, rhos, legend=false, xlabel="height [m]", ylabel="air density [kg/m³]")
First, add TestEnv to your global environment.
julia
using Pkg
Pkg.add("TestEnv")
exit()
Then you can run Julia using this project and run the tests:
julia --project
using TestEnv
TestEnv.activate()
include("test/bench.jl")
include("calc_approximations.jl")
include("runtests.jl")
These models are described in detail in Dynamic Model of a Pumping Kite Power System.
- Research Fechner
- The application KiteViewer
- the package KiteUtils
- the packages KiteModels and WinchModels and KitePodModels
- the packages KiteControllers and KiteViewers