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
As the title says. This is required when e.g. combing and SDE with an algebraic equation. Example:
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
# Define some variables@parameters p d
@variablesX(t)
eqs = [D(X) ~ p - d*X]
noise_eqs = [sqrt(p), sqrt(p - d*X)]
@named ssys =SDESystem(eqs, noise_eqs, t, [X], [p, d])
structural_simplify(ssys)
gives
ERROR: This should never happen. Trying to set DataType with @NamedTuple{substitutions::ModelingToolkit.Substitutions}.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] #s300#199
@ ~/.julia/dev/ModelingToolkit/src/systems/abstractsystem.jl:629 [inlined]
[3] var"#s300#199"(::Any, obj::Any, patch::Any)
@ ModelingToolkit ./none:0
[4] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
@ Core ./boot.jl:602
[5] set
@ ~/.julia/packages/Setfield/PdKfV/src/lens.jl:122 [inlined]
[6] macro expansion
@ ~/.julia/packages/Setfield/PdKfV/src/sugar.jl:197 [inlined]
[7] tearing_reassemble(state::TearingState{…}, var_eq_matching::ModelingToolkit.BipartiteGraphs.Matching{…}, full_var_eq_matching::Nothing; simplify::Bool, mm::ModelingToolkit.SparseMatrixCLIL{…})
@ ModelingToolkit.StructuralTransformations ~/.julia/dev/ModelingToolkit/src/structural_transformation/symbolics_tearing.jl:564
[8] tearing_reassemble (repeats 2 times)
@ ~/.julia/dev/ModelingToolkit/src/structural_transformation/symbolics_tearing.jl:220 [inlined]
[9] #dummy_derivative#126
@ ~/.julia/dev/ModelingToolkit/src/structural_transformation/symbolics_tearing.jl:648 [inlined]
[10] _structural_simplify!(state::TearingState{…}, io::Nothing; simplify::Bool, check_consistency::Bool, fully_determined::Bool, warn_initialize_determined::Bool, dummy_derivative::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/dev/ModelingToolkit/src/systems/systemstructure.jl:692
[11] _structural_simplify!
@ ~/.julia/dev/ModelingToolkit/src/systems/systemstructure.jl:672 [inlined]
[12] #structural_simplify!#1069
@ ~/.julia/dev/ModelingToolkit/src/systems/systemstructure.jl:665 [inlined]
[13] __structural_simplify(sys::SDESystem, io::Nothing; simplify::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/dev/ModelingToolkit/src/systems/systems.jl:76
[14] __structural_simplify
@ ~/.julia/dev/ModelingToolkit/src/systems/systems.jl:57 [inlined]
[15] structural_simplify(sys::SDESystem, io::Nothing; simplify::Bool, split::Bool, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/dev/ModelingToolkit/src/systems/systems.jl:22
[16] structural_simplify
@ ~/.julia/dev/ModelingToolkit/src/systems/systems.jl:19 [inlined]
[17] structural_simplify(sys::SDESystem)
@ ModelingToolkit ~/.julia/dev/ModelingToolkit/src/systems/systems.jl:19
[18] top-level scope
@ ~/Desktop/Julia Playground/Environment - Catalyst test/test_playground.jl:72
Some type information was truncated. Use `show(err)` to see complete types.
The corresponding code, but for making and ODE, works fine:
using ModelingToolkit, StochasticDiffEq
using ModelingToolkit: t_nounits as t, D_nounits as D
# Define some variables@parameters p d
@variablesX(t)
eqs = [D(X) ~ p - d*X]
noise_eqs = [sqrt(p), sqrt(p - d*X)]
@named osys =ODESystem(eqs, t, [X], [p, d])
structural_simplify(osys)
The text was updated successfully, but these errors were encountered:
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: