Naming of states, inputs and outputs in `ControlSystemsMTK`

BambOoxX
Mon, 18 Mar 2024 17:14:46 +0000
Modelling & Simulations

Hi, I just tested naming states, inputs and outputs while passing a state-space model to ODESystem.

It seems the optional names are ignored, am I doing something wrong here ?

using ControlSystemsBase, ControlSystemsMTK, ModelingToolkit, LinearAlgebra
ssmodel = ss(Diagonal(rand(10)), rand(10,3), rand(2,10),0)
x_names = [Symbol("x$i") for i in 1:10]
sys = ModelingToolkit.ODESystem(ssmodel; name=:sys, x=x_names)

This returns

Model sys with 12 equations
Unknowns (15):
(x(t))[1] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[2] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[3] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[4] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[5] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[6] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[7] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[8] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[9] [defaults to 0.0]: State variables of StateSpace system sys
(x(t))[10] [defaults to 0.0]: State variables of StateSpace system sys
⋮
Parameters (0):

I’m on

[a6e380b2] ControlSystems v1.10.0
[aaaaaaaa] ControlSystemsBase v1.10.2
[687d7614] ControlSystemsMTK v2.0.1
[961ee093] ModelingToolkit v9.5.0

13 posts - 2 participants