- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Flattening & FMU
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:
- Qualified (i.e. dot-separated) variable names;
- Multi quote annotations (e.g. "anno_1" "anno_2"
- Unresolved "+ -" arithmetic constructs
- <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
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
- wbraun
- 75 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Flattening & FMU