Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 61 additions & 9 deletions Manifest-v1.11.toml.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.11.6"
manifest_format = "2.0"
project_hash = "b7e6608cb08f613acdc2af9d43e0374bac40ce7c"
project_hash = "bcabd53e173057b92cf9d8a824da30ac71ed9341"

[[deps.ADTypes]]
git-tree-sha1 = "be7ae030256b8ef14a441726c4c37766b90b93a3"
Expand All @@ -15,6 +15,17 @@ weakdeps = ["ChainRulesCore", "ConstructionBase", "EnzymeCore"]
ADTypesConstructionBaseExt = "ConstructionBase"
ADTypesEnzymeCoreExt = "EnzymeCore"

[[deps.AbstractFFTs]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.5.0"
weakdeps = ["ChainRulesCore", "Test"]

[deps.AbstractFFTs.extensions]
AbstractFFTsChainRulesCoreExt = "ChainRulesCore"
AbstractFFTsTestExt = "Test"

[[deps.AbstractTrees]]
git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down Expand Up @@ -130,10 +141,10 @@ uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.11.0"

[[deps.AtmosphericModels]]
deps = ["HypergeometricFunctions", "KiteUtils"]
git-tree-sha1 = "f19e2f01bd53ae2b3bc007f2d0d075c760f3801d"
deps = ["FFTW", "HypergeometricFunctions", "KiteUtils", "LinearAlgebra", "MeshGrid", "NPZ", "Printf", "Random", "Statistics"]
git-tree-sha1 = "f3986a298be27278be4a904cbd7f668c9b7b76b3"
uuid = "c59cac55-771d-4f45-b14d-1c681463a295"
version = "0.2.5"
version = "0.3.0"

[[deps.AxisAlgorithms]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
Expand Down Expand Up @@ -633,6 +644,18 @@ git-tree-sha1 = "c13f0b150373771b0fdc1713c97860f8df12e6c2"
uuid = "55351af7-c7e9-48d6-89ff-24e801d99491"
version = "0.10.14"

[[deps.FFTW]]
deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"]
git-tree-sha1 = "797762812ed063b9b94f6cc7742bc8883bb5e69e"
uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
version = "1.9.0"

[[deps.FFTW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "6d6219a004b8cf1e0b4dbe27a2860b8e04eba0be"
uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a"
version = "3.3.11+0"

[[deps.FastBroadcast]]
deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"]
git-tree-sha1 = "ab1b34570bcdf272899062e1a56285a53ecaae08"
Expand Down Expand Up @@ -667,6 +690,18 @@ version = "1.1.3"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"

[[deps.FileIO]]
deps = ["Pkg", "Requires", "UUIDs"]
git-tree-sha1 = "b66970a70db13f45b7e57fbda1736e1cf72174ea"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.17.0"

[deps.FileIO.extensions]
HTTPExt = "HTTP"

[deps.FileIO.weakdeps]
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"

[[deps.FilePathsBase]]
deps = ["Compat", "Dates"]
git-tree-sha1 = "3bab2c5aa25e7840a4b065805c0cdfc01f3068d2"
Expand Down Expand Up @@ -1132,6 +1167,11 @@ git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.2"

[[deps.MeshGrid]]
git-tree-sha1 = "e5b4281c773148163188fb311476f4f1c9c81443"
uuid = "ebf956a0-ef5e-43be-9fb1-27952996e635"
version = "1.0.3"

[[deps.Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d"
Expand Down Expand Up @@ -1209,6 +1249,12 @@ git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1"
uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
version = "4.5.1"

[[deps.NPZ]]
deps = ["FileIO", "ZipFile"]
git-tree-sha1 = "60a8e272fe0c5079363b28b0953831e2dd7b7e6f"
uuid = "15e1cf62-19b3-5cfa-8e77-841668bca605"
version = "0.4.3"

[[deps.NaNMath]]
deps = ["OpenLibm_jll"]
git-tree-sha1 = "9b8215b1ee9e78a293f99797cd31375471b2bcae"
Expand Down Expand Up @@ -1409,10 +1455,10 @@ weakdeps = ["REPL"]
REPLExt = "REPL"

[[deps.PoissonRandom]]
deps = ["Random"]
git-tree-sha1 = "a0f1159c33f846aa77c3f30ebbc69795e5327152"
deps = ["LogExpFunctions", "Random"]
git-tree-sha1 = "bb178012780b34046c6d1600a315d8dbee89d83d"
uuid = "e409e4f3-bfea-5376-8464-e040bb5c01ab"
version = "0.4.4"
version = "0.4.5"

[[deps.Polyester]]
deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"]
Expand Down Expand Up @@ -1440,9 +1486,9 @@ version = "0.2.4"

[[deps.PreallocationTools]]
deps = ["Adapt", "ArrayInterface", "ForwardDiff"]
git-tree-sha1 = "6d98eace73d82e47f5b16c393de198836d9f790a"
git-tree-sha1 = "7a5e02659e293b25a4bfaeeb6cd268acd0742eba"
uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
version = "0.4.27"
version = "0.4.28"

[deps.PreallocationTools.extensions]
PreallocationToolsReverseDiffExt = "ReverseDiff"
Expand Down Expand Up @@ -2187,6 +2233,12 @@ git-tree-sha1 = "2f58ac39f64b41fb812340347525be3b590cce3b"
uuid = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"
version = "0.4.14"

[[deps.ZipFile]]
deps = ["Libdl", "Printf", "Zlib_jll"]
git-tree-sha1 = "f492b7fe1698e623024e873244f10d89c95c340a"
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
version = "0.10.1"

[[deps.Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ KiteModelsControlPlotsExt = "ControlPlots"
[compat]
ADTypes = "1.14.0"
Aqua = "0.8.11"
AtmosphericModels = "=0.2.5"
AtmosphericModels = "0.3"
BenchmarkTools = "1.6"
CodecXz = "0.7.4"
Colors = "0"
Expand Down
2 changes: 1 addition & 1 deletion data/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ environment:
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
alpha: 0.08163 # exponent of the wind profile law
z0: 0.0002 # surface roughness [m]
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG
# the following parameters are for calculating the turbulent wind field using the Mann model
use_turbulence: 0.0 # turbulence intensity relative to Cabauw, NL
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]
Expand Down
2 changes: 1 addition & 1 deletion data/settings_ram.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ environment:
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
alpha: 0.08163 # exponent of the wind profile law
z0: 0.0002 # surface roughness [m]
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=F
# the following parameters are for calculating the turbulent wind field using the Mann model
use_turbulence: 0.0 # turbulence intensity relative to Cabau, NL
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ environment:
rho_0: 1.225 # air density at zero height and 15 °C [kg/m³]
alpha: 0.08163 # exponent of the wind profile law
z0: 0.0002 # surface roughness [m]
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG, 4=FAST_EXP, 5=FAST_LOG, 6=FAST_EXPLOG
profile_law: 3 # 1=EXP, 2=LOG, 3=EXPLOG
# the following parameters are for calculating the turbulent wind field using the Mann model
use_turbulence: 0.0 # turbulence intensity relative to Cabauw, NL
v_wind_gnds: [3.483, 5.324, 8.163] # wind speeds at ref height for calculating the turbulent wind field [m/s]
Expand Down
2 changes: 1 addition & 1 deletion src/KPS3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $(TYPEDFIELDS)
"Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels"
kcu::KCU
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
am::AtmosphericModel = AtmosphericModel()
am::AtmosphericModel = AtmosphericModel(set)
"Reference to winch model as implemented in the package WinchModels"
wm::Union{AbstractWinchModel, Nothing} = nothing
"Integrator, storing the current state"
Expand Down
2 changes: 1 addition & 1 deletion src/KPS4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $(TYPEDFIELDS)
"Reference to the KCU model (Kite Control Unit as implemented in the package KitePodModels"
kcu::KCU
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
am::AtmosphericModel = AtmosphericModel()
am::AtmosphericModel = AtmosphericModel(set)
"Reference to winch model as implemented in the package WinchModels"
wm::AbstractWinchModel
"Integrator, storing the current state"
Expand Down
4 changes: 2 additions & 2 deletions src/symbolic_awe_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"Reference to the VSM aerodynamics solver"
vsm_solvers::Vector{VortexStepMethod.Solver}
sys_struct_hash::Vector{UInt8}
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
am::AtmosphericModel = AtmosphericModel()
"Simplified system of the mtk model"
sys::Union{ModelingToolkit.ODESystem, Nothing} = nothing
"Unsimplified system of the mtk model"
Expand Down Expand Up @@ -71,6 +69,8 @@ $(TYPEDFIELDS)
"Reference to the point mass system with points, segments, pulleys and tethers"
sys_struct::SystemStructure
serialized_model::SerializedModel
"Reference to the atmospheric model as implemented in the package AtmosphericModels"
am::AtmosphericModel = AtmosphericModel(set)
integrator::Union{OrdinaryDiffEqCore.ODEIntegrator, Nothing} = nothing
"relative start time of the current time interval"
t_0::SimFloat = 0.0
Expand Down
6 changes: 3 additions & 3 deletions test/bench4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ msg = String[]
kps4.set.alpha = 1.0/7.0
init_150()
kps4.set.elevation = 60.0
kps4.set.profile_law = Int(FAST_EXP)
kps4.set.profile_law = Int(EXP)
pos, vel = KiteModels.init_inner(kps4)
posd = copy(vel)
veld = zero(vel)
Expand All @@ -85,7 +85,7 @@ msg = String[]

# benchmark inner_loop!
pos, vel = KiteModels.init_inner(kps4)
t = @benchmark KiteModels.inner_loop!(kps4, pos, vel, v_wind_gnd, segments, d_tether) setup=(kps4.set.elevation = 60.0; kps4.set.profile_law = Int(FAST_EXP);
t = @benchmark KiteModels.inner_loop!(kps4, pos, vel, v_wind_gnd, segments, d_tether) setup=(kps4.set.elevation = 60.0; kps4.set.profile_law = Int(EXP);
kps4.set.alpha = 1.0/7.0; pos = $pos; vel=$vel;
v_wind_gnd = KVec3(7.0, 0.1, 0.0); kps4.stiffness_factor = 0.5; segments = kps4.set.segments; d_tether = kps4.set.d_tether/1000.0)
push!(msg, ("Mean time inner_loop!: $(round(mean(t.times), digits=1)) ns"))
Expand All @@ -95,7 +95,7 @@ msg = String[]
kps4.set.alpha = 1.0/7.0
init_150()
kps4.set.elevation = 60.0
kps4.set.profile_law = Int(FAST_EXP)
kps4.set.profile_law = Int(EXP)
for i in 1:se().segments + KiteModels.KITE_PARTICLES + 1
kps4.forces[i] .= zeros(3)
end
Expand Down
12 changes: 8 additions & 4 deletions test/test_kps4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ end
kps4.set.alpha = 1.0/7.0
init_150()
kps4.set.elevation = 60.0
kps4.set.profile_law = Int(EXP)
kps4.set.profile_law = Int(EXPLOG)
kps4.set.alpha = 0.08163
# kps4.set.profile_low = se().profile_law
for i in 1:set.segments + KiteModels.KITE_PARTICLES + 1
kps4.forces[i] .= zeros(3)
end
Expand Down Expand Up @@ -319,6 +321,8 @@ end
@testset "test_loop " begin
init2()
pos, vel, posd, veld = init2()
kps4.set.profile_law = Int(EXPLOG)
kps4.set.alpha = 0.08163
KiteModels.loop!(kps4, pos, vel, posd, veld)
res1=[[-0. 0.000001 -0. ]
[ 0. 0. 0. ]
Expand Down Expand Up @@ -451,7 +455,6 @@ end
@test all(res2_[i, :] .≈ res2[i])
end
end

end

@testset "test_getters" begin
Expand Down Expand Up @@ -513,11 +516,13 @@ function simulate(integrator, steps)
iter / steps
end

println("--> test_simulate")
@testset "test_simulate " begin
STEPS = 500
kps4.set.depower = 23.6
kps4.set.solver = "IDA"
kps4.set.profile_law = Int(EXPLOG)
kps4.set.alpha = 0.08163
# struct_diff(kps4.set, se())
integrator = KiteModels.init!(kps4; stiffness_factor=0.5, prn=false)
# println("\nStarting simulation...")
simulate(integrator, 100)
Expand All @@ -544,7 +549,6 @@ println("--> test_simulate")
update_sys_state!(sys_state, kps4)
# TODO Add testcase with varying reelout speed
end
println("<-- finished test_simulate")

@testset "Raptures" begin
kps4_ = KPS4(KCU(set))
Expand Down
Loading