0
votes

My model is currently roughly 2000 equations, and the simulation period is a couple of weeks. I'm using the OpenModelica Connection Editor.

The problem I'm facing is the huge amount of output variables, and I've had the plot window crash a couple of times.

The question is, therefore, how can I reduce the number of output variables?

I'm only really interested in 20-50 of them. I'm aware that I can remove parameter output by making them protected, but I haven't been able to locate any similar tricks for variables.

2

2 Answers

1
votes

If you are simulating the model via command line then take a look at variableFilter argument of simulate command https://build.openmodelica.org/Documentation/OpenModelica.Scripting.simulate.html.

If you are using OMEdit then Simulation->Simulation Setup->Output->Variable Filter (Optional)

0
votes

Actually, protected isn't limited to parameters. Here's an example duplicating Modelica.Mechanics.Translational.Examples.SignConvention and protecting everything but mass1 Tested in Dymola 2017FD01 with pedantic mode (so it should work in OpenModelica as well); it works fine, and gives only mass1 parameters and variables in the simulation results

model SignConvention "Examples for the used sign conventions."
 extends Modelica.Icons.Example;
 Modelica.Mechanics.Translational.Components.Mass mass1(
   L=1,
   s(fixed=true),
   v(fixed=true),
   m=1) a;

protected
 Modelica.Mechanics.Translational.Sources.Force force1
   a;
 Modelica.Blocks.Sources.Constant constant1(k=1) a;
 Modelica.Mechanics.Translational.Components.Mass mass2(
   L=1,
   s(fixed=true),
   v(fixed=true),
   m=1) a;
 Modelica.Mechanics.Translational.Sources.Force force2
   a;
 Modelica.Blocks.Sources.Constant constant2(k=1) a;
 Modelica.Mechanics.Translational.Components.Mass mass3(
   L=1,
   s(fixed=true),
   v(fixed=true),
   m=1) a;
 Modelica.Mechanics.Translational.Sources.Force force3(useSupport=true)
   a;
 Modelica.Blocks.Sources.Constant constant3(k=1) a;
 Modelica.Mechanics.Translational.Components.Fixed fixed
   a;

equation
...