-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Structural simplify broken for SDEs #2614
Labels
bug
Something isn't working
Comments
This was referenced Jun 9, 2024
Having the same problem using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
@parameters begin
α = 1.0 # parameters
λ = 0.02
ω = 1.0
ω0 = 1.0
γ = 0.005
end
@variables x(t) = 0.0
eqs = [D(D(x)) ~ -(ω0^2 - λ*cos(2*ω*t))*x - α*x^3 - γ*D(x)]
Ttr = 30_000.0
T = 100_000.0
tspan = (0.0, Ttr + T)
times = range((Ttr, Ttr + T)..., step=1)
@mtkbuild model = ODESystem(eqs, t; tspan=tspan)
@mtkbuild sdesystem = SDESystem(model, [0.0,0.0]) |
Forgot, we had to use @parameters begin
α = 1.0 # parameters
λ = 0.02
ω = 1.0
ω0 = 1.0
γ = 0.005
end
@brownian β
@variables x(t) = 0.0 x_t(t) = 0.0
eqs = [
D(x) ~ x_t + β,
D(x_t) ~ -(ω0^2 - λ*cos(2*ω*t))*x - α*x^3 - γ*x_t + β,
]
Ttr = 30_000.0
T = 100_000.0
tspan = (0.0, Ttr + T)
times = range((Ttr, Ttr + T)..., step=1)
@mtkbuild model = System(eqs, t; tspan=tspan)
typeof(model) |
I believe this was fixed with the change to System, and pointed out in the other issue that is now closed? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As the title says. This is required when e.g. combing and SDE with an algebraic equation. Example:
gives
The corresponding code, but for making and ODE, works fine:
The text was updated successfully, but these errors were encountered: