5
$\begingroup$

Fixed in 10.1


I must be doing something wrong, but do not see it. There is an option in Mathematica control system function StateSpaceModel where one asks it to generate the state space model in the ControllableCompanion form. This should produce state space A,B,C,D where the B matrix (for one input) will have zeros except for one entry, as shown in the above link. Here is screen shot:

Mathematica graphics

But when I try this on a proper transfer function, I do not get this form.

The problem only shows up when I enter the system as differential equation. If I enter the system directly as transfer function, then I do get the correct form.

Below, the I enter the differential equation, ask for SS, it is not controllable form. Yet, the transfer function is correct. If I take the transfer function generated, and ask for SS, now the state space show up in controllable form.

tf=TransferFunctionModel[{{(4+2s+3 s^2+4 s^3)/(-7-2 s+6 s^2+s^3)}},s];
ss = StateSpaceModel[tf, StateSpaceRealization -> "ControllableCompanion"]

Mathematica graphics

The above is correct. Now trying from the differential equation itself, which has the above transfer function:

eq=y'''[t] +6 y''[t] -2 y'[t] -7 y[t]== 4 u'''[t] + 3 u''[t] + 2 u'[t] + 4 u[t];
ss = StateSpaceModel[{eq}, {{y'''[t], 0}, {y''[t], 0}, {y'[t], 0}, {y[t], 0}}, 
    {{u[t], 0}}, {y[t]}, t, StateSpaceRealization -> "ControllableCompanion"]

Mathematica graphics

Lets check to see if the above ODE has the same TF as before:

 Simplify@TransferFunctionModel[ss]

Mathematica graphics

It is the same. So when entering the system as DE, I do not get the controllable form. But same system entered as TF gives the the controllable form.

Any one sees what I am doing wrong? Mathematica 10.0.0 on windows 7

$\endgroup$
2
  • $\begingroup$ I havn't checked this, but at the first you have 3 outputs (32, 10, -21) while you have just one in the second (1, 0, 0). There might be the problem. $\endgroup$
    – Phab
    Sep 18, 2014 at 10:03
  • 1
    $\begingroup$ The StateSpaceRealization option was being ignored since v8 (and probably in CSP as well.) The fix should be in the next release. $\endgroup$ Oct 1, 2014 at 21:31

1 Answer 1

1
$\begingroup$

This has been fixed in 10.1 (looks like it was fixed since 10.0.2) Hence closing.

Mathematica graphics

eq = y'''[t] + 6 y''[t] - 2 y'[t] - 7 y[t] == 4 u'''[t] + 3 u''[t] + 
2 u'[t] + 4 u[t];
ss = StateSpaceModel[{eq}, {{y'''[t], 0}, {y''[t], 0}, {y'[t], 0}, 
   {y[t], 0}}, {{u[t], 0}}, {y[t]}, t, 
  StateSpaceRealization -> "ControllableCompanion"]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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