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
  • Index
  • » Users
  • » MartinK
  • » Profile

Posts

Posts

I updated today to the latest nightly build and got the same issues.

I think you are right about the aliases. I now take the standard option ".*" in advance and look inside the name variable in the .mat file to know which of the variables i can use.

I think i will build a new outputVar Block which i can place inside the model and parse the result with an regex expression.

But there is one question left.

Is there a max. file size for the .mat file?

I only found a restriction for .mat 7.3 which means there is a 2GB limit.

How is this in open modelica?

Hi everyone.

I tried a lot with the option variableFilter..

i took a very simple example model to try different settings.

The model and the script are as followed:

model:

model testVarFilter
  Modelica.Blocks.Sources.Sine sine(amplitude=5,freqHz=10,offset=5,startTime=0);
  Modelica.Mechanics.Rotational.Sources.Torque torque1;
  Modelica.Mechanics.Rotational.Components.Inertia inertia1(J=0.001);
  Modelica.Mechanics.Rotational.Components.SpringDamper springDamper(c=5000, d=0.5);
  Modelica.Mechanics.Rotational.Components.Inertia inertia2(J=1);
equation
  connect(sine.y, torque1.tau);
  connect(torque1.flange, inertia1.flange_a);
  connect(inertia1.flange_b, springDamper.flange_a);
  connect(springDamper.flange_b, inertia2.flange_a);
end testVarFilter;

mos Script:

loadModel(Modelica);
loadFile("testVarFilter.mo");
instantiateModel(testVarFilter);
simulate(testVarFilter,startTime=0, stopTime=1, numberOfIntervals=100, variableFilter="VARIABLE");

I tired to set
VARIABLE = inertia2\\.w and got it into the mat File on second row in data2 below the time variable,
VARIABLE = inertia1\\.w and there was only time in the mat file.

Same result without the \\ because "." can be any sign.

So i think it's not about the syntax. Has anyone an idea why that command behaves like this?

Also i tried to set more than one Variable with the pipe sign.
VARIABLE = inertia2\\.phi|inertia2\\.w  worked as it should.

I just don't understand why some of the Variables aren't stored with the same syntax. (like: springDamper\\.flange\\_b\\.tau, inertia1\\.w , sine\\.y, ...)

I think i got the meaning of regex. I tried different methods to describe the string for a variable but I couldn't get the desired variable stored to the .mat file.

could you give me an example what it should look like to get the variable " dynometerController.DynoSetTorque " .

I tried this:

simulate(tModelicaLib.TestBeds.I4T_Testbed_V2,startTime=0, stopTime=2, numberOfIntervals=20000, variableFilter="\QdynometerController.DynoSetTorque\E")
record SimulationResult
    resultFile = "C:/Work/Diplomarbeit/DA_MK/Src/Modelica_Tests/Test_I4Testbed_V2/tModelicaLib.TestBeds.I4T_Testbed_V2_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 2.0, numberOfIntervals = 20000, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'tModelicaLib.TestBeds.I4T_Testbed_V2', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '\\\\QdynometerController.DynoSetTorque\\\\E', measureTime = false, cflags = ''",

It's not clear for me why the answer to my simulate command for variableFilter with "\Q ... \E" leads to "\\\\Q ... \\\\E"

I tried using the variableFiler option in the simulate command with the whole name of the variable but the simulation won't run.

I have to say that I am a newby to programming. How is the syntax to get a correct statement?

I used :

simulate(tModelicaLib.TestBeds.I4T_Testbed_V2,startTime=0, stopTime=5, numberOfIntervals=50000, variableFilter="CV15Shaft.Damper.flange_b.phi");

but i get this error:

Assertion failed: it != indx_parammap.end(), file simulation_result_mat.cpp, line 397

Thanks for the quick reply! I will try it with this filtering!

Hallo,

i'm now working on my master thesis with OM. I am building a testbed for a gasoline engine to simulate the torsional vibration behaviour of the drive shaft system.

To get correct excitation in the engine cylinder i have to use a sample time of 10kHz, because I have to use cylinder pressure data from a 3D Interpolation. So the result file is very big for long test runs (>1GB).

Now to my problem. My model finishes only until a certain .mat file size at approx. 800mb successfully. When i increase the simulation time it fails and when i decrease the simulation time it works.

Is there an upper limit for the .mat result file? I tried different test runs but never got past these 800mb

I tried to find a way to exclude protected variables (like in Dymola) but didn't find anything.

I am now on OM 1.8.0 stable released.

  • Index
  • » Users
  • » MartinK
  • » Profile
You are here: