diff --git a/test/bench_simplify.jl b/test/bench_simplify.jl new file mode 100644 index 00000000..155d3721 --- /dev/null +++ b/test/bench_simplify.jl @@ -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