You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example 2 in the home page of this repo produces error.
The error appears on the line @mtkbuild connected = ODESystem(connections, t, [a], [γ], systems = [lorenz1, lorenz2])
Expected behavior
Should produce a plot like in the demo.
Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
using DifferentialEquations, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
@parameters σ ρ β
@variablesx(t) y(t) z(t)
eqs = [D(D(x)) ~ σ * (y - x),
D(y) ~ x * (ρ - z) - y,
D(z) ~ x * y - β * z]
@mtkbuild lorenz1 =ODESystem(eqs, t)
@mtkbuild lorenz2 =ODESystem(eqs, t)
@variablesa(t)
@parameters γ
connections = [0~ lorenz1.x + lorenz2.y + a * γ]
@mtkbuild connected =ODESystem(connections, t, [a], [γ], systems = [lorenz1, lorenz2])
u0 = [lorenz1.x =>1.0,
lorenz1.y =>0.0,
lorenz1.z =>0.0,
lorenz2.x =>0.0,
lorenz2.y =>1.0,
lorenz2.z =>0.0,
a =>2.0]
p = [lorenz1.σ =>10.0,
lorenz1.ρ =>28.0,
lorenz1.β =>8/3,
lorenz2.σ =>10.0,
lorenz2.ρ =>28.0,
lorenz2.β =>8/3,
γ =>2.0]
tspan = (0.0, 100.0)
prob =ODEProblem(connected, u0, tspan, p)
sol =solve(prob)
using Plots
plot(sol, idxs = (a, lorenz1.x, lorenz2.z))
Error & Stacktrace ⚠️
ERROR: LoadError: ModelingToolkit.ExtraVariablesSystemException("The system is unbalanced. There are 11 highest order derivative variables and 9 equations.\nMore variables than equations, here are the potential extra variable(s):\n lorenz1₊xˍt(t)\n lorenz1₊y(t)\n lorenz1₊z(t)\n lorenz1₊x(t)\n lorenz2₊xˍt(t)\n lorenz2₊y(t)\n lorenz2₊z(t)\n lorenz2₊x(t)\n y(t)\n a(t)")
Stacktrace:
[1] error_reporting(state::TearingState{ODESystem}, bad_idxs::Vector{Int64}, n_highest_vars::Int64, iseqs::Bool, orig_inputs::Set{Any})
@ ModelingToolkit.StructuralTransformations ~/.julia/packages/ModelingToolkit/cAhZr/src/structural_transformation/utils.jl:50
[2] check_consistency(state::TearingState{ODESystem}, orig_inputs::Set{Any})
@ ModelingToolkit.StructuralTransformations ~/.julia/packages/ModelingToolkit/cAhZr/src/structural_transformation/utils.jl:85
[3] _structural_simplify!(state::TearingState{ODESystem}, io::Nothing; simplify::Bool, check_consistency::Bool, fully_determined::Bool, warn_initialize_determined::Bool, dummy_derivative::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systemstructure.jl:689
[4] structural_simplify!(state::TearingState{ODESystem}, io::Nothing; simplify::Bool, check_consistency::Bool, fully_determined::Bool, warn_initialize_determined::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systemstructure.jl:635
[5] __structural_simplify(sys::ODESystem, io::Nothing; simplify::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systems.jl:74
[6] __structural_simplify
@ ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systems.jl:55 [inlined]
[7] structural_simplify(sys::ODESystem, io::Nothing; simplify::Bool, split::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systems.jl:22
[8] structural_simplify
@ ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systems.jl:19 [inlined]
[9] structural_simplify(sys::ODESystem)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/systems.jl:19
[10] top-level scope
@ ~/.julia/packages/ModelingToolkit/cAhZr/src/systems/abstractsystem.jl:1643
[11] include(fname::String)
@ Base.MainInclude ./client.jl:489
[12] run(debug_session::VSCodeDebugger.DebugAdapter.DebugSession, error_handler::VSCodeDebugger.var"#3#4"{String})
@ VSCodeDebugger.DebugAdapter ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/DebugAdapter/src/packagedef.jl:126
[13] startdebugger()
@ VSCodeDebugger ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/VSCodeDebugger/src/VSCodeDebugger.jl:45
[14] top-level scope
@ ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/debugger/run_debugger.jl:12
[15] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[16] exec_options(opts::Base.JLOptions)
@ Base ./client.jl:318
[17] _start()
@ Base ./client.jl:552
in expression starting at /workspaces/julia-quarto-diffeq-2020/github-modelingtoolkit-example2.jl:18
Environment (please complete the following information):
Example 2 in the home page of this repo produces error.
The error appears on the line
@mtkbuild connected = ODESystem(connections, t, [a], [γ], systems = [lorenz1, lorenz2])
Expected behavior
Should produce a plot like in the demo.
Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: