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
2 changes: 1 addition & 1 deletion ext/KiteModelsControlPlotsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ function ControlPlots.plot(s::SymbolicAWEModel, reltime; kwargs...)
plot(s.system_structure, reltime; s.set.l_tether, wing_pos, e_z, kwargs...)
end

end
end
11 changes: 5 additions & 6 deletions src/KPS4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Output:
height = 0.5 * (pos[p1][3] + pos[p2][3])
rho = calc_rho(s.am, height)
# if height <= -1000.0
# println("Error: height: $height")
# println("Error: height: $height")
# end
@assert height > -1000
if height < 6
Expand Down Expand Up @@ -496,13 +496,12 @@ function residual!(res, yd, y::MVector{S, SimFloat}, s::KPS4, time) where S
if !isnothing(s.sync_speed) && s.sync_speed == 0.0
use_brake = true
end
# if !isnothing(s.sync_speed)
# res[end] = v_reel_outd - calc_acceleration(s.wm, v_reel_out, norm(s.forces[1]), s.sync_speed)
# else
if s.wm isa AsyncMachine
res[end] = v_reel_outd - calc_acceleration(s.wm, s.sync_speed, v_reel_out, norm(s.forces[1]), true)
else
res[end] = v_reel_outd - calc_acceleration(s.wm, v_reel_out, norm(s.forces[1]); set_speed=s.sync_speed,
set_torque=s.set_torque, use_brake)
# end

end
# copy and flatten result
for i in 2:div(T,6)+1
for j in 1:3
Expand Down
2 changes: 1 addition & 1 deletion src/KiteModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -760,4 +760,4 @@ end

include("precompile.jl")

end
end
11 changes: 6 additions & 5 deletions test/bench4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,16 @@ msg = String[]
t = @benchmark residual!($res, $yd0, $y0, $kps4, $time)
push!(msg, ("Mean time residual!: $(round(mean(t.times), digits=1)) ns"))
# println("t.memory: ", t.memory)
@test t.memory <= 176
@test t.memory <= 0

# time using Python/ Numba: 8.94 µs, time using Julia 1.7.2: 1.6µs, Julia 1.8.0: 1.244µs
# Julia 1.9 on Ryzen: 816.1 ns
# Julia 1.10 on Ryzen: 787.0 ns 6000 RAM
# Julia 1.10 on Laptop on battery: 1047 ns
# Julia 1.11 on Laptop on power: 1024..1090 ns
# Julia 1.11 on Laptop on battery: 1050..1197 ns
# Julia 1.11 on Desktop on main branch: 835..899 ns on June 15, 2025 after 14:12
# Julia 1.10 on Laptop on battery: 1047ns
# Julia 1.11 on Laptop on battery: 1035ns
# Julia 1.11 on Laptop on battery, branch perf2: 1042ns
# Julia 1.11 on Desktop, branch perf2: 835..899 ns on June 15, 2025 after 13:12

end
printstyled("Benchmark results for KPS4:\n"; bold = true)
for i in eachindex(msg)
Expand Down
Loading