Skip to content

variables coming from observed kwarg not added to var_to_name #1335

@isaacsas

Description

@isaacsas

Following the tutorials this works:

using ModelingToolkit
@variables t x(t) 
@parameters τ   
D = Differential(t) 
@variables RHS(t)
@named fol_separate = ODESystem([ RHS  ~ (1 - x)/τ,
                                  D(x) ~ RHS ])
fol_simplified = structural_simplify(fol_separate)

with

julia> fol_simplified.RHS
fol_separate₊RHS(t)

however

@named fol = ODESystem(equations(fol_simplified), ModelingToolkit.get_iv(fol_simplified); observed=observed(fol_simplified))

gives

julia> fol.RHS
fol₊RHS(t) ~ (1 - fol₊x(t)) / fol₊τ

Should the ODESystem constructor be detecting the lhs of observed equations and calling process_variables! on them?

edit: I guess collect_var_to_name! is what should actually be called on the lhs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions