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

array definition

array definition

the purpose of this model is to provide the indexed elements of the "vector" array the values of the array "tester", which are increasing numbers from 1 to 12.
This shall happen every time the BooleanPulse is true. The arrays are indexed by the Integer "counter", which increases by 1 every boolean pulse.

the model simulates but gives every "vector" element the value 0. also the warning message is "Failed to solve linear system of equations (no. 21) at time 0.000000. Residual norm is 0.5."

model Array_Test_simple
Real vector[12];
Integer counter;
Real tester[12]=1:1:12;
  Modelica.Blocks.Sources.BooleanPulse booleanPulse(period = 0.1)  annotation(
    Placement(visible = true, transformation(origin = {-62, 38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

initial algorithm

when booleanPulse.y then
end when;


    uses(Modelica(version = "4.0.0")));
end Array_Test_simple;

There are 0 guests and 0 other users also viewing this topic