Message Boards Message Boards

GROUPS:

Reproduce the StateSpaceModel example given in the documentation?

Posted 4 months ago
735 Views
|
3 Replies
|
3 Total Likes
|

I tried to reproduce an example from the documentation running M12 on Windows10 but failed to get same result:

eqns = {L i'[t] == Subscript[v, l][t], 
   Subscript[v, c]'[t] == 1/C i[t], R i[t] == Subscript[v, r][t],
   Subscript[v, l][t] + Subscript[v, c][t] + Subscript[v, r][t] == 
    Subscript[v, s][t]};
m2 = StateSpaceModel[
  eqns, {i[t], Subscript[v, l][t], Subscript[v, c][t], 
   Subscript[v, r][t]}, {Subscript[v, s][t]}, {i[t]}, t]

The result that I get looks like

enter image description here

Each of the grey squares represents a complicated expression which can be view im Mathematica while hovering over it. The representation of the state space model looks complete different compared to the one given in the documentation:

enter image description here

Any ideas?

3 Replies

Michael,

I agree it no longer works the same in V12. I reported the bug to Support.

If you do not do the Descriptor system and use one of the options for StateSpaceRealization, it works:

StateSpaceModel[eqns, {i[t], Subscript[v, l][t], Subscript[v, c][t], 
  Subscript[v, r][t]}, {Subscript[v, s][t]}, {i[t]}, t, 
 StateSpaceRealization -> "ControllableCompanion"]

Also, to view all of the StateSpaceModel terms, you can click on the "S" in the upper right corner and it will expand the gray squares.

Regards,

Neil

Posted 4 months ago

Thank you for your reply, I was not aware of the trick with clicking the the "S".

Best regards, Michael

Michael,

I forgot to mention that if you click it again, it will compress back to the gray squares. This also works on TransferFunctionModels. This feature is missing from the documentation -- I'll report the omission. We found it by accident.

Regards,

Neil

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract