From 3ecc2b4e39bc4b9ebc7f44426a2113d81343aa65 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Fri, 22 Nov 2024 03:28:30 +0000 Subject: [PATCH 01/16] CompatHelper: add new compat entry for PartialFunctions at version 1 for package downstream, (keep existing compat) --- test/downstream/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/Project.toml b/test/downstream/Project.toml index 5740bc9a7..701614642 100644 --- a/test/downstream/Project.toml +++ b/test/downstream/Project.toml @@ -38,6 +38,7 @@ ModelingToolkitStandardLibrary = "2.7" NonlinearSolve = "2, 3, 4" Optimization = "4" OrdinaryDiffEq = "6.33" +PartialFunctions = "1" Plots = "1.40" RecursiveArrayTools = "3" SciMLBase = "2" From 4dcfc8835c16f56ebcc4d8da9d8beb8476611066 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Fri, 22 Nov 2024 03:28:34 +0000 Subject: [PATCH 02/16] CompatHelper: add new compat entry for OptimizationMOI at version 0.5 for package downstream, (keep existing compat) --- test/downstream/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/Project.toml b/test/downstream/Project.toml index 5740bc9a7..c3a0b0a31 100644 --- a/test/downstream/Project.toml +++ b/test/downstream/Project.toml @@ -37,6 +37,7 @@ ModelingToolkit = "9.52" ModelingToolkitStandardLibrary = "2.7" NonlinearSolve = "2, 3, 4" Optimization = "4" +OptimizationMOI = "0.5" OrdinaryDiffEq = "6.33" Plots = "1.40" RecursiveArrayTools = "3" From b0b00af9c76a983a9f0df68c0dfa2016ac691674 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Fri, 22 Nov 2024 03:28:37 +0000 Subject: [PATCH 03/16] CompatHelper: add new compat entry for OptimizationOptimJL at version 0.4 for package downstream, (keep existing compat) --- test/downstream/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/Project.toml b/test/downstream/Project.toml index 5740bc9a7..ebf0dda85 100644 --- a/test/downstream/Project.toml +++ b/test/downstream/Project.toml @@ -37,6 +37,7 @@ ModelingToolkit = "9.52" ModelingToolkitStandardLibrary = "2.7" NonlinearSolve = "2, 3, 4" Optimization = "4" +OptimizationOptimJL = "0.4" OrdinaryDiffEq = "6.33" Plots = "1.40" RecursiveArrayTools = "3" From 651f143803b86409d0b7660f1146a9f0f91dbae5 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Fri, 22 Nov 2024 03:28:41 +0000 Subject: [PATCH 04/16] CompatHelper: add new compat entry for Tables at version 1 for package downstream, (keep existing compat) --- test/downstream/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/Project.toml b/test/downstream/Project.toml index 5740bc9a7..de734a2d2 100644 --- a/test/downstream/Project.toml +++ b/test/downstream/Project.toml @@ -49,5 +49,6 @@ StochasticDiffEq = "6" Sundials = "4.11" SymbolicIndexingInterface = "0.3" SymbolicUtils = "<1.6, 2, 3" +Tables = "1" Unitful = "1.12" Zygote = "0.6" From e07a2340be101828df0ace41ccc3da75af60d03a Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 22 Nov 2024 12:37:49 +0530 Subject: [PATCH 05/16] refactor: change `remake_initialization_data` --- src/remake.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/remake.jl b/src/remake.jl index 750413a1f..42f9c82d0 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -126,7 +126,7 @@ function remake(prob::ODEProblem; f = missing, if f === missing if build_initializeprob initialization_data = remake_initialization_data( - prob.f.sys, prob.f, u0, tspan[1], p) + prob.f.sys, prob.f, u0, tspan[1], p, newu0, newp) else initialization_data = nothing end @@ -203,16 +203,17 @@ function remake_initializeprob(sys, scimlfn, u0, t0, p) end """ - remake_initialization_data(sys, scimlfn, u0, t0, p) + remake_initialization_data(sys, scimlfn, u0, t0, p, newu0, newp) Re-create the initialization data present in the function `scimlfn`, using the -associated system `sys` and the user provided new values of `u0`, initial time `t0` and -`p`. By default, this calls `remake_initializeprob` for backward compatibility and -attempts to construct an `OverrideInitData` from the result. +associated system `sys`, the user provided new values of `u0`, initial time `t0`, +user-provided `p`, new u0 vector `newu0` and new parameter object `newp`. By default, +this calls `remake_initializeprob` for backward compatibility and attempts to construct +an `OverrideInitData` from the result. Note that `u0` or `p` may be `missing` if the user does not provide a value for them. """ -function remake_initialization_data(sys, scimlfn, u0, t0, p) +function remake_initialization_data(sys, scimlfn, u0, t0, p, newu0, newp) return reconstruct_initialization_data( nothing, remake_initializeprob(sys, scimlfn, u0, t0, p)...) end From 9c09207429647a51a3293ea09072d0e4ed8cd74b Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 22 Nov 2024 12:41:48 +0530 Subject: [PATCH 06/16] refactor: add backward compat wrapper --- src/remake.jl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/remake.jl b/src/remake.jl index 42f9c82d0..280957671 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -125,7 +125,7 @@ function remake(prob::ODEProblem; f = missing, if f === missing if build_initializeprob - initialization_data = remake_initialization_data( + initialization_data = remake_initialization_data_compat_wrapper( prob.f.sys, prob.f, u0, tspan[1], p, newu0, newp) else initialization_data = nothing @@ -202,6 +202,21 @@ function remake_initializeprob(sys, scimlfn, u0, t0, p) scimlfn.update_initializeprob!, scimlfn.initializeprobmap, scimlfn.initializeprobpmap end +""" + $(TYPEDSIGNATURES) + +Wrapper around `remake_initialization_data` for backward compatibility when `newu0` and +`newp` were not arguments. +""" +function remake_initialization_data_compat_wrapper(sys, scimlfn, u0, t0, p, newu0, newp) + if hasmethod(remake_initialization_data, + Tuple{typeof(sys), typeof(scimlfn), typeof(u0), typeof(t0), typeof(p)}) + remake_initialization_data(sys, scimlfn, u0, t0, p) + else + remake_initialization_data(sys, scimlfn, u0, t0, p, newu0, newp) + end +end + """ remake_initialization_data(sys, scimlfn, u0, t0, p, newu0, newp) From 4e196168a50fbe88c2d95fbea4b9ba1ab418b0e3 Mon Sep 17 00:00:00 2001 From: vyudu Date: Fri, 22 Nov 2024 13:51:36 -0500 Subject: [PATCH 07/16] change to ArrayInterface --- src/scimlfunctions.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index aeddf301b..4d0442ecd 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -4095,15 +4095,15 @@ function BVPFunction{iip, specialize, twopoint}(f, bc; end if jac_prototype !== nothing && colorvec === nothing && - ArrayInterfaceCore.fast_matrix_colors(jac_prototype) - _colorvec = ArrayInterfaceCore.matrix_colors(jac_prototype) + ArrayInterface.fast_matrix_colors(jac_prototype) + _colorvec = ArrayInterface.matrix_colors(jac_prototype) else _colorvec = colorvec end if bcjac_prototype !== nothing && bccolorvec === nothing && - ArrayInterfaceCore.fast_matrix_colors(bcjac_prototype) - _bccolorvec = ArrayInterfaceCore.matrix_colors(bcjac_prototype) + ArrayInterface.fast_matrix_colors(bcjac_prototype) + _bccolorvec = ArrayInterface.matrix_colors(bcjac_prototype) else _bccolorvec = bccolorvec end @@ -4268,15 +4268,15 @@ function DynamicalBVPFunction{iip, specialize, twopoint}(f, bc; end if jac_prototype !== nothing && colorvec === nothing && - ArrayInterfaceCore.fast_matrix_colors(jac_prototype) - _colorvec = ArrayInterfaceCore.matrix_colors(jac_prototype) + ArrayInterface.fast_matrix_colors(jac_prototype) + _colorvec = ArrayInterface.matrix_colors(jac_prototype) else _colorvec = colorvec end if bcjac_prototype !== nothing && bccolorvec === nothing && - ArrayInterfaceCore.fast_matrix_colors(bcjac_prototype) - _bccolorvec = ArrayInterfaceCore.matrix_colors(bcjac_prototype) + ArrayInterface.fast_matrix_colors(bcjac_prototype) + _bccolorvec = ArrayInterface.matrix_colors(bcjac_prototype) else _bccolorvec = bccolorvec end From 4d44effe899dcbd8a3ac97e245afb7796e9a4604 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 25 Nov 2024 12:50:52 +0530 Subject: [PATCH 08/16] test: do not mark test as broken --- test/downstream/adjoints.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/downstream/adjoints.jl b/test/downstream/adjoints.jl index 327172ef7..4e75e19b6 100644 --- a/test/downstream/adjoints.jl +++ b/test/downstream/adjoints.jl @@ -68,7 +68,7 @@ gs_ts, = Zygote.gradient(sol) do sol sum(sum.(sol[[lorenz1.x, lorenz2.x], :])) end -@test_broken all(map(x -> x == true_grad_vecsym, gs_ts)) +@test all(map(x -> x == true_grad_vecsym, gs_ts)) # BatchedInterface AD @variables x(t)=1.0 y(t)=1.0 z(t)=1.0 w(t)=1.0 From 069ffd2aaca7341e3bbfc26918a2a87f727ea546 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Mon, 25 Nov 2024 23:42:52 +0530 Subject: [PATCH 09/16] feat: implement SII for `SCCNonlinearProblem` --- src/problems/nonlinear_problems.jl | 61 ++++++++++++++++- src/problems/problem_utils.jl | 2 +- test/downstream/problem_interface.jl | 97 ++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+), 3 deletions(-) diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index 58241f289..43c6e5f9c 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -462,7 +462,64 @@ Note that this example aliases the parameters together for a memory-reduced repr * `probs`: the collection of problems to solve * `explictfuns!`: the explicit functions for mutating the parameter set """ -mutable struct SCCNonlinearProblem{P, E} +mutable struct SCCNonlinearProblem{uType, iip, P, E, I, Par} <: + AbstractNonlinearProblem{uType, iip} probs::P - explictfuns!::E + explicitfuns!::E + full_index_provider::I + parameter_object::Par + parameters_alias::Bool + + function SCCNonlinearProblem{P, E, I, Par}( + probs::P, funs::E, indp::I, pobj::Par, alias::Bool) where {P, E, I, Par} + u0 = mapreduce(state_values, vcat, probs) + uType = typeof(u0) + new{uType, false, P, E, I, Par}(probs, funs, indp, pobj, alias) + end +end + +function SCCNonlinearProblem(probs, explicitfuns!, full_index_provider = nothing, + parameter_object = nothing, parameters_alias = false) + return SCCNonlinearProblem{typeof(probs), typeof(explicitfuns!), + typeof(full_index_provider), typeof(parameter_object)}( + probs, explicitfuns!, full_index_provider, parameter_object, parameters_alias) +end + +function Base.getproperty(prob::SCCNonlinearProblem, name::Symbol) + if name == :explictfuns! + return getfield(prob, :explicitfuns!) + elseif name == :ps + return ParameterIndexingProxy(prob) + end + return getfield(prob, name) +end + +function SymbolicIndexingInterface.symbolic_container(prob::SCCNonlinearProblem) + prob.full_index_provider +end +function SymbolicIndexingInterface.parameter_values(prob::SCCNonlinearProblem) + prob.parameter_object +end +function SymbolicIndexingInterface.state_values(prob::SCCNonlinearProblem) + mapreduce(state_values, vcat, prob.probs) +end + +function SymbolicIndexingInterface.set_state!(prob::SCCNonlinearProblem, val, idx) + for scc in prob.probs + svals = state_values(scc) + checkbounds(Bool, svals, idx) && return set_state!(scc, val, idx) + idx -= length(svals) + end + throw(BoundsError(state_values(prob), idx)) +end + +function SymbolicIndexingInterface.set_parameter!(prob::SCCNonlinearProblem, val, idx) + if prob.parameter_object !== nothing + set_parameter!(prob.parameter_object, val, idx) + prob.parameters_alias && return + end + for scc in prob.probs + is_parameter(scc, idx) || continue + set_parameter!(scc, val, idx) + end end diff --git a/src/problems/problem_utils.jl b/src/problems/problem_utils.jl index 15462e8b1..3c10f5fdf 100644 --- a/src/problems/problem_utils.jl +++ b/src/problems/problem_utils.jl @@ -60,7 +60,7 @@ function Base.show(io::IO, mime::MIME"text/plain", A::AbstractNonlinearProblem) summary(io, A) println(io) print(io, "u0: ") - show(io, mime, A.u0) + show(io, mime, state_values(A)) end function Base.show(io::IO, mime::MIME"text/plain", A::IntervalNonlinearProblem) diff --git a/test/downstream/problem_interface.jl b/test/downstream/problem_interface.jl index c5dee2938..7e68b127b 100644 --- a/test/downstream/problem_interface.jl +++ b/test/downstream/problem_interface.jl @@ -292,3 +292,100 @@ prob = SteadyStateProblem(osys, u0, ps) getsym(prob, [:X, :X2])(prob) == [0.1, 0.2] @test getsym(prob, (X, X2))(prob) == getsym(prob, (osys.X, osys.X2))(prob) == getsym(prob, (:X, :X2))(prob) == (0.1, 0.2) + +@testset "SCCNonlinearProblem" begin + # TODO: Rewrite this example when the MTK codegen is merged + + function fullf!(du, u, p) + du[1] = cos(u[2]) - u[1] + du[2] = sin(u[1] + u[2]) + u[2] + du[3] = 2u[4] + u[3] + p[1] + du[4] = u[5]^2 + u[4] + du[5] = u[3]^2 + u[5] + du[6] = u[1] + u[2] + u[3] + u[4] + u[5] + 2.0u[6] + 2.5u[7] + 1.5u[8] + du[7] = u[1] + u[2] + u[3] + 2.0u[4] + u[5] + 4.0u[6] - 1.5u[7] + 1.5u[8] + du[8] = u[1] + 2.0u[2] + 3.0u[3] + 5.0u[4] + 6.0u[5] + u[6] - u[7] - u[8] + end + @variables u[1:8]=zeros(8) [irreducible = true] + u2 = collect(u) + @parameters p = 1.0 + eqs = Any[0 for _ in 1:8] + fullf!(eqs, u, [p]) + @named model = NonlinearSystem(0 .~ eqs, [u...], [p]) + model = complete(model; split = false) + + cache = zeros(4) + cache[1] = 1.0 + + function f1!(du, u, p) + du[1] = cos(u[2]) - u[1] + du[2] = sin(u[1] + u[2]) + u[2] + end + explicitfun1(cache, sols) = nothing + + f1!(eqs, u2[1:2], [p]) + @named subsys1 = NonlinearSystem(0 .~ eqs[1:2], [u2[1:2]...], [p]) + subsys1 = complete(subsys1; split = false) + prob1 = NonlinearProblem( + NonlinearFunction{true, SciMLBase.NoSpecialize}(f1!; sys = subsys1), + zeros(2), copy(cache)) + + function f2!(du, u, p) + du[1] = 2u[2] + u[1] + p[1] + du[2] = u[3]^2 + u[2] + du[3] = u[1]^2 + u[3] + end + explicitfun2(cache, sols) = nothing + + f2!(eqs, u2[3:5], [p]) + @named subsys2 = NonlinearSystem(0 .~ eqs[1:3], [u2[3:5]...], [p]) + subsys2 = complete(subsys2; split = false) + prob2 = NonlinearProblem( + NonlinearFunction{true, SciMLBase.NoSpecialize}(f2!; sys = subsys2), + zeros(3), copy(cache)) + + function f3!(du, u, p) + du[1] = p[2] + 2.0u[1] + 2.5u[2] + 1.5u[3] + du[2] = p[3] + 4.0u[1] - 1.5u[2] + 1.5u[3] + du[3] = p[4] + +u[1] - u[2] - u[3] + end + function explicitfun3(cache, sols) + cache[2] = sols[1][1] + sols[1][2] + sols[2][1] + sols[2][2] + sols[2][3] + cache[3] = sols[1][1] + sols[1][2] + sols[2][1] + 2.0sols[2][2] + sols[2][3] + cache[4] = sols[1][1] + 2.0sols[1][2] + 3.0sols[2][1] + 5.0sols[2][2] + + 6.0sols[2][3] + end + + @parameters tmpvar[1:3] + f3!(eqs, u2[6:8], [p, tmpvar...]) + @named subsys3 = NonlinearSystem(0 .~ eqs[1:3], [u2[6:8]...], [p, tmpvar...]) + subsys3 = complete(subsys3; split = false) + prob3 = NonlinearProblem( + NonlinearFunction{true, SciMLBase.NoSpecialize}(f3!; sys = subsys3), + zeros(3), copy(cache)) + + prob = NonlinearProblem(model, []) + sccprob = SciMLBase.SCCNonlinearProblem([prob1, prob2, prob3], + SciMLBase.Void{Any}.([explicitfun1, explicitfun2, explicitfun3]), + model, copy(cache)) + + for sym in [u, u..., u[2] + u[3], p * u[1] + u[2]] + @test prob[sym] ≈ sccprob[sym] + end + + for sym in [p, 2p + 1] + @test prob.ps[sym] ≈ sccprob.ps[sym] + end + + for (i, sym) in enumerate([u[1], u[3], u[6]]) + sccprob[sym] = 0.5i + @test sccprob[sym] ≈ 0.5i + @test sccprob.probs[i].u0[1] ≈ 0.5i + end + sccprob.ps[p] = 2.5 + @test sccprob.ps[p] ≈ 2.5 + @test sccprob.parameter_object[1] ≈ 2.5 + for scc in sccprob.probs + @test parameter_values(scc)[1] ≈ 2.5 + end +end From eca25852f6cbf26de261913432230367a1c7a23c Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Mon, 25 Nov 2024 20:05:43 -0800 Subject: [PATCH 10/16] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e926c8d1f..c809c13c2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.63.1" +version = "2.64.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" From ced4ab7d8384bdfb868ec3914f190d49521f1329 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 26 Nov 2024 16:56:25 +0530 Subject: [PATCH 11/16] fix: fix SII implementation for `SCCNonlinearProblem` --- src/problems/nonlinear_problems.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index 43c6e5f9c..b2a9989c4 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -472,7 +472,8 @@ mutable struct SCCNonlinearProblem{uType, iip, P, E, I, Par} <: function SCCNonlinearProblem{P, E, I, Par}( probs::P, funs::E, indp::I, pobj::Par, alias::Bool) where {P, E, I, Par} - u0 = mapreduce(state_values, vcat, probs) + u0 = mapreduce( + state_values, vcat, probs; init = similar(state_values(first(probs)), 0)) uType = typeof(u0) new{uType, false, P, E, I, Par}(probs, funs, indp, pobj, alias) end @@ -501,7 +502,8 @@ function SymbolicIndexingInterface.parameter_values(prob::SCCNonlinearProblem) prob.parameter_object end function SymbolicIndexingInterface.state_values(prob::SCCNonlinearProblem) - mapreduce(state_values, vcat, prob.probs) + mapreduce( + state_values, vcat, prob.probs; init = similar(state_values(first(prob.probs)), 0)) end function SymbolicIndexingInterface.set_state!(prob::SCCNonlinearProblem, val, idx) From 01c8d250304a745de550c3cd4c1dc53403607564 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 26 Nov 2024 16:56:38 +0530 Subject: [PATCH 12/16] feat: allow `SCCNonlinearProblem` in `OverrideInit` --- src/initialization.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/initialization.jl b/src/initialization.jl index 605300a61..993d10686 100644 --- a/src/initialization.jl +++ b/src/initialization.jl @@ -32,7 +32,8 @@ struct OverrideInitData{IProb, UIProb, IProbMap, IProbPmap} function OverrideInitData(initprob::I, update_initprob!::J, initprobmap::K, initprobpmap::L) where {I, J, K, L} - @assert initprob isa Union{NonlinearProblem, NonlinearLeastSquaresProblem} + @assert initprob isa + Union{SCCNonlinearProblem, NonlinearProblem, NonlinearLeastSquaresProblem} return new{I, J, K, L}(initprob, update_initprob!, initprobmap, initprobpmap) end end From 5211e189aa0c6b13c069da614a28cbc324e1423b Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 28 Nov 2024 12:18:14 +0530 Subject: [PATCH 13/16] fix: handle `I` as mass matrix for `CheckInit` --- src/initialization.jl | 1 + test/initialization.jl | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/initialization.jl b/src/initialization.jl index 993d10686..4e976e168 100644 --- a/src/initialization.jl +++ b/src/initialization.jl @@ -123,6 +123,7 @@ function get_initial_values( t = current_time(integrator) M = f.mass_matrix + M == I && return u0, p, true algebraic_vars = [all(iszero, x) for x in eachcol(M)] algebraic_eqs = [all(iszero, x) for x in eachrow(M)] (iszero(algebraic_vars) || iszero(algebraic_eqs)) && return u0, p, true diff --git a/test/initialization.jl b/test/initialization.jl index e6211e59c..1ea1da694 100644 --- a/test/initialization.jl +++ b/test/initialization.jl @@ -1,4 +1,5 @@ -using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterface, Test +using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterface, + LinearAlgebra, Test @testset "CheckInit" begin @testset "ODEProblem" begin @@ -27,6 +28,20 @@ using StochasticDiffEq, OrdinaryDiffEq, NonlinearSolve, SymbolicIndexingInterfac prob, integ, f, SciMLBase.CheckInit(), Val(SciMLBase.isinplace(f)); abstol = 1e-10) end + + @testset "With I mass matrix" begin + function rhs(u, p, t) + return u + end + prob = ODEProblem(ODEFunction(rhs; mass_matrix = I), ones(2), (0.0, 1.0)) + integ = init(prob) + u0, _, success = SciMLBase.get_initial_values( + prob, integ, prob.f, SciMLBase.CheckInit(), + Val(false); abstol = 1e-10 + ) + @test success + @test u0 == prob.u0 + end end @testset "DAEProblem" begin From 211d997a6eb8ce77eac2e2c648c06f90fe1ded0f Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 29 Nov 2024 16:10:16 +0530 Subject: [PATCH 14/16] refactor: make spellcheck happy --- src/problems/nonlinear_problems.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/problems/nonlinear_problems.jl b/src/problems/nonlinear_problems.jl index b2a9989c4..b61b19ff1 100644 --- a/src/problems/nonlinear_problems.jl +++ b/src/problems/nonlinear_problems.jl @@ -385,7 +385,7 @@ and below. !!! warn While `explictfuns![i]` could in theory use `sols[i+1]` in its computation, these values will not be updated. It is thus the contract of the interface - to not use those values except for as caches to be overriden. + to not use those values except for as caches to be overridden. !!! note prob.probs[i].p can be aliased with each other as a performance / memory From f8c99e916a971a9f77741d764a0d50d9136e7918 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 29 Nov 2024 16:20:49 +0530 Subject: [PATCH 15/16] build: bump minor version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c809c13c2..c88e97f7c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.64.0" +version = "2.65.0" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" From 7d4a68762bde2b3af598c380a37c48d3516e8d06 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 30 Nov 2024 06:37:45 -0800 Subject: [PATCH 16/16] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c88e97f7c..42b8ebc6b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "2.65.0" +version = "2.65.1" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"