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

Flattening & FMU

Flattening & FMU

Two questions puzzle me:

1) Why can't the omc compiler compile a flattened file that itself has created? I found the following language aspects (in the flattened file) causing parsing errors:


  1. Qualified (i.e. dot-separated) variable names;

  2. Multi quote annotations (e.g. "anno_1" "anno_2"

  3. Unresolved "+ -" arithmetic constructs

  4. <matrix> constructs (what are these..., I can't find information on this Modelica language feature..>?)


2) Given a simple Modelica model (more specifically the DAEexample), I generate an FMU, DAEexample.fmu. With the following DAE.mos file

importFMU("DAEexample.fmu", "DAEexample.out");
instantiateModel(DAEexample);
simulate(DAEexample,startTime=0,stopTime=10);

I try to simulate (omc +showErrorMessages DAE.mos) the example. I then obtain the following error:

true
""
"Unknown model.
"
""
{"Error: Class OpenModelica.Scripting.simulate not found in scope <global scope> (looking for a function or record).", "TRANSLATION", "Error", "3"}
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'DAEexample', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "Simulation Failed. Model: DAEexample does not exists! Please load it first before simulation.",
    timeFrontend = 0.0,
    timeBackend = 0.0,
    timeSimCode = 0.0,
    timeTemplates = 0.0,
    timeCompile = 0.0,
    timeSimulation = 0.0,
    timeTotal = 0.0
end SimulationResult;
""
Apparently, the model is not loaded. How can I do this? Thanks!

-- Henk

Edited by: henk - Mar-28-12 18:11:12

Re: Flattening & FMU

Hi,

some notes to the second question.

The import function shoupd be used as following:

Code:

importFMU("DAEexample.fmu");

Now a Modelica model ist created that is called:
DAEexampleFMUImport.mo


So if you want to simulate it you need to load that file.

Code:

loadFile("DAEexampleFMUImport.mo");

That file contain a package that is called "FMUImport_DAEexample"
and this package contain a FMUBlock that can be simulated.

Code:

simulate(FMUImport_DAEexample.FMUBlock);

I hope that help a bit.

so long.
Willi

There are 0 guests and 0 other users also viewing this topic