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
  • Index
  • » Users
  • » Sebsen
  • » Profile

Posts

Posts

It works!
Thanks!

Hi,
I am a Windows OpenModelica user and I have the following problem: I have an instance of a class declared with an array (A a[1]). Within the instaciated class I call a function which returns one value of an array of a record. If the array size in the record is smaller or equal than 19, there is no problem. If the array size is greater 19 an unknown error occurs. The model code:

Code:



model FrameTest
// --- MAIN CLASS ---

  Element element[1]; 
end FrameTest;

//############################################################################################################

model Element
  Profile profile;
  Real angle;                             
equation
  angle = funct(alpha=profile.alpha);
end Element;

//############################################################################################################

function funct
  input Real[:] alpha;                     
  output Real cOut;                         
algorithm
  cOut:= alpha[5];
end funct;

//############################################################################################################

record Profile
  parameter Real alpha[20]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0};
  //parameter Real alpha[19]={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0};
end Profile;

Thanks for your help,

Sebastian

I also tested some other examples from MultiBody and got similar error messages. I thought that MultiBody is supperted with OM, isnt`t it?

Hi,
I am a Windows OpenModelica user (just installed OM 1.61), and I get this error message when I try to simulate the pendulum example from the Modelica library:

Unable to simulate the Model 'Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum'
Following Error has occurred.

Code:

 Simulation failed for model: Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum

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

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

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

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

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

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

Error: Model is structurally singular, error found sorting equations Array eqn no: 6 for variables: rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1];
Array eqn no: 6 for variables: rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1];
Array eqn no: 6 for variables: rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1];
rev.R_rel.w[3] = rev.w * rev.e[3];
rev.R_rel.w[2] = rev.w * rev.e[2];
rev.R_rel.w[1] = rev.w * rev.e[1];
rev.R_rel.T[3,3] = rev.e[3] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[3] ^ 2.0);
rev.R_rel.T[3,2] = rev.e[3] * rev.e[2] + cos(rev.phi) * ((-rev.e[3]) * rev.e[2]) - sin(rev.phi) * rev.e[1];
rev.R_rel.T[3,1] = rev.e[3] * rev.e[1] + cos(rev.phi) * ((-rev.e[3]) * rev.e[1]) - (-sin(rev.phi)) * rev.e[2];
rev.R_rel.T[2,3] = rev.e[2] * rev.e[3] + cos(rev.phi) * ((-rev.e[2]) * rev.e[3]) - (-sin(rev.phi)) * rev.e[1];
rev.R_rel.T[2,2] = rev.e[2] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[2] ^ 2.0);
rev.R_rel.T[2,1] = rev.e[2] * rev.e[1] + cos(rev.phi) * ((-rev.e[2]) * rev.e[1]) - sin(rev.phi) * rev.e[3];
rev.R_rel.T[1,3] = rev.e[1] * rev.e[3] + cos(rev.phi) * ((-rev.e[1]) * rev.e[3]) - sin(rev.phi) * rev.e[2];
rev.R_rel.T[1,2] = rev.e[1] * rev.e[2] + cos(rev.phi) * ((-rev.e[1]) * rev.e[2]) - (-sin(rev.phi)) * rev.e[3];
rev.R_rel.T[1,1] = rev.e[1] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[1] ^ 2.0);
for variables rev.phi(49), rev.w(48), rev.R_rel.T[1,1](46), rev.R_rel.T[1,2](45), rev.R_rel.T[1,3](44), rev.R_rel.T[2,1](43), rev.R_rel.T[2,2](42), rev.R_rel.T[2,3](41), rev.R_rel.T[3,1](40), rev.R_rel.T[3,2](39), rev.R_rel.T[3,3](38), rev.R_rel.w[1](37), rev.R_rel.w[2](36), rev.R_rel.w[3](35),
Error: Model is structurally singular, error found sorting equations Array eqn no: 6 for variables: rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1];
Array eqn no: 6 for variables: rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.w[3], rev.R_rel.w[2], rev.R_rel.w[1], rev.R_rel.T[3,3], rev.R_rel.T[3,2], rev.R_rel.T[3,1], rev.R_rel.T[2,3], rev.R_rel.T[2,2], rev.R_rel.T[2,1], rev.R_rel.T[1,3], rev.R_rel.T[1,2], rev.R_rel.T[1,1];
rev.R_rel.w[3] = rev.w * rev.e[3];
rev.R_rel.w[2] = rev.w * rev.e[2];
rev.R_rel.w[1] = rev.w * rev.e[1];
rev.R_rel.T[3,3] = rev.e[3] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[3] ^ 2.0);
rev.R_rel.T[3,2] = rev.e[3] * rev.e[2] + cos(rev.phi) * ((-rev.e[3]) * rev.e[2]) - sin(rev.phi) * rev.e[1];
rev.R_rel.T[3,1] = rev.e[3] * rev.e[1] + cos(rev.phi) * ((-rev.e[3]) * rev.e[1]) - (-sin(rev.phi)) * rev.e[2];
rev.R_rel.T[2,3] = rev.e[2] * rev.e[3] + cos(rev.phi) * ((-rev.e[2]) * rev.e[3]) - (-sin(rev.phi)) * rev.e[1];
rev.R_rel.T[2,2] = rev.e[2] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[2] ^ 2.0);
rev.R_rel.T[2,1] = rev.e[2] * rev.e[1] + cos(rev.phi) * ((-rev.e[2]) * rev.e[1]) - sin(rev.phi) * rev.e[3];
rev.R_rel.T[1,3] = rev.e[1] * rev.e[3] + cos(rev.phi) * ((-rev.e[1]) * rev.e[3]) - sin(rev.phi) * rev.e[2];
rev.R_rel.T[1,2] = rev.e[1] * rev.e[2] + cos(rev.phi) * ((-rev.e[1]) * rev.e[2]) - (-sin(rev.phi)) * rev.e[3];
rev.R_rel.T[1,1] = rev.e[1] ^ 2.0 + cos(rev.phi) * (1.0 - rev.e[1] ^ 2.0);
for variables rev.phi(49), rev.w(48), rev.R_rel.T[1,1](46), rev.R_rel.T[1,2](45), rev.R_rel.T[1,3](44), rev.R_rel.T[2,1](43), rev.R_rel.T[2,2](42), rev.R_rel.T[2,3](41), rev.R_rel.T[3,1](40), rev.R_rel.T[3,2](39), rev.R_rel.T[3,3](38), rev.R_rel.w[1](37), rev.R_rel.w[2](36), rev.R_rel.w[3](35),
Error: Model is structurally singular, error found sorting equations $DER.body.frame_a.r_0[3] = 0.0;
for variables $DER.body.frame_a.r_0[3](77),

I haven`t changed anything in the model. When using Dymola, everything is going fine. What I am doing wrong? Thanks for your help,

Sebastian

  • Index
  • » Users
  • » Sebsen
  • » Profile
You are here: