Message Boards Message Boards

0
|
6715 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Generate a model with 14 state variables with WSMCreateModel?

Dear colleagues I have used WSMCreateModel frequently and had not found any problem. Nevertheless, while trying to generate a model with 14 state variables, 14 inputs and 4 outputs the model will not be generated, is there a limit in dimensions in the WSMCreateModel??.

Could anyone give a clue about why is this not working in this case? Regards Jesus

Here, it is my model

WSMCreateDataModel["TestModel", 
 StateSpaceModel[{{{-5., 0., 0., 0., 0., 0., -188496., -2500., 0., 0.,
      0., 0., -1591.55, 0}, {0., -5., 0., 0., 0., -125664., 0., 
     0., -2500., 0., 0., -1061.03, 0, 1591.55}, {0., 0., -5., 
     0., -62831.9, 0., 0., 0., 0., -2500., 0., 0., 2122.07, 0.}, {0., 
     0., 0., -5., 0., 0., 0., 0., 0., 0., -2500., 3183.1, 0., 
     1061.03}, {0., 0., 62831.9, 0., -5., 0., 0., 0., -1061.03, 0., 
     1591.55, -2500., 0., 0.}, {0., 125664., 0., 0., 0., -5., 
     0., -1591.55, 0, 2122.07, 0., 0., -2500., 0.}, {188496., 0., 0., 
     0., 0., 0., -5., 0, 1591.55, 0., 530.516, 0., 
     0., -2500.}, {2500., 0., 0., 0., 0., 1591.55, 0, -400., 0, 0, 0, 
     0, 0, -188496.}, {0., 2500., 0., 0., 1061.03, 0, -1591.55, 
     0, -400., 0, 0, 0, -125664., 0}, {0., 0., 2500., 0., 
     0., -2122.07, 0., 0, 0, -400., 0, -62831.9, 0, 0}, {0., 0., 0., 
     2500., -3183.1, 0., -1061.03, 0, 0, 0, -400., 0, 0, 0}, {0., 
     1061.03, 0., -1591.55, 2500., 0., 0., 0, 0, 62831.9, 0, -400., 0,
      0}, {1591.55, 0, -2122.07, 0., 0., 2500., 0., 0, 125664., 0, 0, 
     0, -400., 0}, {0, -1591.55, 0., -530.516, 0., 0., 2500., 188496.,
      0, 0, 0, 0, 0, -400.}}, {{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0}, {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 
     0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 
     0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 
     0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 
     0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}, {{0,
      0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0}, {0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}, {{\[ScriptX]1[t], 
    0}, {\[ScriptX]2[t], 0}, {\[ScriptX]5[t], 0}, {\[ScriptX]6[t], 
    0}, {\[ScriptX]7[t], 0}, {\[ScriptX]8[t], 0}, {\[ScriptX]9[t], 
    0}, {\[ScriptX]10[t], 0}, {\[ScriptX]11[t], 0}, {\[ScriptX]12[t], 
    0}, {iL[t], 0}, {vc[t], 0}, {\[ScriptX]3[t], 0}, {\[ScriptX]4[t], 
    0}}, {{Subscript[u, 1][t], 0}, {Subscript[u, 2][t], 
    0}, {Subscript[u, 3][t], 0}, {Subscript[u, 4][t], 
    0}, {Subscript[u, 5][t], 0}, {Subscript[u, 6][t], 
    0}, {Subscript[u, 7][t], 0}, {Subscript[u, 8][t], 
    0}, {Subscript[u, 9][t], 0}, {Subscript[u, 10][t], 
    0}, {Subscript[u, 11][t], 0}, {Subscript[u, 12][t], 
    0}, {Subscript[u, 13][t], 0}, {Subscript[u, 14][t], 0}}, 
  Automatic, t, SamplingPeriod ->None, SystemsModelLabels -> None]]
2 Replies

Hello!

The function WSMCreateDataModel is used to create Modelica blocks which contain values or time-value pairs.

Try instead WSMCreateModel. That is the function you want to use when you want to export equations, transfer functions or statespace models from Mathematica to SystemModeler! When I replaced WSMCreateDataModel in your code with WSMCreateModel, a model was generated in SystemModeler.

Hope that helps!

POSTED BY: Patrik Ekenberg

Patrick, I apologize that was a silly mistake indeed. I spent hours trying to get it work with the wrong function! Thanks

J. Rico

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