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
Reinitialize integrator with (optionally) different initial state u0, different integration interval from t0 to tf, and erased solution if erase_sol = true.
led me to believe that reinit!(integrator) should be a no-op on a fresh integrator. If this is the intended meaning, then there's a bug...
Minimal Reproducible Example 👇
using Revise, DifferentialEquations, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
f(c, T) = (1-3* c ^2)
@mtkmodel Tank begin@variablesbeginM1(t)
M2(t)
c(t)
b(t)
end@equationsbeginD(M1) ~ b + c
D(M2) ~ (1- b) + (1- c)
c ~ M1 / (M1 + M2)
(M1 + M2) *f(c, 80) ~10endend@mtkbuild tank =Tank();
prob =ODEProblem(tank, [tank.c =>0.6], (0, 10.0), [],
guesses=[tank.M1 =>5,
tank.M2 =>5,
tank.b =>2])
integrator = DifferentialEquations.init(prob)
reinit!(integrator) # disable to make it succeedstep!(integrator, 0.01, true)
ifcheck_error(integrator) != ReturnCode.Success
@error("Solver has error: $(check_error(integrator))")
end
Error & Stacktrace ⚠️
┌ Warning: At t=0.0, dt was forced below floating point epsilon 5.0e-324, and step error estimate =NaN. Aborting. There is either an error in your model specification or the true solution is unstable (or the true solution can not be represented in the precision of Float64).
└ @ SciMLBase C:\Users\\.julia\packages\SciMLBase\Pma4a\src\integrator_interface.jl:623
┌ Error: Solver has error: Unstable
└ @ Main C:\Users\\Documents\\play_env\test.jl:33
Environment (please complete the following information):
Julia Version 1.10.5
Commit 6f3fdf7b36 (2024-08-2714:19 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU:8×11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads:1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
JULIA_SSL_CA_ROOTS_PATH =
Additional context
Probably not related to #3370, but I used a similar MWE (except that here there is no @register_symbolic f(c, T), which fixes the problem in that issue.
This is probably a DifferentialEquations bug, but I'd be lost trying to create a MWE for that package.
The text was updated successfully, but these errors were encountered:
This happens because the integrator resets integ.u0 to integ.sol.prob.u0, but that doesn't satisfy algebraic constraints until initialization is rerun. I'll PR to OrdinaryDiffEq to fix this.
Describe the bug 🐞
Calling
reinit!
on a freshly createdintegrator
makes the solver unstable.Expected behavior
The docstring
led me to believe that
reinit!(integrator)
should be a no-op on a freshintegrator
. If this is the intended meaning, then there's a bug...Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Probably not related to #3370, but I used a similar MWE (except that here there is no
@register_symbolic f(c, T)
, which fixes the problem in that issue.This is probably a DifferentialEquations bug, but I'd be lost trying to create a MWE for that package.
The text was updated successfully, but these errors were encountered: