From d52c03448585e96fb1f4e2e02172dd773cf2a29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= <31181429+SebastianM-C@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:38:27 +0200 Subject: [PATCH 1/2] Fix `remake` for `SCCNonlinearProblem` It looks like the `explicitfuns!` argument is directly forwarded to the constructor resulting in broken problems after a remake due to `explicitfuns!` being `missing`. --- src/remake.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/remake.jl b/src/remake.jl index 31d013964..f7e48afce 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -824,6 +824,9 @@ function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = mi if probs === missing probs = prob.probs end + if explicitfuns! === missing + explicitfuns! = prob.explictfuns! + end offset = 0 if u0 !== missing || p !== missing && parameters_alias probs = map(probs) do subprob From f0a22a1dfd7385852655d8e19d0277831ab1a6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Wed, 15 Jan 2025 20:09:31 +0200 Subject: [PATCH 2/2] add remake test for SCCNonlinearProblem --- test/downstream/modelingtoolkit_remake.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/downstream/modelingtoolkit_remake.jl b/test/downstream/modelingtoolkit_remake.jl index 00cb97d46..b7bfa5fe5 100644 --- a/test/downstream/modelingtoolkit_remake.jl +++ b/test/downstream/modelingtoolkit_remake.jl @@ -321,6 +321,7 @@ end @test state_values(sccprob2) ≈ 2ones(3) @test sccprob2.probs[1].u0 ≈ 2ones(2) @test sccprob2.probs[2].u0 ≈ 2ones(1) + @test sccprob2.explicitfuns! !== missing sccprob3 = remake(sccprob; p = [σ => 2.0]) @test sccprob3.p === sccprob3.probs[1].p