- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » FMU behaviour depending on library style
FMU behaviour depending on library style
FMU behaviour depending on library style
Since I am not sure if the following is a bug on the OpenModelica side, or just something which can be solved with some background knowledge, I post this question related to the trac https://trac.openmodelica.org/OpenModel … 160#ticket here, too.
We created a toolbox for the simulation of microgrids.
In the first run, everything was just written in a single ".mo" file, in this case grid.mo. Not really structured and pretty slow, since a really big file needs to be changed with every action.
The following file of a older branch shows the structure of the old model:
https://github.com/upb-lea/openmodelica-microgrid-gym/blob/feature_41_construction_branch/fmu/grid.mo
Later on, we followed the example of many other OpenModelica libraries, and made a library out of it, which is structured in many different files and folders, which are connected to each other. Way faster, tidier, and looks better.
The package.mo file opens the library:
https://github.com/upb-lea/openmodelica-microgrid-gym/tree/feature_75_library/OpenModelica_Microgrids
Problem:
Creating a FMU (2.0, ME) from both versions works totally fine, simulating it in python works with identical results, except one point:
After the strucure change, it is not possible to change parameters anymore via PyFMI. The value itself gets changed, which is visible by plotting the direct value (for example something like resistor1.R). But for the simulation results (like currents, voltages), the default value which was set in OpenModelica is used.
The main difference - at least for my point of view - is that not all ODEs are in the same folder, and something with the parametertransfer between the different folders goes wrong, but this is just an absolutely blind guess.
If anyone knows more about the topic, or even has a solution for us that we could keep on using the new, structured library, please let me know :-)
Best Regards!
Henrik
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » FMU behaviour depending on library style