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

Is it possible to run subsystems with for loop in an executive model ?

Is it possible to run subsystems with for loop in an executive model ?

Hello,
I want to run several identical models at once.As of now I am doing it like this:

model ExecuteBalance

  //reactor1
  InletFlow Inflow(Num = 1);
  CoolingJacket Cool(Num = 1);
  ReactionTemperature Reac;
  //reactor2
  InletFlow Inflow_2(Num = 1);
  CoolingJacket Cool_2(Num = 1);
  ReactionTemperature Reac_2;
  //shared resources
  EductVessel Educt(Num = 2);
  CoolReservoir Reserv(Num = 2);

equation
  connect(Inflow.port, Reac.port_Inlet);
  connect(Cool.port, Reac.port_Jacket);
  connect(Inflow_2.port, Reac_2.port_Inlet);
  connect(Cool_2.port, Reac_2.port_Jacket);
  connect(Educt.mol.n[1], Inflow.mol_port.n[1]);
  connect(Educt.mol.n[2], Inflow_2.mol_port.n[1]);
  connect(Reserv.mass.m[1], Cool.mass.m[1]);
  connect(Reserv.mass.m[2], Cool_2.mass.m[1]);
end ExecuteBalance;

My question is : Is it possible to run and save those submodels for the reactors in a for loop to keep the model more variable or do I have to call each model on its own?
Help would be much appreciated as I can't find anithing related to it. Thanks a lot

Edited by: ArtBCI - Oct-23-14 10:53:31
There are 0 guests and 0 other users also viewing this topic
You are here: