Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot simulate a certain ODESystem (probably one where everything gets simplified away) #3467

Closed
TorkelE opened this issue Mar 17, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Mar 17, 2025

This was working on the Catalyst tests up until the v9.66 release, so probably related.

Simple system, just consisting of a simple algebraic equation. Probably related to why we have an error.

using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using OrdinaryDiffEqDefault
@variables X(t)
eqs = [2X ~ 6.0 - X]
@mtkbuild osys = ODESystem(eqs, t)
u0 = [X => 1.0]
oprob = ODEProblem(osys, u0, 1.0)
sol = solve(oprob)
ERROR: MethodError: no method matching build_solution(::ODEProblem{…}, ::Nothing, ::Vector{…}, ::Vector{…}, ::SciMLBase.ReturnCode.T)
The function `build_solution` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  build_solution(::SciMLBase.AbstractDAEProblem, ::Any, ::Any, ::Any, ::Any; timeseries_errors, dense, dense_errors, calculate_error, k, interp, retcode, destats, stats, saved_subsystem, kwargs...)
   @ SciMLBase ~/.julia/packages/SciMLBase/Ub9ub/src/solutions/dae_solutions.jl:82
  build_solution(::Union{SciMLBase.AbstractDDEProblem, SciMLBase.AbstractODEProblem}, ::Any, ::Any, ::Any; timeseries_errors, dense, dense_errors, calculate_error, k, alg_choice, interp, retcode, destats, stats, resid, original, saved_subsystem, kwargs...)
   @ SciMLBase ~/.julia/packages/SciMLBase/Ub9ub/src/solutions/ode_solutions.jl:454
  build_solution(::SciMLBase.AbstractOptimizationCache, ::Any, ::Any, ::Any; retcode, original, stats, kwargs...)
   @ SciMLBase ~/.julia/packages/SciMLBase/Ub9ub/src/solutions/optimization_solutions.jl:74
  ...

Stacktrace:
 [1] build_null_solution(::ODEProblem{…}; saveat::Tuple{}, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Bool, kwargs::@Kwargs{})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:719
 [2] build_null_solution(::ODEProblem{…})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:691
 [3] solve_call(::ODEProblem{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:627
 [4] solve_call(::ODEProblem{…})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:592
 [5] solve_up(::ODEProblem{…}, ::Nothing, ::Nothing, ::MTKParameters{…}; kwargs::@Kwargs{})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:1128
 [6] solve_up
   @ ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:1122 [inlined]
 [7] solve(::ODEProblem{…}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:1059
 [8] solve(::ODEProblem{Nothing, Tuple{…}, true, MTKParameters{…}, ODEFunction{…}, @Kwargs{}, SciMLBase.StandardODEProblem})
   @ DiffEqBase ~/.julia/packages/DiffEqBase/gGshU/src/solve.jl:1049

If things like this shouldn't be simualteable in the first way, there should probably be an error when one tries to create an ODESystem that cannot be simualted.

@TorkelE TorkelE added the bug Something isn't working label Mar 17, 2025
@ChrisRackauckas
Copy link
Member

@AayushSabharwal I thought you already released the hotfix on this?

@AayushSabharwal
Copy link
Member

Was waiting for CI but I guess we can just tag

@AayushSabharwal
Copy link
Member

Waiting for registrator now

@TorkelE
Copy link
Member Author

TorkelE commented Mar 17, 2025

Sounds like things are already under control!

@TorkelE TorkelE closed this as completed Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants