ss_block¶
State-space model in block form. This class has the same purpose as “ss”, but the A, B, C, D are allocated in the form of nested lists. The format is similar to the one used in numpy.block but:
- Block matrices can contain both dense and sparse matrices
- Empty blocks are defined through None type
Methods: - remove_block: drop one of the blocks from the s-s model - addGain: project inputs/outputs - project: project state
Projects input u or output y the state-space system through the gain block matrix K. The input ‘where’ determines whether inputs or outputs are projected as:
- where=’in’: inputs are projected such that:
- u_new -> u=K*u_new -> SS -> y => u_new -> SSnew -> y
- where=’out’: outputs are projected such that:
- u -> SS -> y -> y_new=K*y => u -> SSnew -> ynew
Input: K must be a list of list of matrices. The size of K must be compatible with either B or C for block matrix product.
Get the size of each block in M.
Given 2 transformation matrices, (W,V) of shape (Nk,self.states), this routine projects the state space model states according to:
Anew = W^T A V Bnew = W^T B Cnew = C V Dnew = DThe projected model has the same number of inputs/outputs as the original one, but Nk states.
Inputs: - WT = W^T - V = V - by_arrays: if True, W, V are either numpy.array or sparse matrices. If
False, they are block matrices.- overwrite: if True, overwrites the A, B, C matrices
Remove a block from either inputs or outputs.
Inputs: - where = {‘in’, ‘out’}: determined whether to remove inputs or outputs - index: index of block to remove