Skip to content

Problem using inputs in structural_simplify #1211

Closed
@dannys4

Description

@dannys4
using ModelingToolkit
N = 5
@variables t x_a[1:N](t) u_a[1:N](t) [input=true] y_a[1:N](t) [output=true]
D = Differential(t)
x, u, y = collect.([x_a, u_a, y_a])
A = rand(N,N); B = rand(N,N); C = rand(N,N);
eqs = [D.(x) .~ A*x + B*u; y .~ C*x]
sys = ODESystem(eqs, name=:linear_sys)
new_sys = structural_simplify(sys)

Error:

ERROR: ExtraVariablesSystemException: The system is unbalanced. There are 15 highest order derivative variables and 10 equations.
More variables than equations, here are the potential extra variable(s):
 x_a[1](t)
 x_a[2](t)
 x_a[3](t)
 x_a[4](t)
 x_a[5](t)
 u_a[1](t)
 u_a[2](t)
 u_a[3](t)
 u_a[4](t)
 u_a[5](t)

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