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

fmpy/examples/custom_input.py with FMI3 #640

Open
autoantwort opened this issue Jan 20, 2024 · 2 comments
Open

fmpy/examples/custom_input.py with FMI3 #640

autoantwort opened this issue Jan 20, 2024 · 2 comments

Comments

@autoantwort
Copy link

First of all, thank you for this awesome project!

I found the example fmpy/examples/custom_input.py very helpful, but wanted to use a FMI 3.0 FMU and it seems that the API changed.
I propose to add another example that uses a FMI 3.0 FMU.

@wredsen
Copy link

wredsen commented Mar 20, 2024

I second this!
It would be very helpful to have a FMI 3.0 example, as I can't get sufficient information initializing such a FMU.

Best regards,
Konstantin

@greenwoodms06
Copy link

greenwoodms06 commented May 16, 2024

To get you started, I was able to just make a few simple swaps to my script for FMI2 (based on the custom_input.py file you mentioned). The items to change were:

  • fmi2.FMU2Slave to fmi3.FMU3Slave
  • Remove fmu.setupExperiment as that seems to have been removed.
  • setReal to setFloat64
  • getReal to getFloat64
  • Comment out derivative as that changed and I don't understand it yet.

You can find two FMI3 examples here.

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

No branches or pull requests

3 participants