Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support simulations via FMI #19

Open
kdavies4 opened this issue Jun 13, 2014 · 7 comments
Open

Support simulations via FMI #19

kdavies4 opened this issue Jun 13, 2014 · 7 comments
Assignees

Comments

@kdavies4
Copy link
Owner

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

@kdavies4 kdavies4 changed the title Simulate via FMI Support simulations via FMI Jun 13, 2014
@kdavies4
Copy link
Owner Author

Will be supported via a context manager: modelicares.exps.simulators.fmi

@arnoutaertgeerts
Copy link
Collaborator

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. 3f22fdc

If we need some other features, let me know!

@kdavies4
Copy link
Owner Author

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.

@kdavies4
Copy link
Owner Author

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!

@kdavies4
Copy link
Owner Author

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.

@arnoutaertgeerts
Copy link
Collaborator

The AttributeError was due to a different version of the FMU, not of PyFMI. I fixed this in 1e0027f.

@kdavies4
Copy link
Owner Author

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants