Skip to content

Commit 1b69ccc

Browse files
committed
Update README.md and index.md
1 parent 4ee4314 commit 1b69ccc

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ using AtmosphericModels, ControlPlots, KiteUtils
100100
set_data_path("data")
101101
set = load_settings("system.yaml"; relax=true)
102102
am = AtmosphericModel(set)
103-
AtmosphericModels.se().alpha = 0.234 # set the exponent of the power law
104103

105104
heights = 6:200
106105
wf = [calc_wind_factor(am, height, Int(EXP)) for height in heights]
@@ -110,15 +109,17 @@ plot(heights, wf, xlabel="height [m]", ylabel="wind factor", fig="Onshore")
110109

111110
## Air density
112111
```julia
113-
using AtmosphericModels, BenchmarkTools, KiteUtils
114-
am = AtmosphericModel(se())
112+
using AtmosphericModels, BenchmarkTools, KiteUtils, ControlPlots
113+
set_data_path("data")
114+
set = load_settings("system.yaml"; relax=true)
115+
am = AtmosphericModel(set)
115116
@benchmark calc_rho(am, height) setup=(height=Float64((6.0+rand()*500.0)))
116117
```
117-
This gives 4.85 ns as result. Plot the air density:
118+
Using a Ryzen 7840U CPU, this gives 3.1 ns as result. Plot the air density:
118119
```julia
119120
heights = 6:1000
120121
rhos = [calc_rho(am, height) for height in heights]
121-
plot(heights, rhos, legend=false, xlabel="height [m]", ylabel="air density [kg/m³]")
122+
plot(heights, rhos, xlabel="height [m]", ylabel="air density [kg/m³]")
122123
```
123124
<p align="center"><img src="./docs/src/airdensity.png" width="500" /></p>
124125

docs/src/index.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ am::AtmosphericModel = AtmosphericModel(set)
7171

7272
@info "Ground wind speed: $(am.set.v_wind) m/s"
7373

74-
wf::WindField = WindField(am, am.set.v_wind)
7574
x, y, z = 20.0, 0.0, 200.0
7675
t = 0.0
77-
vx, vy, vz = get_wind(wf, am, x, y, z, t)
76+
vx, vy, vz = get_wind(am, x, y, z, t)
7877
@time get_wind(am, x, y, z, t)
7978
@info "Wind at x=$(x), y=$(y), z=$(z), t=$(t): v_x=$(vx), v_y=$(vy), v_z=$(vz)"
8079
@info "Wind speed: $(sqrt(vx^2 + vy^2 + vz^2)) m/s"
@@ -86,7 +85,10 @@ and `settings.yaml` exists. See below how to do that.
8685
### Plot a wind profile
8786
```julia
8887
using AtmosphericModels, KiteUtils, ControlPlots
89-
am = AtmosphericModel(se())
88+
set_data_path("data")
89+
set = load_settings("system.yaml"; relax=true)
90+
set.alpha = 0.08163
91+
am = AtmosphericModel(set)
9092

9193
heights = 6:1000
9294
wf = [calc_wind_factor(am, height, Int(EXPLOG)) for height in heights]
@@ -96,8 +98,9 @@ plot(heights, wf, xlabel="height [m]", ylabel="wind factor", fig="Nearshore")
9698
![Wind profile nearshore](nearshore.png)
9799
```julia
98100
using AtmosphericModels, ControlPlots, KiteUtils
99-
am = AtmosphericModel(se())
100-
AtmosphericModels.se().alpha = 0.234 # set the exponent of the power law
101+
set_data_path("data")
102+
set = load_settings("system.yaml"; relax=true)
103+
am = AtmosphericModel(set)
101104

102105
heights = 6:200
103106
wf = [calc_wind_factor(am, height, Int(EXP)) for height in heights]
@@ -107,15 +110,17 @@ plot(heights, wf, xlabel="height [m]", ylabel="wind factor", fig="Onshore")
107110

108111
### Air density
109112
```julia
110-
using AtmosphericModels, BenchmarkTools, KiteUtils
111-
am = AtmosphericModel(se())
113+
using AtmosphericModels, BenchmarkTools, KiteUtils, ControlPlots
114+
set_data_path("data")
115+
set = load_settings("system.yaml"; relax=true)
116+
am = AtmosphericModel(set)
112117
@benchmark calc_rho(am, height) setup=(height=Float64((6.0+rand()*500.0)))
113118
```
114-
This gives 4.85 ns as result. Plot the air density:
119+
Using a Ryzen 7840U CPU, this gives 3.1 ns as result. Plot the air density:
115120
```julia
116121
heights = 6:1000
117122
rhos = [calc_rho(am, height) for height in heights]
118-
plot(heights, rhos, legend=false, xlabel="height [m]", ylabel="air density [kg/m³]")
123+
plot(heights, rhos, xlabel="height [m]", ylabel="air density [kg/m³]")
119124
```
120125
![Airdensity](airdensity.png)
121126

0 commit comments

Comments
 (0)