You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
Expected behavior
It looks like the propagation of duals through a SteadyStateProblem hits some type promotion issue in initialization.
Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DifferentiationInterface
using SciMLBase
using SymbolicIndexingInterface
using NonlinearSolve
functionreactionsystem()
@variabless1(t) =2.0s1s2(t) =2.0s2(t) =2.0@parameters k1 =1.0 c1 =2.0
eqs = [D(s1) ~-0.25* c1 * k1 * s1 * s2
D(s1s2) ~0.25* c1 * k1 * s1 * s2
D(s2) ~-0.25* c1 * k1 * s1 * s2]
returnstructural_simplify(ODESystem(eqs, t; name=:sys))
end
sys =reactionsystem()
prob =SteadyStateProblem{true}(sys, [k1 =>1.5])
sol =solve(prob, FastShortcutNonlinearPolyalg())
data = sol.u
oop_update =setsym_oop(prob, [sys.k1])
functionloss(x, opt_ps)
prob, oop_update, data = opt_ps
u0, p =oop_update(prob, x)
new_prob =remake(prob; u0, p)
new_sol =solve(new_prob, FastShortcutNonlinearPolyalg())
!SciMLBase.successful_retcode(new_sol) &&returnInfsum(abs.(new_sol .- data))
end
opt_ps = (prob, oop_update, data);
of =OptimizationFunction(loss, AutoForwardDiff())
op =OptimizationProblem(of, [1.1], opt_ps)
solve(op, Optimization.LBFGS())
Describe the bug 🐞
A clear and concise description of what the bug is.
Expected behavior
It looks like the propagation of duals through a
SteadyStateProblem
hits some type promotion issue in initialization.Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: