-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Encounter a bug using DifferentialEquations #55448
Labels
needs more info
Clarification or a reproducible example is required
Comments
Please post the steps to reproduce the error (a minimal example that produces the error). |
@jishnub Thank you very much, sir. Below is the code from the official demo. using ModelingToolkit, DifferentialEquations, Plots
# Define our state variables: state(t) = initial condition
@variables t x(t)=1 y(t)=1 z(t)=2
# Define our parameters
@parameters α=1.5 β=1.0 γ=3.0 δ=1.0
# Define our differential: takes the derivative with respect to `t`
D = Differential(t)
# Define the differential equations
eqs = [D(x) ~ α * x - β * x * y
D(y) ~ -γ * y + δ * x * y
z ~ x + y]
# Bring these pieces together into an ODESystem with independent variable t
@mtkbuild sys = ODESystem(eqs, t)
# Convert from a symbolic to a numerical problem to simulate
tspan = (0.0, 10.0)
prob = ODEProblem(sys, [], tspan)
# Solve the ODE
sol = solve(prob)
# Plot the solution
p1 = plot(sol, title = "Rabbits vs Wolves")
p2 = plot(sol, idxs = z, title = "Total Animals")
plot(p1, p2, layout = (2, 1)) |
Was this with Julia v1.10.3? We had the Julia v1.10.4 patch release because of the GC bug, and this looks like it's that GC bug. |
Please try with 1.10.5 and reopen if still an issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the code to reproduce the error
The text was updated successfully, but these errors were encountered: