Skip to content
Draft
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
53 changes: 53 additions & 0 deletions test/bench_simplify.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (c) 2024, 2025 Bart van de Lint, Uwe Fechner
# SPDX-License-Identifier: MIT

SIMPLE = false

using Timers
tic()
@info "Loading packages "
using SymbolicAWEModels, KiteUtils
toc()

# Simulation parameters
dt = 0.05
total_time = 10.0 # Longer simulation to see oscillations
vsm_interval = 3
steps = Int(round(total_time / dt))

# Steering parameters
steering_freq = 1/2 # Hz - full left-right cycle frequency
steering_magnitude = 10.0 # Magnitude of steering input [Nm]

# Initialize model
set = load_settings("system.yaml")
set.segments = 3
set_values = [-50, 0.0, 0.0] # Set values of the torques of the three winches. [Nm]
set.quasi_static = false
set.physical_model = SIMPLE ? "simple_ram" : "ram"

sam = SymbolicAWEModel(set)
sam.set.abs_tol = 1e-2
sam.set.rel_tol = 1e-2
rm("data/model_1.11_ram_dynamic_3_seg.bin"; force=true)

# Initialize at elevation
set.l_tethers[2] += 0.2
set.l_tethers[3] += 0.2
@time time_ = init!(sam; remake=false, reload=true) # bench=true
@info "Simplify took $time_ seconds"
sys = sam.prob.sys
nothing

## Results for SymbolicAWEModels.jl
# Laptop, AMD Ryzen 7 7840U, Julia 1.11:
# - first run 97.5 seconds

## Results for KiteModels.jl
# Desktop, AMD Ryzen 9 7950X, Julia 1.11:
# - first run 34.5 seconds
# - second run 21.1 seconds

# Laptop, AMD Ryzen 7 7840U, Julia 1.11:
# - first run 35.0 seconds
# - second run 24.0 seconds
Loading