AIDA is a study case for model based system engineering, made by MOISE project. This project contains the simulation model of AIDA (made with SimulationX in Modelica)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

54 lines
1.7 KiB

// CP: 65001
// SimulationX Version: 3.8.2.45319 x64
within AIDAModelica;
model Cosim_Sim_m
parameter Modelica.SIunits.Time Cosim_step(start=0.02);
parameter Boolean Cosim_activ=false;
parameter Integer N=1;
Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold1[N](samplePeriod=Cosim_step) annotation(Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Blocks.Logical.Switch logicalSwitch1[N] annotation(Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Blocks.Interfaces.RealInput u[N] annotation(Placement(
transformation(
origin={-74,8},
extent={{-20,-20},{20,20}}),
iconTransformation(
origin={-74,8},
extent={{-20,-20},{20,20}})));
Modelica.Blocks.Interfaces.RealOutput[N] y annotation(Placement(
transformation(
origin={78,6},
extent={{-10,-10},{10,10}}),
iconTransformation(
origin={85,13},
extent={{-17,-17},{17,17}})));
equation
for i in 1:N loop
connect(u[i], zeroOrderHold1[i].u) ;
logicalSwitch1[i].u2 = Cosim_activ;
connect(zeroOrderHold1[i].y, logicalSwitch1[i].u1) ;
connect(u[i], logicalSwitch1[i].u3) ;
connect(logicalSwitch1[i].y, y[i]) ;
end for;
annotation(
Icon(graphics={
Text(
textString="Discretisation par zero hold",
fillPattern=FillPattern.None,
extent={{-30,10},{90,-30}},
origin={-32,44}),
Line(
points={{-72,-28},{-54,-28},{-54,-6},{-34,-6},{-34,16},{-12,
16},{-12,-6},{12,-6},{12,-16},{32,-16},{32,28},{52,
28},{52,16},{72,16},{72,-2}},
origin={-2,-30}),
Text(
textString="Cosim port model",
fillPattern=FillPattern.None,
extent={{-23,8},{87,-28}},
origin={-35,80})}),
experiment(
StopTime=1,
StartTime=0,
Interval=0.002,
MaxInterval="0.001"));
end Cosim_Sim_m;