0
Get state vectors of state space block during simulation

Hi,

how can I get all state vectors of state space block during simulation in Xcos?

Thank you.


Scilab 17-12-18, 12:58 p.m. alexandru

Answers:

0

You can get all output states of state space block by using a vector multiplication. For example, if the states are [x1 x2], you can extract the x1 state by multiplying the output by the vector [1 0]. Similarly, you can extract the x2 state by multiplying the output by the vector [0 1]. This vector can be defined using the "GAINBLK_f". This block can be found inside the "Mathematical Operations" category on the "Palette Browser".

Rupak

17-12-18, 3 p.m. rupakrokade

If you take a look at the "Description" section in the block help (https://help.scilab.org/doc/5.3.3/en_US/CLSS.html), the states are the x vector.
I think you mean the output vector (y). That is not problem to get. I need the x vector.


17-12-18, 3:07 p.m. alexandru

Login to add comment


1

Yes and the states (the x vector) are available on the output "y" because we define "y=C*X". So if you define C as an identity matrix of proper dimension, all your states are available on output "y".

17-12-18, 3:13 p.m. rupakrokade

Hm, intreresting approach... Actually C is not identity matrix in my model so I need to dupplicate the state space block and define C as a identity matrix for this new block. The new block must run in parallel with the original block. I guess that's doable... Thank you very much for the tip.


17-12-18, 3:17 p.m. alexandru

Login to add comment


0

You are welcome. I think you can safely consider C to be identity with its "number of rows" matching the "number of rows" of B. I dont see any reason how C affects your system's model.

Rupak

17-12-18, 3:34 p.m. rupakrokade

Oh, it does... The state space comes from reducing a FE model by using the model superposition method. I couple the state space with a controller model. The states x are in modal coordinates. The output y is in physical coordinates. Big difference...


17-12-18, 3:37 p.m. alexandru

Login to add comment


Log-in to answer to this question.