Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Modeling mistake / modelica error: "Maximum number of states exceeded"

Modeling mistake / modelica error: "Maximum number of states exceeded"

I made a model of a bodyshape of which frame_a is connected to the world via two prismatic joints and one spherical joints. These joints are serial. There are 5 degrees of freedom. See the model at http://dl.dropbox.com/u/720632/joints.mo (the upload functionality of this forum doesn't work).

I get some warnings when simulating the model in OpenModelica and SimulationX doesn't even simulate it (it says "The maximum number of states was exceeded").

The openmodelica warnings are:

Check of joints completed successfully.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/Joints.mo:1322:5-1325:115:writable] Warning: Variable spherical1.Q: Non-array modification 'if spherical1.enforceStates and spherical1.useQuaternions then StateSelect.prefer else StateSelect.never' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/Joints.mo:1333:5-1335:57:writable] Warning: Variable spherical1.phi: Non-array modification 'if spherical1.enforceStates and not spherical1.useQuaternions then StateSelect.always else StateSelect.never' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/Joints.mo:1336:5-1338:19:writable] Warning: Variable spherical1.phi_d: Non-array modification 'if spherical1.enforceStates and not spherical1.useQuaternions then StateSelect.always else StateSelect.never' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/Joints.mo:1342:5-1346:99:writable] Warning: Variable spherical1.w_rel: Non-array modification 'if spherical1.enforceStates and spherical1.useQuaternions then StateSelect.always else StateSelect.never' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:975:5-978:76:writable] Warning: Variable bodyshape1.r_0: Non-array modification 'if bodyshape1.enforceStates then StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:979:5-982:76:writable] Warning: Variable bodyshape1.v_0: Non-array modification 'if bodyshape1.enforceStates then StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:600:5-603:76:writable] Warning: Variable bodyshape1.body.r_0: Non-array modification 'if bodyshape1.body.enforceStates then StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:604:5-607:76:writable] Warning: Variable bodyshape1.body.v_0: Non-array modification 'if bodyshape1.body.enforceStates then StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:682:5-686:65:writable] Warning: Variable bodyshape1.body.w_a: Non-array modification 'if bodyshape1.body.enforceStates then if bodyshape1.body.useQuaternions then StateSelect.always else StateSelect.never else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:697:5-700:119:writable] Warning: Variable bodyshape1.body.Q: Non-array modification 'if bodyshape1.body.enforceStates then if bodyshape1.body.useQuaternions then StateSelect.prefer else StateSelect.never else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:708:5-711:69:writable] Warning: Variable bodyshape1.body.phi: Non-array modification 'if bodyshape1.body.enforceStates then if bodyshape1.body.useQuaternions then StateSelect.never else StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

[C:/OpenModelica1.8.0/lib/omlibrary/Modelica 3.1/Mechanics/MultiBody/parts.mo:712:5-714:42:writable] Warning: Variable bodyshape1.body.phi_d: Non-array modification 'if bodyshape1.body.enforceStates then if bodyshape1.body.useQuaternions then StateSelect.never else StateSelect.always else StateSelect.avoid' for array component, possibly due to missing 'each'.

Could you give a hint what I did wrong?

Re: Modeling mistake / modelica error: "Maximum number of states exceeded"

You have done nothing wrong, these warnings are because the Modelica Standard Library is missing the 'each' keyword where it should have been used. OMC will print a warning about this, but continue as if the 'each' keyword had in fact been used so that the MSL works. You can thus safely ignore these warnings, they are caused by the authors of the MSL and not you.

Re: Modeling mistake / modelica error: "Maximum number of states exceeded"

Thank you for your explanation! Is this then also the reason that SimulationX refuses to simulate this model?

Re: Modeling mistake / modelica error: "Maximum number of states exceeded"

I don't know, but the message seems to imply that SimulationX has some limit on how many state variables you can have. Are you perhaps using a trial version of SimulationX? In that case it's probably a restriction built in that stops you from simulating large models without buying a license.

Re: Modeling mistake / modelica error: "Maximum number of states exceeded"

Yes, I am using the Student Edition. It would be quite sad if even models of 5 or 6 blocks would be restricted...

I'll look into it, thanks!

There are 0 guests and 0 other users also viewing this topic
You are here: