79645933

Date: 2025-05-30 18:27:06
Score: 0.5
Natty:
Report link

Assuming the system is defined by the matrices {A,B,C,D} you have

xn+1 = Axn + Bun

yn = Cxn + Dun

You can modify this to have additional outputs, in this case the state vector itself, without changing the system dynamics:

xn+1 = Axn + Bun

[ yn ; xn ] = [ C ; I ]xn + [ D ; 0 ]un

This will result in a vector output from the block [ yn ; xn ] and you can separate this using a Selector block, sending the portion of the vector for yn wherever you previously used that signal (e.g. feedback loop) and sending xn to wherever you want to have the full state measurement.

Let's assume

Then instead of putting A, B, C, D, and Ts into the Discrete State Space block, you'd put A, B, [ C ; eye(N) ], and [ D ; zeros(M,L) ] as in the following: Block Parameters: Discrete State-Space

Note that my dummy example uses N = 4, M = 3, L = 2, and Ts = 1

Then, to get yn add a selector block to get the elements 1:M like this: Selector for y

And similarly for xn, you want elements (M+1):(M+N) like this: Selector for x

Since you have not modified the system matrices {A,B,C,D} you're free to continue using them for analysis or design tasks as is.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: emceerich