Skip to content

Change_independent_variable and connections #3623

@aml5600

Description

@aml5600

Question❓

It looks like the change_independent_variable transformation needs to have the connections expanded. This fails:

    @mtkmodel ConnectSys begin
        @components begin
            in = RealInput()
            out = RealOutput()
        end
        @variables begin
            x(t)
            y(t)
        end
        @equations begin
            connect(in, out)
            in.u ~ x
            D(x) ~ out.u
            D(y) ~ 1
        end
    end
    @named sys = ConnectSys()
    sys = complete(sys; flatten = false)
    new_sys = change_independent_variable(sys, sys.y)
    ss = structural_simplify(new_sys)

failing on structural_simplify stuff. The systems from the connection equation are still wrt t.

@hersle is it possible to work through the connection systems similar to how you did everything else? should we enforce that all connections are expanded before calling the transformation? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions