From 543cd391ab5039e94afa06d0740fa3d4db5b6413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Wed, 29 Oct 2025 14:35:17 +0200 Subject: [PATCH 1/4] convert alias_u0 in __solve to a ODEAliasSpecifier NonlinearSolve is passing this Co-authored-by: Claude --- src/solve.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index 21fc58a..f57da5b 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -16,7 +16,7 @@ end function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::DynamicSS, args...; abstol = 1e-8, reltol = 1e-6, odesolve_kwargs = (;), save_idxs = nothing, termination_condition = NonlinearSolveBase.NormTerminationMode(infnorm), - kwargs...) + alias_u0 = false, kwargs...) tspan = __get_tspan(prob.u0, alg) f = if prob isa SteadyStateProblem @@ -54,7 +54,8 @@ function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::Dyna # Construct and solve the ODEProblem odeprob = ODEProblem{isinplace(prob), true}(f, prob.u0, tspan, prob.p) odesol = solve(odeprob, alg.alg, args...; abstol, reltol, kwargs..., - odesolve_kwargs..., callback, save_end = true) + odesolve_kwargs..., callback, save_end = true, + alias = SciMLBase.ODEAliasSpecifier(; alias_u0)) resid, u, retcode = __get_result_from_sol(termination_condition, tc_cache, odesol) From 2eceeabdbf2e53866a7cb321b9a7b1543088aa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Wed, 29 Oct 2025 14:36:30 +0200 Subject: [PATCH 2/4] fix deprecated MTK syntax in tests Co-authored-by: Claude --- test/autodiff.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/autodiff.jl b/test/autodiff.jl index 9724589..4bd01e4 100644 --- a/test/autodiff.jl +++ b/test/autodiff.jl @@ -34,7 +34,7 @@ eqs = [ D(y8) ~ (-k2 * y6 * y8 + k6 * y7) ] -@mtkbuild model = ODESystem(eqs, t) +@mtkcompile model = System(eqs, t) struct Tag end T = typeof(ForwardDiff.Tag(Tag(), Float64)) From d531a31329a6ff1f21a57017e2cb15cf98d4bbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Wed, 29 Oct 2025 21:32:57 +0200 Subject: [PATCH 3/4] fix alias specification Co-authored-by: Christopher Rackauckas Co-authored-by: Claude --- src/solve.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/solve.jl b/src/solve.jl index f57da5b..c65f45d 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -16,7 +16,7 @@ end function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::DynamicSS, args...; abstol = 1e-8, reltol = 1e-6, odesolve_kwargs = (;), save_idxs = nothing, termination_condition = NonlinearSolveBase.NormTerminationMode(infnorm), - alias_u0 = false, kwargs...) + alias = SciMLBase.NonlinearAliasSpecifier(), kwargs...) tspan = __get_tspan(prob.u0, alg) f = if prob isa SteadyStateProblem @@ -55,7 +55,8 @@ function SciMLBase.__solve(prob::SciMLBase.AbstractSteadyStateProblem, alg::Dyna odeprob = ODEProblem{isinplace(prob), true}(f, prob.u0, tspan, prob.p) odesol = solve(odeprob, alg.alg, args...; abstol, reltol, kwargs..., odesolve_kwargs..., callback, save_end = true, - alias = SciMLBase.ODEAliasSpecifier(; alias_u0)) + alias = SciMLBase.ODEAliasSpecifier(; alias_p = alias.alias_p, + alias_f = alias.alias_f, alias_u0 = alias.alias_u0)) resid, u, retcode = __get_result_from_sol(termination_condition, tc_cache, odesol) From 79523f9c9b702743517233db4db0282e33649a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Thu, 6 Nov 2025 14:31:32 +0200 Subject: [PATCH 4/4] bump compat for NonlinearSolveBase --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index e7650d9..50bca93 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" ConcreteStructs = "0.2" DiffEqBase = "6.140" DiffEqCallbacks = "3, 4" -NonlinearSolveBase = "2" +NonlinearSolveBase = "2.2" Reexport = "1.0" SciMLBase = "2" julia = "1.10"