-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Fix SDEProblem constructor issue #2281
Conversation
Signed-off-by: ErikQQY <[email protected]>
@@ -583,7 +583,7 @@ function DiffEqBase.SDEProblem{iip}(sys::SDESystem, u0map = [], tspan = get_tspa | |||
noise_rate_prototype = zeros(eltype(u0), size(noiseeqs)) | |||
end | |||
|
|||
SDEProblem{iip}(f, u0, tspan, p; callback = cbs, | |||
SDEProblem{iip}(f, f.g, u0, tspan, p; callback = cbs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but from testing locally
f, u0, p = process_DEProblem(SDEFunction{iip}, sys, u0map, parammap; check_length, kwargs...)
SDEProbelm(f, u0, tspan, p; ...)
would cause the same error in CI
but if we changed to
f, u0, p = process_DEProblem(SDEFunction{iip}, sys, u0map, parammap; check_length, kwargs...)
SDEProbelm(f, f.g u0, tspan, p; ...) # or SDEProbelm(f.f, f.g u0, tspan, p; ...)
working fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's the constructor you deleted? Why not just use the SDEProblem(::SDEFunction, u0, tspan, p)
dispatch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the f
generated from process_DEProblem
here? I think it should be working fine with the v2.0 SciMLBase, which directly build SDEProblem
on SDEFunction
by using SDEProblem(f, u0, tspan, p)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generating an SDEFunction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange here, I tested f
here and indeed I got an SDEFunction, but the constructor SDEProblem(f::SDEFunction, u0, tspan, p; ...)
still error here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's what I was asking before merge that you were testing. Did you @which
see that everything is going to the right dispatches? I thought you needed tspan::Tuple
or something so that it could dispatch correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't sure if this guess is right, I am wondering since this is a DiffEqBase.SDEProblem
dispatch for SDESystem
type, what is the "version" of SDEProblem used here(MTK is still use 1.103.0 version DiffEqBase)?
ModelingToolkit.jl/src/systems/diffeqs/sdesystem.jl
Lines 586 to 587 in 1aa4806
SDEProblem{iip}(f, u0, tspan, p; callback = cbs, | |
noise_rate_prototype = noise_rate_prototype, kwargs...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's forcing SciMLBase v2. The StochasticDiffEq issues are the same problem without MTK involved. I don't think they are hitting the correct dispatches.
Should fix the problems in StochasticDiffEq