I have used a .txt file (T_in1) as an input in a 2D-CombiTimeTable in Modelica. It contains an array with the size of (4,2); the first column is time and the second one is the time-dependent variable. I would like to sum or (to get an average of) the second column in every timestep. I would appreciate if there would be any help with this regard. The code is as follows:
model integration
import Modelica.Fluid.Types;
Modelica.Blocks.Sources.CombiTimeTable T_in1(
extrapolation=Modelica.Blocks.Types.Extrapolation.LastTwoPoints,
fileName="C:/Users/Tin1.txt",
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments,
tableName="tab1",
tableOnFile=true,
timeEvents=Modelica.Blocks.Types.TimeEvents.Always,
timeScale(displayUnit="min") = 60) annotation (
Placement(visible = true, transformation(origin={-61,32.2828}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
equation
for i in 1:3 loop
...
...
end for;
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
experiment(StopTime=240, __Dymola_Algorithm="Dassl"));
end integration;