1
$\begingroup$

How can I transpose the output of state space model in Mathematica? trying the following code would transpose the top right symbol s instead of the matrices.

Transpose @ StateSpaceModel @ TransferFunctionModel[{{a^2/(s^2 + b s + c)}}, s]

enter image description here

$\endgroup$
8
  • $\begingroup$ Normal the model, operate on parts as desired, StateSpaceModel the result... $\endgroup$ – ciao Jul 17 '15 at 5:31
  • $\begingroup$ @ciao, I don't understand what you mean. $\endgroup$ – ar2015 Jul 17 '15 at 5:34
  • $\begingroup$ You'll find all the details of those functions here $\endgroup$ – ciao Jul 17 '15 at 5:44
  • $\begingroup$ @ciao, i uesd normal. It tries to give me norm!! $\endgroup$ – ar2015 Jul 17 '15 at 5:50
  • $\begingroup$ I'd venture you used Norm, instead of Normal? $\endgroup$ – ciao Jul 17 '15 at 6:09
2
$\begingroup$

I am not sure what a valid transpose of a StateSpaceModel is but here is an attempt:

ssm = StateSpaceModel @ TransferFunctionModel[{{a^2/(s^2 + b s + c)}}, s]

enter image description here

Transpose /@ #[[{1, 3, 2, 4}]] & /@ ssm

enter image description here

$\endgroup$
1
  • $\begingroup$ Looks like perhaps they snuck some changes in either structure or made transpose aware of structure in 10.x: Latter code blows up on 9.x (I used StateSpaceModel@(Transpose /@ #[[{1, 3, 2, 4}]] &@(Normal@ssm)) for it to work). While that's a valid model, it's patently unclear what OP is after. Congratulations on 150, btw, and +1 here. $\endgroup$ – ciao Jul 17 '15 at 10:13
2
$\begingroup$

To not be at the mercy of the internal representation of StateSpaceModel use DualSystemsModel.

ssm = StateSpaceModel @ TransferFunctionModel[{{a^2/(s^2 + b s + c)}}, s];
DualSystemsModel[ssm]

enter image description here

Simplify[%, Element[a, Reals] && Element[b, Reals] && Element[c, Reals]]

enter image description here

It will also work for descriptor systems.

ssm1 = StateSpaceModel@TransferFunctionModel[{{a^2 s^3/(s^2 + b s + c)}}, s];
DualSystemsModel[ssm1]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.