diff --git a/Manifest.toml b/Manifest.toml index 5a18acdeb..f2ca88832 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,8 +1,8 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.10.5" +julia_version = "1.11.1" manifest_format = "2.0" -project_hash = "7746b44c64d80a6d3a63cce7f8b843c10cb95bf6" +project_hash = "0257f2772e4bfed0b6316b6871c4495978c173b4" [[deps.ADTypes]] git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081" @@ -61,7 +61,7 @@ version = "2.3.0" [[deps.ArgTools]] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" -version = "1.1.1" +version = "1.1.2" [[deps.ArnoldiMethod]] deps = ["LinearAlgebra", "Random", "StaticArrays"] @@ -123,9 +123,11 @@ version = "2.3.0" [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +version = "1.11.0" [[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +version = "1.11.0" [[deps.BasicModelInterface]] git-tree-sha1 = "0e2855d28cc3983a9edf4bee18478b020178a43f" @@ -152,9 +154,9 @@ version = "0.1.6" [[deps.Bzip2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd" +git-tree-sha1 = "8873e196c2eb87962a2048b3b8e08946535864a1" uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" -version = "1.0.8+1" +version = "1.0.8+2" [[deps.CPUSummary]] deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] @@ -204,9 +206,9 @@ version = "0.7.6" [[deps.CodecZstd]] deps = ["TranscodingStreams", "Zstd_jll"] -git-tree-sha1 = "5e41a52bec3b0881a7eb54f5391b779994504186" +git-tree-sha1 = "d0073f473757f0d39ac9707f1eb03b431573cbd8" uuid = "6b39b394-51ab-5f42-8807-6242bab2b4c2" -version = "0.8.5" +version = "0.8.6" [[deps.CommonSolve]] git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" @@ -345,9 +347,9 @@ version = "1.7.0" [[deps.DataInterpolations]] deps = ["FindFirstFunctions", "ForwardDiff", "LinearAlgebra", "PrettyTables", "RecipesBase", "Reexport"] -git-tree-sha1 = "1e1a04e3345dee5292b0b89d1f44dd202454e319" +git-tree-sha1 = "3d81cd1fcba530122a5d6c725aa53521d869816a" uuid = "82cc6244-b520-54b8-b5a6-8a565e85f1d0" -version = "6.4.1" +version = "6.5.2" [deps.DataInterpolations.extensions] DataInterpolationsChainRulesCoreExt = "ChainRulesCore" @@ -376,12 +378,13 @@ version = "1.0.0" [[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" +version = "1.11.0" [[deps.DiffEqBase]] -deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "Tricks", "TruncatedStacktraces"] -git-tree-sha1 = "ada2a9faba0e365dca3cc456b5eca94cf3887ac3" +deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "TruncatedStacktraces"] +git-tree-sha1 = "f8eefbb7e910f59087c4bb09ce670f235758ee4a" uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" -version = "6.156.1" +version = "6.158.3" [deps.DiffEqBase.extensions] DiffEqBaseCUDAExt = "CUDA" @@ -430,10 +433,10 @@ uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" version = "1.15.1" [[deps.DifferentiationInterface]] -deps = ["ADTypes", "Compat", "LinearAlgebra", "PackageExtensionCompat"] -git-tree-sha1 = "a1cba54a8fb4922d2920d89b0c0ee6b8a37984ec" +deps = ["ADTypes", "LinearAlgebra"] +git-tree-sha1 = "16611777adf4a818f18c33210895947814180964" uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" -version = "0.6.3" +version = "0.6.16" [deps.DifferentiationInterface.extensions] DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore" @@ -448,6 +451,7 @@ version = "0.6.3" DifferentiationInterfaceReverseDiffExt = "ReverseDiff" DifferentiationInterfaceSparseArraysExt = "SparseArrays" DifferentiationInterfaceSparseMatrixColoringsExt = "SparseMatrixColorings" + DifferentiationInterfaceStaticArraysExt = "StaticArrays" DifferentiationInterfaceSymbolicsExt = "Symbolics" DifferentiationInterfaceTrackerExt = "Tracker" DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"] @@ -465,6 +469,7 @@ version = "0.6.3" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" @@ -477,6 +482,7 @@ version = "0.1.6" [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" +version = "1.11.0" [[deps.DocStringExtensions]] deps = ["LibGit2"] @@ -536,14 +542,36 @@ git-tree-sha1 = "cbf5edddb61a43669710cbc2241bc08b36d9e660" uuid = "29a986be-02c6-4525-aec4-84b980013641" version = "2.0.4" +[[deps.FastPower]] +git-tree-sha1 = "46aee43f62bc2bc06a74e2d668ffeea0a2689c93" +uuid = "a4df4552-cc26-4903-aec0-212e50a0e84b" +version = "1.1.0" + + [deps.FastPower.extensions] + FastPowerEnzymeExt = "Enzyme" + FastPowerForwardDiffExt = "ForwardDiff" + FastPowerMeasurementsExt = "Measurements" + FastPowerMonteCarloMeasurementsExt = "MonteCarloMeasurements" + FastPowerReverseDiffExt = "ReverseDiff" + FastPowerTrackerExt = "Tracker" + + [deps.FastPower.weakdeps] + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + [[deps.FileIO]] deps = ["Pkg", "Requires", "UUIDs"] -git-tree-sha1 = "82d8afa92ecf4b52d78d869f038ebfb881267322" +git-tree-sha1 = "62ca0547a14c57e98154423419d8a342dca75ca9" uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -version = "1.16.3" +version = "1.16.4" [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" +version = "1.11.0" [[deps.FillArrays]] deps = ["LinearAlgebra"] @@ -567,19 +595,21 @@ uuid = "64ca27bc-2ba2-4a57-88aa-44e436879224" version = "1.4.1" [[deps.FiniteDiff]] -deps = ["ArrayInterface", "LinearAlgebra", "Setfield", "SparseArrays"] -git-tree-sha1 = "f9219347ebf700e77ca1d48ef84e4a82a6701882" +deps = ["ArrayInterface", "LinearAlgebra", "Setfield"] +git-tree-sha1 = "b10bdafd1647f57ace3885143936749d61638c3b" uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.24.0" +version = "2.26.0" [deps.FiniteDiff.extensions] FiniteDiffBandedMatricesExt = "BandedMatrices" FiniteDiffBlockBandedMatricesExt = "BlockBandedMatrices" + FiniteDiffSparseArraysExt = "SparseArrays" FiniteDiffStaticArraysExt = "StaticArrays" [deps.FiniteDiff.weakdeps] BandedMatrices = "aae01518-5342-5314-be14-df237901396f" BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [[deps.ForwardDiff]] @@ -612,6 +642,7 @@ version = "0.4.12" [[deps.Future]] deps = ["Random"] uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" +version = "1.11.0" [[deps.GPUArraysCore]] deps = ["Adapt"] @@ -632,9 +663,9 @@ version = "1.12.0" [[deps.HiGHS]] deps = ["HiGHS_jll", "MathOptInterface", "PrecompileTools", "SparseArrays"] -git-tree-sha1 = "3a7f13068f77fa54edd9589f762c600a22679bf7" +git-tree-sha1 = "555967d9fbcc5adec5362d6fc953dd11eb910250" uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b" -version = "1.9.3" +version = "1.10.0" [[deps.HiGHS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Zlib_jll"] @@ -695,6 +726,7 @@ version = "2024.2.1+0" [[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +version = "1.11.0" [[deps.InverseFunctions]] git-tree-sha1 = "a779299d77cd080bf77b97535acecd73e1c5e5cb" @@ -734,9 +766,9 @@ version = "0.4.53" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] -git-tree-sha1 = "f389674c99bfcde17dc57454011aa44d5a260a40" +git-tree-sha1 = "be3dc50a92e5a386872a493a10050136d4703f9b" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.6.0" +version = "1.6.1" [[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] @@ -746,9 +778,9 @@ version = "0.21.4" [[deps.JSON3]] deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" +git-tree-sha1 = "1d322381ef7b087548321d3f878cb4c9bd8f8f9b" uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.14.0" +version = "1.14.1" weakdeps = ["ArrowTypes"] [deps.JSON3.extensions] @@ -756,9 +788,9 @@ weakdeps = ["ArrowTypes"] [[deps.JuMP]] deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays"] -git-tree-sha1 = "c95f443d4641b128d626a429b51d5185050135b5" +git-tree-sha1 = "c91f872c6150cf1471f9cb279f5e0dc09423bdcf" uuid = "4076af6c-e467-56ae-b986-b466b2749572" -version = "1.23.2" +version = "1.23.3" [deps.JuMP.extensions] JuMPDimensionalDataExt = "DimensionalData" @@ -780,14 +812,14 @@ version = "0.6.0" [[deps.Krylov]] deps = ["LinearAlgebra", "Printf", "SparseArrays"] -git-tree-sha1 = "267dad6b4b7b5d529c76d40ff48d33f7e94cb834" +git-tree-sha1 = "71dd823bf0a5aaa8264e1143b96a0baa631f4ce0" uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" -version = "0.9.6" +version = "0.9.7" [[deps.LaTeXStrings]] -git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" +git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" -version = "1.3.1" +version = "1.4.0" [[deps.LayoutPointers]] deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] @@ -816,6 +848,7 @@ version = "2.2.1" [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" +version = "1.11.0" [[deps.LeftChildRightSiblingTrees]] deps = ["AbstractTrees"] @@ -841,16 +874,17 @@ version = "0.6.4" [[deps.LibCURL_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" -version = "8.4.0+0" +version = "8.6.0+0" [[deps.LibGit2]] deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" +version = "1.11.0" [[deps.LibGit2_jll]] deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" -version = "1.6.4+0" +version = "1.7.2+0" [[deps.LibSSH2_jll]] deps = ["Artifacts", "Libdl", "MbedTLS_jll"] @@ -859,6 +893,17 @@ version = "1.11.0+1" [[deps.Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +version = "1.11.0" + +[[deps.LineSearch]] +deps = ["ADTypes", "CommonSolve", "ConcreteStructs", "FastClosures", "LinearAlgebra", "MaybeInplace", "SciMLBase", "SciMLJacobianOperators", "StaticArraysCore"] +git-tree-sha1 = "97d502765cc5cf3a722120f50da03c2474efce04" +uuid = "87fe0de2-c867-4266-b59a-2f0a94fc965b" +version = "0.1.4" +weakdeps = ["LineSearches"] + + [deps.LineSearch.extensions] + LineSearchLineSearchesExt = "LineSearches" [[deps.LineSearches]] deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf"] @@ -869,12 +914,13 @@ version = "7.3.0" [[deps.LinearAlgebra]] deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +version = "1.11.0" [[deps.LinearSolve]] deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "8941ad4bdd83768359801982e143008349b1a827" +git-tree-sha1 = "ddb60aabc5efb0670c7ddde5fedf7ab44520a3e6" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "2.35.0" +version = "2.36.1" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -924,6 +970,7 @@ version = "0.3.28" [[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" +version = "1.11.0" [[deps.LoggingExtras]] deps = ["Dates", "Logging"] @@ -944,9 +991,9 @@ weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] [[deps.LoweredCodeUtils]] deps = ["JuliaInterpreter"] -git-tree-sha1 = "c2b5e92eaf5101404a58ce9c6083d595472361d6" +git-tree-sha1 = "260dc274c1bc2cb839e758588c63d9c8b5e639d1" uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b" -version = "3.0.2" +version = "3.0.5" [[deps.Lz4_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -979,6 +1026,7 @@ version = "0.1.8" [[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +version = "1.11.0" [[deps.MarkdownTables]] deps = ["ArgCheck", "DisplayAs", "DocStringExtensions", "Tables"] @@ -988,9 +1036,9 @@ version = "1.1.0" [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] -git-tree-sha1 = "5b246fca5420ae176d65ed43a2d0ee5897775216" +git-tree-sha1 = "c7fff4fbc415a6833988efbda7621039af2a5f36" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.31.2" +version = "1.32.0" [[deps.MaybeInplace]] deps = ["ArrayInterface", "LinearAlgebra", "MacroTools"] @@ -1011,7 +1059,7 @@ version = "1.1.9" [[deps.MbedTLS_jll]] deps = ["Artifacts", "Libdl"] uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" -version = "2.28.2+1" +version = "2.28.6+0" [[deps.MetaGraphsNext]] deps = ["Graphs", "JLD2", "SimpleTraits"] @@ -1027,6 +1075,7 @@ version = "1.2.0" [[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" +version = "1.11.0" [[deps.Mocking]] deps = ["Compat", "ExprTools"] @@ -1036,7 +1085,7 @@ version = "0.8.1" [[deps.MozillaCACerts_jll]] uuid = "14a3606d-f60d-562e-9121-12d972cd8159" -version = "2023.1.10" +version = "2023.12.12" [[deps.MuladdMacro]] git-tree-sha1 = "cac9cc5499c25554cba55cd3c30543cff5ca4fab" @@ -1045,9 +1094,9 @@ version = "0.2.4" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] -git-tree-sha1 = "3eba928678787843e504c153a9b8e80d7d73ab17" +git-tree-sha1 = "90077f1e79de8c9c7c8a90644494411111f4e07b" uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" -version = "1.5.0" +version = "1.5.2" [[deps.NLSolversBase]] deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] @@ -1066,10 +1115,10 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" [[deps.NonlinearSolve]] -deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] -git-tree-sha1 = "bcd8812e751326ff1d4b2dd50764b93df51f143b" +deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearch", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLJacobianOperators", "SciMLOperators", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] +git-tree-sha1 = "4d8944f32db2b07a2bdf8477e878bcb9c9ea2308" uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" -version = "3.14.0" +version = "3.15.1" [deps.NonlinearSolve.extensions] NonlinearSolveBandedMatricesExt = "BandedMatrices" @@ -1081,8 +1130,6 @@ version = "3.14.0" NonlinearSolveNLsolveExt = "NLsolve" NonlinearSolveSIAMFANLEquationsExt = "SIAMFANLEquations" NonlinearSolveSpeedMappingExt = "SpeedMapping" - NonlinearSolveSymbolicsExt = "Symbolics" - NonlinearSolveZygoteExt = "Zygote" [deps.NonlinearSolve.weakdeps] BandedMatrices = "aae01518-5342-5314-be14-df237901396f" @@ -1094,8 +1141,6 @@ version = "3.14.0" NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4" SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412" - Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" - Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" [[deps.OffsetArrays]] git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" @@ -1109,7 +1154,7 @@ weakdeps = ["Adapt"] [[deps.OpenBLAS_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.23+4" +version = "0.3.27+1" [[deps.OpenLibm_jll]] deps = ["Artifacts", "Libdl"] @@ -1134,10 +1179,10 @@ uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" version = "1.1.2" [[deps.OrdinaryDiffEqCore]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "TruncatedStacktraces"] -git-tree-sha1 = "5595eb94d0dd3cde2f5cf456394a1e0a61237e95" +deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "TruncatedStacktraces"] +git-tree-sha1 = "1175717a62ab21736a8f5d0d2531d2a6ad3b9e74" uuid = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" -version = "1.6.0" +version = "1.9.0" weakdeps = ["EnzymeCore"] [deps.OrdinaryDiffEqCore.extensions] @@ -1181,15 +1226,15 @@ version = "1.1.0" [[deps.OteraEngine]] deps = ["Markdown", "Pkg", "TOML"] -git-tree-sha1 = "f597212cd7e985f68db46f617aaf71b5f89eaa03" +git-tree-sha1 = "fd00935c531394ff30774cf8f7c89618597dd321" uuid = "b2d7f28f-acd6-4007-8b26-bc27716e5513" -version = "0.5.5" +version = "0.5.6" [[deps.PackageCompiler]] deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs", "p7zip_jll"] -git-tree-sha1 = "48d4429862157ad5500c4f61444db1b8c32e0a2b" +git-tree-sha1 = "f26a9bf5c7fb4bf00d9499f664742675d5e78d3a" uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" -version = "2.1.17" +version = "2.1.20" [[deps.PackageExtensionCompat]] git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518" @@ -1210,9 +1255,13 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "2.8.1" [[deps.Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.10.0" +version = "1.11.0" +weakdeps = ["REPL"] + + [deps.Pkg.extensions] + REPLExt = "REPL" [[deps.Polyester]] deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] @@ -1265,10 +1314,11 @@ version = "2.4.0" [[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +version = "1.11.0" [[deps.Profile]] -deps = ["Printf"] uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" +version = "1.11.0" [[deps.ProgressLogging]] deps = ["Logging", "SHA", "UUIDs"] @@ -1277,12 +1327,14 @@ uuid = "33c8b6b6-d38a-422a-b730-caa89a2f386c" version = "0.1.4" [[deps.REPL]] -deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +deps = ["InteractiveUtils", "Markdown", "Sockets", "StyledStrings", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" +version = "1.11.0" [[deps.Random]] deps = ["SHA"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +version = "1.11.0" [[deps.RecipesBase]] deps = ["PrecompileTools"] @@ -1341,12 +1393,12 @@ version = "1.3.0" [[deps.Revise]] deps = ["CodeTracking", "Distributed", "FileWatching", "JuliaInterpreter", "LibGit2", "LoweredCodeUtils", "OrderedCollections", "REPL", "Requires", "UUIDs", "Unicode"] -git-tree-sha1 = "0a20a01fbb3a9531f3325a94b6dcf95c404a1658" +git-tree-sha1 = "7f4228017b83c66bd6aa4fddeb170ce487e53bc7" uuid = "295af30f-e4ad-537b-8983-00126c2a3abe" -version = "3.6.0" +version = "3.6.2" [[deps.Ribasim]] -deps = ["Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqBase", "DiffEqCallbacks", "EnumX", "FiniteDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqTsit5", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "Statistics", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] +deps = ["Accessors", "Arrow", "BasicModelInterface", "CodecZstd", "ComponentArrays", "Configurations", "DBInterface", "DataInterpolations", "DataStructures", "Dates", "DiffEqBase", "DiffEqCallbacks", "EnumX", "FiniteDiff", "Graphs", "HiGHS", "IterTools", "JuMP", "Legolas", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "LoggingExtras", "MetaGraphsNext", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqTsit5", "PreallocationTools", "SQLite", "SciMLBase", "SparseArrays", "SparseConnectivityTracer", "StructArrays", "Tables", "TerminalLoggers", "TranscodingStreams"] path = "core" uuid = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" version = "2024.11.0" @@ -1392,10 +1444,10 @@ uuid = "76ed43ae-9a5d-5a62-8c75-30186b810ce8" version = "3.45.3+0" [[deps.SciMLBase]] -deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] -git-tree-sha1 = "885904799812ed88a607c03b38e9c3a4a5b08853" +deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] +git-tree-sha1 = "26fea1911818cd480400f1a2b7f6b32c3cc3836a" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.55.0" +version = "2.56.4" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -1416,11 +1468,17 @@ version = "2.55.0" RCall = "6f49c342-dc21-5d91-9882-a32aef131414" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" +[[deps.SciMLJacobianOperators]] +deps = ["ADTypes", "ConcreteStructs", "ConstructionBase", "DifferentiationInterface", "FastClosures", "LinearAlgebra", "SciMLBase", "SciMLOperators"] +git-tree-sha1 = "991d2a8900e687e2c693d587daa739c8fda01366" +uuid = "19f34311-ddf3-4b8b-af20-060888a46c0e" +version = "0.1.0" + [[deps.SciMLOperators]] deps = ["Accessors", "ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools"] -git-tree-sha1 = "e39c5f217f9aca640c8e27ab21acf557a3967db5" +git-tree-sha1 = "ef388ca9e4921ec5614ce714f8aa59a5cd33d867" uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" -version = "0.3.10" +version = "0.3.11" weakdeps = ["SparseArrays", "StaticArraysCore"] [deps.SciMLOperators.extensions] @@ -1447,6 +1505,7 @@ version = "1.4.5" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" +version = "1.11.0" [[deps.Setfield]] deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] @@ -1457,6 +1516,7 @@ version = "1.1.1" [[deps.SharedArrays]] deps = ["Distributed", "Mmap", "Random", "Serialization"] uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" +version = "1.11.0" [[deps.SimpleNonlinearSolve]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DiffResults", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "MaybeInplace", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"] @@ -1489,6 +1549,7 @@ version = "1.1.0" [[deps.Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" +version = "1.11.0" [[deps.SoftGlobalScope]] deps = ["REPL"] @@ -1505,13 +1566,13 @@ version = "1.2.1" [[deps.SparseArrays]] deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" -version = "1.10.0" +version = "1.11.0" [[deps.SparseConnectivityTracer]] -deps = ["ADTypes", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "Requires", "SparseArrays"] -git-tree-sha1 = "d60da13a3f752dd5f3cc7f25d03621b243c98614" +deps = ["ADTypes", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "6914df6005bab9940e2a96879a97a43e1fb1ce78" uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" -version = "0.6.5" +version = "0.6.8" [deps.SparseConnectivityTracer.extensions] SparseConnectivityTracerDataInterpolationsExt = "DataInterpolations" @@ -1528,10 +1589,10 @@ version = "0.6.5" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" [[deps.SparseDiffTools]] -deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "Tricks", "UnPack", "VertexSafeGraphs"] -git-tree-sha1 = "7db12cef226aaa8ca730040c9c35e32b86a69b83" +deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "UnPack", "VertexSafeGraphs"] +git-tree-sha1 = "b906758c107b049b6b71599b9f928d9b14e5554a" uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" -version = "2.22.0" +version = "2.23.0" [deps.SparseDiffTools.extensions] SparseDiffToolsEnzymeExt = "Enzyme" @@ -1547,6 +1608,18 @@ version = "2.22.0" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" +[[deps.SparseMatrixColorings]] +deps = ["ADTypes", "DataStructures", "DocStringExtensions", "LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "ccc32032d8f6790ad198c99fb8ef20d8100a0de4" +uuid = "0a514795-09f3-496d-8182-132a7b665d35" +version = "0.4.7" + + [deps.SparseMatrixColorings.extensions] + SparseMatrixColoringsColorsExt = "Colors" + + [deps.SparseMatrixColorings.weakdeps] + Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" + [[deps.Sparspak]] deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" @@ -1597,9 +1670,14 @@ uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" version = "1.4.3" [[deps.Statistics]] -deps = ["LinearAlgebra", "SparseArrays"] +deps = ["LinearAlgebra"] +git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0" uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -version = "1.10.0" +version = "1.11.1" +weakdeps = ["SparseArrays"] + + [deps.Statistics.extensions] + SparseArraysExt = ["SparseArrays"] [[deps.StrideArraysCore]] deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] @@ -1632,16 +1710,20 @@ git-tree-sha1 = "159331b30e94d7b11379037feeb9b690950cace8" uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" version = "1.11.0" +[[deps.StyledStrings]] +uuid = "f489334b-da3d-4c2e-b8f0-e476e12c162b" +version = "1.11.0" + [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" -version = "7.2.1+1" +version = "7.7.0+0" [[deps.SymbolicIndexingInterface]] deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] -git-tree-sha1 = "0225f7c62f5f78db35aae6abb2e5cabe38ce578f" +git-tree-sha1 = "4bc96df5d71515b1cb86dd626915f06f4c0d46f5" uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" -version = "0.3.31" +version = "0.3.33" [[deps.TOML]] deps = ["Dates"] @@ -1680,6 +1762,7 @@ version = "0.1.7" [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +version = "1.11.0" [[deps.TestEnv]] deps = ["Pkg"] @@ -1716,14 +1799,14 @@ weakdeps = ["RecipesBase"] [[deps.TimerOutputs]] deps = ["ExprTools", "Printf"] -git-tree-sha1 = "5a13ae8a41237cff5ecf34f73eb1b8f42fff6531" +git-tree-sha1 = "3a6f063d690135f5c1ba351412c82bae4d1402bf" uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" -version = "0.5.24" +version = "0.5.25" [[deps.TranscodingStreams]] -git-tree-sha1 = "e84b3a11b9bece70d14cce63406bbc79ed3464d2" +git-tree-sha1 = "0c45878dcfdcfa8480052b6ab162cdd138781742" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.11.2" +version = "0.11.3" [[deps.TriangularSolve]] deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] @@ -1731,11 +1814,6 @@ git-tree-sha1 = "be986ad9dac14888ba338c2554dcfec6939e1393" uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" version = "0.2.1" -[[deps.Tricks]] -git-tree-sha1 = "7822b97e99a1672bfb1b49b668a6d46d58d8cbcb" -uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" -version = "0.1.9" - [[deps.TruncatedStacktraces]] deps = ["InteractiveUtils", "MacroTools", "Preferences"] git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1" @@ -1745,6 +1823,7 @@ version = "1.4.0" [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" +version = "1.11.0" [[deps.UnPack]] git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" @@ -1753,6 +1832,7 @@ version = "1.0.2" [[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" +version = "1.11.0" [[deps.VectorizationBase]] deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] @@ -1785,9 +1865,9 @@ version = "1.3.0" [[deps.ZeroMQ_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "libsodium_jll"] -git-tree-sha1 = "42f97fb27394378591666ab0e9cee369e6d0e1f9" +git-tree-sha1 = "f02ce8f0fda1ed40f4d0d59a2ad05e35e8ac9b0e" uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568" -version = "4.3.5+0" +version = "4.3.5+1" [[deps.Zlib_jll]] deps = ["Libdl"] @@ -1814,7 +1894,7 @@ version = "1.0.20+1" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" -version = "1.52.0+1" +version = "1.59.0+0" [[deps.oneTBB_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] diff --git a/Project.toml b/Project.toml index ef7bcf793..4e594a1cf 100644 --- a/Project.toml +++ b/Project.toml @@ -62,3 +62,6 @@ TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed" TestEnv = "1e6cf692-eddd-4d53-88a5-2d735e33781b" TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a" TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" + +[sources] +Ribasim = {path = "core"} diff --git a/core/Project.toml b/core/Project.toml index c3a9fdf9a..e3f14810e 100644 --- a/core/Project.toml +++ b/core/Project.toml @@ -65,7 +65,7 @@ ComponentArrays = "0.13, 0.14, 0.15" Configurations = "0.17" DBInterface = "2.4" DataFrames = "1.4" -DataInterpolations = "6" +DataInterpolations = "6.5" DataStructures = "0.18" Dates = "1" DiffEqBase = "6.155" @@ -96,7 +96,7 @@ PreallocationTools = "0.4" SQLite = "1.5.1" SciMLBase = "2.36" SparseArrays = "1" -SparseConnectivityTracer = "0.6.3" +SparseConnectivityTracer = "0.6.8" StructArrays = "0.6.13" TOML = "1" Tables = "1" diff --git a/core/src/config.jl b/core/src/config.jl index afad780ed..1fc0012e2 100644 --- a/core/src/config.jl +++ b/core/src/config.jl @@ -134,6 +134,19 @@ end use_allocation::Bool = false end +@option struct Experimental <: TableOption + concentration::Bool = false +end +# For logging enabled experimental features +function Base.iterate(exp::Experimental, state = 0) + state >= nfields(exp) && return + return Base.getfield(exp, state + 1), state + 1 +end +function Base.show(io::IO, exp::Experimental) + fields = (field for field in fieldnames(typeof(exp)) if getfield(exp, field)) + print(io, join(fields, " ")) +end + @option @addnodetypes struct Toml <: TableOption starttime::DateTime endtime::DateTime @@ -145,6 +158,7 @@ end solver::Solver = Solver() logging::Logging = Logging() results::Results = Results() + experimental::Experimental = Experimental() end struct Config @@ -250,6 +264,18 @@ const algorithms = Dict{String, Type}( "Euler" => Euler, ) +""" +Check whether the given function has a method that accepts the given kwarg. +Note that it is possible that methods exist that accept :a and :b individually, +but not both. +""" +function function_accepts_kwarg(f, kwarg)::Bool + for method in methods(f) + kwarg in Base.kwarg_decl(method) && return true + end + return false +end + "Create an OrdinaryDiffEqAlgorithm from solver config" function algorithm(solver::Solver; u0 = [])::OrdinaryDiffEqAlgorithm algotype = get(algorithms, solver.algorithm, nothing) @@ -259,19 +285,22 @@ function algorithm(solver::Solver; u0 = [])::OrdinaryDiffEqAlgorithm Available options are: ($(options)).") end kwargs = Dict{Symbol, Any}() + if algotype <: OrdinaryDiffEqNewtonAdaptiveAlgorithm kwargs[:nlsolve] = NLNewton(; relax = Ribasim.MonitoredBackTracking(; z_tmp = copy(u0), dz_tmp = copy(u0)), ) end - # not all algorithms support this keyword - kwargs[:autodiff] = solver.autodiff - try - algotype(; kwargs...) - catch - pop!(kwargs, :autodiff) - algotype(; kwargs...) + + if function_accepts_kwarg(algotype, :step_limiter!) + kwargs[:step_limiter!] = Ribasim.limit_flow! end + + if function_accepts_kwarg(algotype, :autodiff) + kwargs[:autodiff] = solver.autodiff + end + + algotype(; kwargs...) end "Convert the saveat Float64 from our Config to SciML's saveat" diff --git a/core/src/main.jl b/core/src/main.jl index 0e613b8f1..95eb43764 100644 --- a/core/src/main.jl +++ b/core/src/main.jl @@ -40,6 +40,9 @@ function main(toml_path::AbstractString)::Cint @warn "The Ribasim version in the TOML config file does not match the used Ribasim CLI version." config.ribasim_version cli.ribasim_version end @info "Starting a Ribasim simulation." toml_path cli.ribasim_version starttime endtime + if any(config.experimental) + @warn "The following *experimental* features are enabled: $(config.experimental)" + end try model = run(config) diff --git a/core/src/parameter.jl b/core/src/parameter.jl index 8dcf03705..1f9a8f62d 100644 --- a/core/src/parameter.jl +++ b/core/src/parameter.jl @@ -104,6 +104,7 @@ const ScalarInterpolation = LinearInterpolation{ Vector{Float64}, Vector{Float64}, Float64, + (1,), } set_zero!(v) = v .= zero(eltype(v)) @@ -343,6 +344,7 @@ end Vector{Float64}, ScalarInterpolation, Float64, + (1,), }, } level_to_area::Vector{ScalarInterpolation} diff --git a/core/src/solve.jl b/core/src/solve.jl index 9c2555908..3863dc633 100644 --- a/core/src/solve.jl +++ b/core/src/solve.jl @@ -320,29 +320,14 @@ function formulate_flow!( )::Nothing (; allocation) = p all_nodes_active = p.all_nodes_active[] - for ( - id, - inflow_edge, - outflow_edge, - active, - demand_itp, - demand, - allocated, - return_factor, - min_level, - demand_from_timeseries, - ) in zip( + for (id, inflow_edge, outflow_edge, active, allocated, return_factor, min_level) in zip( user_demand.node_id, user_demand.inflow_edge, user_demand.outflow_edge, user_demand.active, - user_demand.demand_itp, - # TODO permute these so the nodes are the last dimension, for performance - eachrow(user_demand.demand), eachrow(user_demand.allocated), user_demand.return_factor, user_demand.min_level, - user_demand.demand_from_timeseries, ) if !(active || all_nodes_active) continue @@ -356,11 +341,7 @@ function formulate_flow!( # effectively allocated = demand. for priority_idx in eachindex(allocation.priorities) alloc_prio = allocated[priority_idx] - demand_prio = if demand_from_timeseries - demand_itp[priority_idx](t) - else - demand[priority_idx] - end + demand_prio = get_demand(user_demand, id, priority_idx, t) alloc = min(alloc_prio, demand_prio) q += alloc end @@ -718,3 +699,115 @@ function formulate_flows!( formulate_flow!(du, user_demand, p, t, current_storage, current_level) end end + +""" +Clamp the cumulative flow states within the minimum and maximum +flow rates for the last time step if these flow rate bounds are known. +""" +function limit_flow!( + u::ComponentVector, + integrator::DEIntegrator, + p::Parameters, + t::Number, +)::Nothing + (; uprev, dt) = integrator + (; + pump, + outlet, + linear_resistance, + user_demand, + tabulated_rating_curve, + basin, + allocation, + ) = p + + # TabulatedRatingCurve flow is in [0, ∞) and can be inactive + for (id, active) in zip(tabulated_rating_curve.node_id, tabulated_rating_curve.active) + limit_flow!( + u.tabulated_rating_curve, + uprev.tabulated_rating_curve, + id, + 0.0, + Inf, + active, + dt, + ) + end + + # Pump flow is in [min_flow_rate, max_flow_rate] and can be inactive + for (id, min_flow_rate, max_flow_rate, active) in + zip(pump.node_id, pump.min_flow_rate, pump.max_flow_rate, pump.active) + limit_flow!(u.pump, uprev.pump, id, min_flow_rate, max_flow_rate, active, dt) + end + + # Outlet flow is in [min_flow_rate, max_flow_rate] and can be inactive + for (id, min_flow_rate, max_flow_rate, active) in + zip(outlet.node_id, outlet.min_flow_rate, outlet.max_flow_rate, outlet.active) + limit_flow!(u.outlet, uprev.outlet, id, min_flow_rate, max_flow_rate, active, dt) + end + + # LinearResistance flow is in [-max_flow_rate, max_flow_rate] and can be inactive + for (id, max_flow_rate, active) in zip( + linear_resistance.node_id, + linear_resistance.max_flow_rate, + linear_resistance.active, + ) + limit_flow!( + u.linear_resistance, + uprev.linear_resistance, + id, + -max_flow_rate, + max_flow_rate, + active, + dt, + ) + end + + # UserDemand inflow is in [0, total_demand] and can be inactive + for (id, active) in zip(user_demand.node_id, user_demand.active) + total_demand = sum( + get_demand(user_demand, id, priority_idx, t) for + priority_idx in eachindex(allocation.priorities) + ) + limit_flow!( + u.user_demand_inflow, + uprev.user_demand_inflow, + id, + 0.0, + total_demand, + active, + dt, + ) + end + + # Evaporation is in [0, ∞) (a stricter upper bound would require also estimating the area) + # Infiltration is in [0, infiltration] + for (id, infiltration) in zip(basin.node_id, basin.vertical_flux.infiltration) + limit_flow!(u.evaporation, uprev.evaporation, id, 0.0, Inf, true, dt) + limit_flow!(u.infiltration, uprev.infiltration, id, 0.0, infiltration, true, dt) + end + + return nothing +end + +function limit_flow!( + u_component, + uprev_component, + id::NodeID, + min_flow_rate::Number, + max_flow_rate::Number, + active::Bool, + dt::Number, +)::Nothing + u_prev = uprev_component[id.idx] + if active + u_component[id.idx] = clamp( + u_component[id.idx], + u_prev + min_flow_rate * dt, + u_prev + max_flow_rate * dt, + ) + else + u_component[id.idx] = uprev_component[id.idx] + end + return nothing +end diff --git a/core/src/util.jl b/core/src/util.jl index f8f17c8c0..77127e99c 100644 --- a/core/src/util.jl +++ b/core/src/util.jl @@ -1134,3 +1134,12 @@ function isoutofdomain(u, p, t) formulate_storages!(current_storage, u, u, p, t) any(<(0), current_storage) end + +function get_demand(user_demand, id, priority_idx, t)::Float64 + (; demand_from_timeseries, demand_itp, demand) = user_demand + if demand_from_timeseries[id.idx] + demand_itp[id.idx][priority_idx](t) + else + demand[id.idx, priority_idx] + end +end diff --git a/core/src/write.jl b/core/src/write.jl index 87afce433..425c4beb9 100644 --- a/core/src/write.jl +++ b/core/src/write.jl @@ -5,7 +5,7 @@ Write all results to the Arrow files as specified in the model configuration. """ function write_results(model::Model)::Model (; config) = model - (; results) = model.config + (; results, experimental) = model.config compress = get_compressor(results) remove_empty_table = model.integrator.t != 0 @@ -25,9 +25,11 @@ function write_results(model::Model)::Model write_arrow(path, table, compress; remove_empty_table) # concentrations - table = concentration_table(model) - path = results_path(config, RESULTS_FILENAME.concentration) - write_arrow(path, table, compress; remove_empty_table) + if experimental.concentration + table = concentration_table(model) + path = results_path(config, RESULTS_FILENAME.concentration) + write_arrow(path, table, compress; remove_empty_table) + end # discrete control table = discrete_control_table(model) diff --git a/core/test/docs.toml b/core/test/docs.toml index 3b91105c6..ac155cebf 100644 --- a/core/test/docs.toml +++ b/core/test/docs.toml @@ -48,3 +48,7 @@ verbosity = "info" # optional, default "info", can otherwise be "debug", "warn" # These results files are always written compression = true # optional, default true, using zstd compression compression_level = 6 # optional, default 6 + +[experimental] +# Experimental features, disabled by default +concentration = false # tracer calculations diff --git a/core/test/run_models_test.jl b/core/test/run_models_test.jl index f033b9f29..bfc634ab1 100644 --- a/core/test/run_models_test.jl +++ b/core/test/run_models_test.jl @@ -184,6 +184,7 @@ end using Logging: Debug, with_logger using LoggingExtras using SciMLBase: successful_retcode + using OrdinaryDiffEqBDF: QNDF import Tables using Dates @@ -197,11 +198,17 @@ end end @test model isa Ribasim.Model - p = model.integrator.p + + (; integrator) = model + (; p, alg) = integrator + @test p isa Ribasim.Parameters @test isconcretetype(typeof(p)) @test all(isconcretetype, fieldtypes(typeof(p))) + @test alg isa QNDF + @test alg.step_limiter! == Ribasim.limit_flow! + @test successful_retcode(model) @test length(model.integrator.sol) == 2 # start and end @test model.integrator.p.basin.current_storage[Float64[]] ≈ @@ -242,7 +249,7 @@ end precipitation = model.integrator.p.basin.vertical_flux.precipitation @test length(precipitation) == 4 @test model.integrator.p.basin.current_storage[parent(du)] ≈ - Float32[720.23611, 694.8785, 415.22371, 1334.3859] atol = 2.0 skip = Sys.isapple() + Float32[721.17656, 695.8066, 416.66188, 1334.4879] atol = 2.0 skip = Sys.isapple() end @testitem "Allocation example model" begin diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 11645a750..0804b0490 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -32,6 +32,7 @@ website: - install.qmd - changelog.qmd - known_issues.qmd + - contact.qmd - title: "Tutorials" contents: diff --git a/docs/concept/core.qmd b/docs/concept/core.qmd index ebfc9d201..5dbf510b5 100644 --- a/docs/concept/core.qmd +++ b/docs/concept/core.qmd @@ -120,21 +120,29 @@ allocation_subNetwork->>user_demand: allocated user_demand->>basin: abstracted ``` -# Substance (tracer) concentration calculations +# Substance (tracer) concentrations + +::: {.callout-caution} +This is an unsupported experimental feature and is disabled by default. +We advise to use the [Delwaq coupling](@sec-waterquality) for tracer calculations. +If you're interested in using this experimental feature, please [contact us](/contact.qmd). +::: Ribasim can calculate concentrations of conservative tracers (i.e. substances that are non-reactive). It does so by calculating the mass transports by flows for each timestep, in the `update_cumulative_flows!` callback. -Specifically, for each Basin at each timestep we calculate: +Specifically, for each Basin at each timestep it calculates: -- all mass inflows (flow * source_concentration) given the edge inflows -- update the concentrations in the Basin based on the added storage (previous storage + inflows) -- all mass outflows (flow * basin_concentration_state) give the edge outflows +- all mass inflows ($flow * source\_concentration$) given the edge inflows +- update the concentrations in the Basin based on the added storage ($previous storage + inflows$) +- all mass outflows ($flow * basin\_concentration\_state$) give the edge outflows - update the concentrations in the Basin based on the current storage We thus keep track of both mass and concentration of substances for each Basin. Note that we have not added the substance mass to the states, and we assume that concentrations of flows are piecewise constant over a timestep. +This excludes the use of tracer injections. + +By default the following source tracers are enabled. -By default we calculate concentrations for the following source tracers. - Continuity (mass balance, fraction of all water sources, sum of all other source tracers) - Initial (fraction of initial storages) - LevelBoundary, FlowBoundary, UserDemand, Drainage, Precipitation (fraction of different boundaries) diff --git a/docs/guide/coupling.qmd b/docs/guide/coupling.qmd index 3e9d7a7d5..da2315b3e 100644 --- a/docs/guide/coupling.qmd +++ b/docs/guide/coupling.qmd @@ -6,7 +6,7 @@ title: "Coupling" Ribasim can also be (online) coupled to other kernels with the help of iMOD Coupler. The corresponding documentation can be found within the [iMOD Suite Documentation](https://deltares.github.io/iMOD-Documentation/coupler.html). -# Water quality +# Water quality {#sec-waterquality} Ribasim can be offline coupled to Delwaq, the Deltares Water Quality model. diff --git a/docs/reference/usage.qmd b/docs/reference/usage.qmd index 3a4d782ee..63eeedd99 100644 --- a/docs/reference/usage.qmd +++ b/docs/reference/usage.qmd @@ -80,6 +80,23 @@ entry | type | description ----------------- | ------ | ----------- verbosity | String | Verbosity level: debug, info, warn, or error. +## Experimental features + +::: {.callout-important} +Experimental features are completely unsupported. They can break at any time +and results will be wrong. **Do not use them in production**. If you're interested +in using an experimental feature, please [contact us](/contact.qmd). +::: + +One can enable experimental features in the `[experimental]` section. +Currently the following features can be enabled (all are disabled by default). + +entry | type | description +----------------- | ------ | ----------- +concentration | Bool | Whether to enable tracer calculations or not. + + + # GeoPackage database and Arrow tables {#sec-geopackage} The input and output tables described below all share that they are tabular files. The Node diff --git a/pixi.toml b/pixi.toml index b376b0d3b..4e1aed0f8 100644 --- a/pixi.toml +++ b/pixi.toml @@ -20,7 +20,7 @@ test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=r [feature.dev.tasks] # Installation -install-julia = "juliaup add 1.10.5 && juliaup override unset && juliaup override set 1.10.5" +install-julia = "juliaup add 1.11.1 && juliaup override unset && juliaup override set 1.11.1" install-pre-commit = "pre-commit install" # Note that this has a Windows specific override install-ci = { depends_on = ["install-julia", "update-registry-julia"] } diff --git a/python/ribasim/ribasim/config.py b/python/ribasim/ribasim/config.py index e426cf82f..78a59e85e 100644 --- a/python/ribasim/ribasim/config.py +++ b/python/ribasim/ribasim/config.py @@ -144,6 +144,19 @@ class Logging(ChildModel): verbosity: Verbosity = Verbosity.info +class Experimental(ChildModel): + """ + Defines experimental features. + + Attributes + ---------- + concentration : bool + Whether to enable tracer support (default is False) + """ + + concentration: bool = False + + class Node(pydantic.BaseModel): """ Defines a node for the model. diff --git a/python/ribasim/ribasim/model.py b/python/ribasim/ribasim/model.py index d5ab0a785..d7274a67c 100644 --- a/python/ribasim/ribasim/model.py +++ b/python/ribasim/ribasim/model.py @@ -26,6 +26,7 @@ Basin, ContinuousControl, DiscreteControl, + Experimental, FlowBoundary, FlowDemand, LevelBoundary, @@ -86,6 +87,8 @@ class Model(FileModel): allocation: Allocation = Field(default_factory=Allocation) + experimental: Experimental = Field(default_factory=Experimental) + basin: Basin = Field(default_factory=Basin) continuous_control: ContinuousControl = Field(default_factory=ContinuousControl) discrete_control: DiscreteControl = Field(default_factory=DiscreteControl)