ModelicaRes
ModelicaRes copied to clipboard
Support simulations via FMI
Use PyFMI; see http://www.os.is/gogn/Skyrslur/OS-2012/OS-2012-06/OS-2012-06-03.pdf and http://nbviewer.ipython.org/gist/saroele/e6f176ac0ff391e8982a
Will be supported via a context manager: modelicares.exps.simulators.fmi
Most of the implementation is done and works on Windows. I tried to stay as close as possible to your programming style of the dymosim
class. 3f22fdc9ed72967996352c82b9807483bf008dbd
If we need some other features, let me know!
I got the following error when I tried simulations.ipynb: AttributeError: 'pyfmi.fmi.FMUModelCS1' object has no attribute 'setup_experiment
I got a similar error with using ME instead of CS: AttributeError: 'pyfmi.fmi.FMUModelME1' object has no attribute 'setup_experiment'
When I commented out the self.fmu.setup_experiment()
line of exps.simulators.fmi.load
and generated a FMU with a binary for my platform, that IPython notebook worked. What do you think happened? Do we have different versions of PyFMI? I think I have version 2.0.
Otherwise, we mostly just need to clean things up (code, docstrings, examples). I need to do a sensitivity analysis (Morris method) using the exps module for my research. If that leads to any useful functions I'll add them. I'd like to release all this in a new version before the next Activity 1.4 mtg (mid to late Jan).
Good work!
Here's an idea: instead of internally storing memory_result
, run()
and continue_run()
could return the results as SimRes
instances. The best way might be to extend the pyfmi
results class (ResultBase
or JMResultBase
) on SimRes
, but that would require agreement from the PyFMI developers.
The AttributeError
was due to a different version of the FMU, not of PyFMI. I fixed this in 1e0027f0b6afaff75bd6dbaac0cc9b669bbb9a6d.
Great!