On obtaining state names names with GenSS

4 views (last 30 days)
Remus
Remus on 23 Dec 2016
Answered: Prashant Arora on 29 Dec 2016
I am working on a large Simulink model and extracting various I/O models between different points in the sim using the GenSS built-in getIOTransfer() function. Lets say such a GenSS model is "plant". If I type ss(plant) I get the entire A,B,C,D,E state space representation, with corresponding state, input, and output names. These names are predefined and added to the model using addPoint(). Im addition, my GenSS model also includes additional states "Integrator #n" due to other dynamic modes present in the model, which I have not added to the analysis using addpoint() function. Everything is fine up to here. No lets say I want to obtain a minimal realization of this model by issuing the command
>> plant_min = minreal(plant)
this returns a minimal representation GenSS of the plant but all the state names are now x1, x2, .., x_min. Input and output names are still the same.
My question is can I somehow preserve the original names of states during this procedure?
Thanks.

Answers (1)

Prashant Arora
Prashant Arora on 29 Dec 2016
If the states and order of states in State-space realization remain the same after minimum realization, you can use the following commands to re-assign the state names.
Names = plant.StateName;
plant_min.StateName = Names(1:numel(plant_min.StateName));

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!