-
-
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
Composing SDESystems does not work #2085
Comments
Don't |
For ODESystems, that is the way we use compose and it works for ODESystems. @ChrisRackauckas told me that this should work also for SDEs, but maybe I am missing a detail or two. |
@isaacsas you are correct. For ODESystems the correct compose is: |
Yeah, |
I just tried: |
Does it actually get the correct noise equations too though? |
here is the updated code:
structural_simplify fails with:
|
no, the noise equations are missing.
|
Right, so it needs a custom |
This works: using ModelingToolkit
@variables t
D = Differential(t)
function van_der_pol(;name, θ=1.0,ϕ=0.1)
params = @parameters θ=θ
sts = @variables x(t)=1.0 y(t)=1.0 jcn(t)=0.0
@brownian ϕ
eqs = [D(x) ~ y + jcn + ϕ,
D(y) ~ θ*(1-x^2)*y - x + ϕ]
return System(eqs, t; name=name)
end
@named VP1 = van_der_pol()
@named VP2 = van_der_pol()
eqs = [VP1.jcn ~ VP2.x,
VP2.jcn ~ VP1.x]
sys = [VP1,VP2]
@named coupledVP = compose(System(eqs,t;name=:connected),sys)
coupledVPs = structural_simplify(coupledVP) |
@YingboMa thanks so much |
Hi Yingbo- Could your provide an example of a construction of a (ODE? SDE?)Problem using this System? I am running into the issue that the number of equations and variables don't match. |
I am trying to compose SDESystems, and when I do, Julia goes into an infinite loop after I execute compose. Am I doing it the right way? (see below for a slightly better way of attempting to compose SDEs).
The text was updated successfully, but these errors were encountered: