Giter VIP home page Giter VIP logo

atmosphericmodels.jl's Introduction

AtmosphericModels

Build Status Coverage

Installation

Install Julia 1.10 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.

Exported types

AtmosphericModel
@enum ProfileLaw EXP=1 LOG=2 EXPLOG=3 FAST_EXP=4 FAST_LOG=5 FAST_EXPLOG=6

Exported functions

clear(s::AM)
calc_rho(s::AM, height)
calc_wind_factor(am::AM, height, profile_law::Int64=am.set.profile_law)

Wind profile

The EXPLOG profile law is the fitted linear combination of the exponential and the log law.

Usage

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.

Plot a wind profile

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")

Benchmark

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 $1.5 \cdot 10^{-5}$ and are correct only for the default values of h_ref, z0 and alpha.

Air density

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³]")

Running the test scripts

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")

Further reading

These models are described in detail in Dynamic Model of a Pumping Kite Power System.

Licence

This project is licensed under the MIT License. Please see the below WAIVER in association with the license.

WAIVER

Technische Universiteit Delft hereby disclaims all copyright interest in the package “AtmosphericModels.jl” (models for airborne wind energy systems) written by the Author(s).

Prof.dr. H.G.C. (Henri) Werij, Dean of Aerospace Engineering

See also

atmosphericmodels.jl's People

Contributors

ufechner7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

oxinabox

atmosphericmodels.jl's Issues

Improve README.md

  • Add section Performance
  • Add examples that plot the provided functions
  • Add reference to the correct paper

Add turbulent 3d wind field

Translate and adapt the Python code WindField.py .

  • translate function pfq()
  • function calc_sigma1
  • nextpow2
  • calcFullName
  • save
  • load
  • loadWindField
  • createGrid
  • showGrid
  • show2Dfield
  • plotTurbulenceVsHeight
  • createWindField
  • addWindSpeed
  • load
  • getWind
  • plotWindVsTime
  • plotWindVsY
  • newWindField
  • newWindFields

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.