diff --git a/Manifest-v1.11.toml.default b/Manifest-v1.11.toml.default index a8077902..0adef93d 100644 --- a/Manifest-v1.11.toml.default +++ b/Manifest-v1.11.toml.default @@ -2,7 +2,7 @@ julia_version = "1.11.5" manifest_format = "2.0" -project_hash = "f9f7424be55e7c582f860e66512280fdde05365c" +project_hash = "68e47961fc0a02ad352b159a56f527bb8f6669a3" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -187,11 +187,6 @@ weakdeps = ["ChainRulesCore", "ForwardDiff"] BracketingNonlinearSolveChainRulesCoreExt = ["ChainRulesCore", "ForwardDiff"] BracketingNonlinearSolveForwardDiffExt = "ForwardDiff" -[[deps.CEnum]] -git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc" -uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" -version = "0.5.0" - [[deps.CPUSummary]] deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec" @@ -613,9 +608,9 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.5" [[deps.EnzymeCore]] -git-tree-sha1 = "7d7822a643c33bbff4eab9c87ca8459d7c688db0" +git-tree-sha1 = "8272a687bca7b5c601c0c24fc0c71bff10aafdfd" uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.8.11" +version = "0.8.12" weakdeps = ["Adapt"] [deps.EnzymeCore.extensions] @@ -790,9 +785,9 @@ uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" version = "0.1.5" [[deps.InlineStrings]] -git-tree-sha1 = "6a9fde685a7ac1eb3495f8e812c5a7c3711c2d5e" +git-tree-sha1 = "8594fac023c5ce1ef78260f24d1ad18b4327b420" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" -version = "1.4.3" +version = "1.4.4" weakdeps = ["ArrowTypes", "Parsers"] [deps.InlineStrings.extensions] @@ -1906,18 +1901,6 @@ deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" version = "7.7.0+0" -[[deps.Sundials]] -deps = ["CEnum", "DataStructures", "DiffEqBase", "Libdl", "LinearAlgebra", "Logging", "PrecompileTools", "Reexport", "SciMLBase", "SparseArrays", "Sundials_jll"] -git-tree-sha1 = "7c7a7ee705724b3c80d5451ac49779db36c6f758" -uuid = "c3572dad-4567-51f8-b174-8c6c989267f4" -version = "4.28.0" - -[[deps.Sundials_jll]] -deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "SuiteSparse_jll", "libblastrampoline_jll"] -git-tree-sha1 = "91db7ed92c66f81435fe880947171f1212936b14" -uuid = "fb77eaff-e24c-56d4-86b1-d163f2edb164" -version = "5.2.3+0" - [[deps.SymbolicIndexingInterface]] deps = ["Accessors", "ArrayInterface", "PrettyTables", "RuntimeGeneratedFunctions", "StaticArraysCore"] git-tree-sha1 = "b6a641e38efa01355aa721246dd246e10c7dcd4d" diff --git a/Project.toml b/Project.toml index d98f3d9d..be97c375 100644 --- a/Project.toml +++ b/Project.toml @@ -35,7 +35,6 @@ Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" -Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" Timers = "21f18d07-b854-4dab-86f0-c15a3821819a" @@ -90,7 +89,6 @@ Serialization = "1.10, 1.11" StaticArrays = "1.9.7" Statistics = "1" StatsBase = "0.34" -Sundials = "4.24" SymbolicIndexingInterface = "0.3" SymbolicUtils = "3.25" Test = "1" @@ -104,6 +102,7 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" ControlPlots = "23c2ee80-7a9e-4350-b264-8e670f12517c" +ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" @@ -111,7 +110,6 @@ LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e" [targets] test = ["Test", "BenchmarkTools", "PackageCompiler", "Documenter", "ControlPlots", "Colors", "LaTeXStrings", "StatsBase", "JLD2", "Aqua", "DSP", "ControlSystemsBase"] diff --git a/examples_3d/Project.toml b/examples_3d/Project.toml index cd6e1c9b..b0aa4321 100644 --- a/examples_3d/Project.toml +++ b/examples_3d/Project.toml @@ -24,7 +24,6 @@ Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" -Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" Timers = "21f18d07-b854-4dab-86f0-c15a3821819a" WinchModels = "7dcfa46b-7979-4771-bbf4-0aee0da42e1f" @@ -51,7 +50,6 @@ Reexport = "1.1, 1.2" Rotations = "1.3" StaticArrays = "1.9" SteadyStateDiffEq = "2.3.0" -Sundials = "4.24" SymbolicIndexingInterface = "0.3.27" Timers = "0.1.5" WinchModels = "0.3.3" diff --git a/mwes/mwe_03.jl b/mwes/mwe_03.jl index c72d7888..950790e9 100644 --- a/mwes/mwe_03.jl +++ b/mwes/mwe_03.jl @@ -6,7 +6,7 @@ using Pkg if ! ("ControlPlots" ∈ keys(Pkg.project().dependencies)) using TestEnv; TestEnv.activate() end -using Sundials, ControlPlots +using ControlPlots const G_EARTH = [0.0, 0.0, -9.81] # gravitational acceleration const dt = 0.05 @@ -34,7 +34,7 @@ function solve(integrator, dt, t_final) time=Float64[] for t in 0:0.05:t_final push!(time, t) - Sundials.step!(integrator, dt, true) + step!(integrator, dt, true) push!(pos_z, integrator.u[3]) push!(vel_z, integrator.u[6]) end @@ -56,7 +56,7 @@ abstol = 0.0006 # max error in m/s and m s = nothing prob = DAEProblem(res!, yd0, y0, tspan, s, differential_vars=differential_vars) -integrator = Sundials.init(prob, solver, abstol, reltol=0.001) +integrator = init(prob, solver, abstol, reltol=0.001) @time time_, pos_z, vel_z = solve(integrator, dt, t_final) diff --git a/mwes/mwe_04.jl b/mwes/mwe_04.jl index c8d57e61..c45c8ed5 100644 --- a/mwes/mwe_04.jl +++ b/mwes/mwe_04.jl @@ -6,7 +6,7 @@ using Pkg if ! ("ControlPlots" ∈ keys(Pkg.project().dependencies)) using TestEnv; TestEnv.activate() end -using Sundials, ControlPlots +using ControlPlots const G_EARTH = [0.0, 0.0, -9.81] # gravitational acceleration const dt = 0.05 @@ -35,7 +35,7 @@ end function solve!(res, integrator, dt, t_final) for (i,t) in pairs(0:dt:t_final) res.time[i] = t - Sundials.step!(integrator, dt, true) + step!(integrator, dt, true) res.pos_z[i] = integrator.u[3] res.vel_z[i] = integrator.u[6] end @@ -56,7 +56,7 @@ function init() s = nothing prob = DAEProblem(res!, yd0, y0, tspan, s, differential_vars=differential_vars) - integrator = Sundials.init(prob, solver, abstol, reltol=0.001, save_everystep=false) + integrator = init(prob, solver, abstol, reltol=0.001, save_everystep=false) end function plot(res::Result) diff --git a/mwes/mwe_05.jl b/mwes/mwe_05.jl index c71c4379..e6116171 100644 --- a/mwes/mwe_05.jl +++ b/mwes/mwe_05.jl @@ -6,7 +6,7 @@ using Pkg if ! ("ControlPlots" ∈ keys(Pkg.project().dependencies)) using TestEnv; TestEnv.activate() end -using Sundials, ControlPlots +using ControlPlots const G_EARTH = [0.0, 0.0, -9.81] # gravitational acceleration const dt = 0.05 diff --git a/mwes/mwe_07.jl b/mwes/mwe_07.jl index 22b1a894..03c3cfd9 100644 --- a/mwes/mwe_07.jl +++ b/mwes/mwe_07.jl @@ -6,7 +6,7 @@ using Pkg if ! ("ControlPlots" ∈ keys(Pkg.project().dependencies)) using TestEnv; TestEnv.activate() end -using ControlPlots, OrdinaryDiffEq, Sundials #, DASKR +using ControlPlots, OrdinaryDiffEq #, DASKR const G_EARTH = [0.0, 0.0, -9.81] # gravitational acceleration const dt = 0.05 diff --git a/mwes/mwe_08.jl b/mwes/mwe_08.jl index b3d5ee5b..cbb037d8 100644 --- a/mwes/mwe_08.jl +++ b/mwes/mwe_08.jl @@ -6,7 +6,7 @@ using Pkg if ! ("ControlPlots" ∈ keys(Pkg.project().dependencies)) using TestEnv; TestEnv.activate() end -using ControlPlots, OrdinaryDiffEq, Sundials +using ControlPlots, OrdinaryDiffEq const G_EARTH = [0.0, 0.0, -9.81] # gravitational acceleration const dt = 0.05 diff --git a/mwes/mwe_09.jl b/mwes/mwe_09.jl index 153ddafe..402b19bc 100644 --- a/mwes/mwe_09.jl +++ b/mwes/mwe_09.jl @@ -9,7 +9,7 @@ end if ! ("OrdinaryDiffEq" ∈ keys(Pkg.project().dependencies)) Pkg.add("OrdinaryDiffEq") end -using OrdinaryDiffEq, ControlPlots, Sundials, StaticArrays +using OrdinaryDiffEq, ControlPlots, StaticArrays STATIC_ARRAYS::Bool = false if STATIC_ARRAYS diff --git a/src/KiteModels.jl b/src/KiteModels.jl index f55922d3..c21afaf2 100644 --- a/src/KiteModels.jl +++ b/src/KiteModels.jl @@ -16,7 +16,6 @@ using PrecompileTools: @setup_workload, @compile_workload using Dierckx, Interpolations, Serialization, StaticArrays, LinearAlgebra, Statistics, Parameters, NLsolve, DocStringExtensions, OrdinaryDiffEqCore, OrdinaryDiffEqBDF, OrdinaryDiffEqNonlinearSolve, NonlinearSolve -import Sundials using Reexport, Pkg using VortexStepMethod @reexport using VortexStepMethod: RamAirWing, BodyAerodynamics, Solver, NONLIN @@ -580,9 +579,7 @@ function init_sim!(s::AKM; stiffness_factor=0.5, delta=0.0001, upwind_dir=-pi/2, y0 = Vector{SimFloat}(y0) yd0 = Vector{SimFloat}(yd0) - if s.set.solver=="IDA" - solver = Sundials.IDA(linear_solver=Symbol(s.set.linear_solver), max_order = s.set.max_order) - elseif s.set.solver=="DImplicitEuler" + if s.set.solver=="DImplicitEuler" solver = DImplicitEuler(autodiff=AutoFiniteDiff()) elseif s.set.solver=="DFBDF" solver = DFBDF(autodiff=AutoFiniteDiff(), max_order=Val{s.set.max_order}()) @@ -646,11 +643,7 @@ function next_step!(s::AKM, integrator; set_speed = nothing, set_torque=nothing, s.t_0 = integrator.t set_v_wind_ground!(s, calc_height(s), v_wind_gnd; upwind_dir) s.iter = 0 - if s.set.solver == "IDA" - Sundials.step!(integrator, dt, true) - else - OrdinaryDiffEqCore.step!(integrator, dt, true) - end + OrdinaryDiffEqCore.step!(integrator, dt, true) if s.stiffness_factor < 1.0 s.stiffness_factor+=0.01 if s.stiffness_factor > 1.0 diff --git a/test/create_sys_image.jl b/test/create_sys_image.jl index 0b47f76b..ba1e01b5 100644 --- a/test/create_sys_image.jl +++ b/test/create_sys_image.jl @@ -8,7 +8,7 @@ if ! ("PackageCompiler" ∈ keys(Pkg.project().dependencies)) Pkg.update() end @info "Loading packages ..." -using Dierckx, StaticArrays, LinearAlgebra, Parameters, NLsolve, DocStringExtensions, Sundials, KiteUtils, +using Dierckx, StaticArrays, LinearAlgebra, Parameters, NLsolve, DocStringExtensions, KiteUtils, KitePodModels, AtmosphericModels, OrdinaryDiffEqCore, OrdinaryDiffEqBDF, ModelingToolkit, DSP, JLD2, Colors, REPL, VortexStepMethod, NonlinearSolve, OrdinaryDiffEqNonlinearSolve, StatsBase, DiscretePIDs, WinchModels, ControlSystemsBase @@ -18,7 +18,7 @@ using PackageCompiler, BenchmarkTools, Documenter push!(LOAD_PATH,joinpath(pwd(),"src")) PackageCompiler.create_sysimage( - [:Dierckx, :StaticArrays, :Parameters, :NLsolve, :DocStringExtensions, :Sundials, :KiteUtils, + [:Dierckx, :StaticArrays, :Parameters, :NLsolve, :DocStringExtensions, :KiteUtils, :KitePodModels, :AtmosphericModels, :OrdinaryDiffEqCore, :OrdinaryDiffEqBDF, :WinchModels, :OrdinaryDiffEqNonlinearSolve, :StatsBase, :PackageCompiler, :BenchmarkTools, :Documenter, :ModelingToolkit, :JLD2, :Colors, :REPL, :VortexStepMethod, :NonlinearSolve, :DSP, :DiscretePIDs, diff --git a/test/test_sundials.jl b/test/test_sundials.jl deleted file mode 100644 index 25306fb5..00000000 --- a/test/test_sundials.jl +++ /dev/null @@ -1,34 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Uwe Fechner -# SPDX-License-Identifier: MIT - -# unittest for Sundials.jl, works fine with 4.11.4 and older -# also requires v6.115.4 of DiffEqBase or older -using StaticArrays, Sundials, Test - -const KVec3 = MVector{3, Float64} - -Base.@kwdef mutable struct KPS4{S, T, P} - v_apparent::T = zeros(S, 3) -end - -const kps4 = KPS4{Float64, KVec3, 6+4+1}() - -function residual!(res, yd, y::MVector{S, Float64}, s::KPS4, time) where S -end - -function init_sim!(t_end=1.0) - y0 = MVector{62, Float64}([13.970413450119487, 0.0, 21.238692070636343, 27.65581376097752, 0.0, 42.66213714321849, 40.976226230518435, 0.0, 64.314401166278, 53.87184032029182, 0.0, 86.22231803750196, 66.28915240374937, 0.0, 108.4048292516046, 78.17713830204762, 0.0, 130.87545423106485, 79.56930502428155, 0.0, 135.70836376062155, 80.90383289255747, 0.0, 137.7696816741141, 80.60126812407692, 2.4016533873456325, 135.3023287520457, 80.60126812407692, -2.4016533873456325, 135.3023287520457, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 150.0, 0.0]) - yd0= MVector{62, Float64}([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0, -9.81, 0.0, 0.0]) - differential_vars = ones(Bool, length(y0)) - solver = IDA(linear_solver=Symbol("GMRES"), max_order = 4) - tspan = (0.0, t_end) - abstol = 0.0006 # max error in m/s and m - prob = DAEProblem(residual!, yd0, y0, tspan, kps4, differential_vars=differential_vars) - integrator = Sundials.init(prob, solver, abstol=abstol, reltol=0.001) -end - -@testset "test_simulate " begin - STEPS = 500 - integrator = init_sim!() -end -nothing