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

Strange behaviour when using Text View

Strange behaviour when using Text View

On a simulation model, i have ~80+ components with naming pattern Components_1 ... _80 and i want to connect the input and output of the models with an array

Code:


RealInput u[80]
RealOutput y[80]

from Modelica.Blocks.Interfaces.

To speed things, i wrote a python script that output the equation to assign component's i/o to array i/o on a text file, and i only need to copy-paste it in text view.

the strange thing is, it works with the connection between component's input and RealInput but not with the outputs

Code:


Model Foo
  C Component_1,...,Component_80;
  RealInput u[80];
  RealOutput y[80];

equation
  Component_1.u = u[1];
  ...
  Component_80.u = u[80];

  Component_1.y = y[1];
  ...
  Component_80.y = y[80];

  //Note that all connections above are copied-pasted from a text file
end Foo;

the translation error is saying something like "Component_1.y variable is not exist". But if i wrote the equation manually for Component_1.y, the error message would than said that "Component_2.y is not exist". So what i understand is, i have to write all the connection manually.

i find this behaviour is very strange. Any Idea what happend here?

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