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

Add FMU participants to oscillator tutorial #466

Merged
merged 42 commits into from
Mar 15, 2024

Conversation

uekerman
Copy link
Member

@uekerman uekerman commented Feb 21, 2024

v3-compatible replacement of #322
Using my own branch to have write access, instead of #465

Ready for review. Should work with the main branch of the FMI Runner (v0.2.0 will be released before merging here).

Does still ignore #461. I would suggest to do the oscillator after merging here. Otherwise, things get complicated here.

I ran the cases with the precompiled FMU, I did not try to recompile on any other system. @LeonardWilleke compiled the FMU.

The FMU cases give a higher error than the Python implementation (but converge for smaller time step sizes). We still don't understand why exactly IIRC, but this is consistent with the thesis and paper from @LeonardWilleke.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running this tutorial, but I faced some configuration issue, which should be easy to fix.

In terms of structure, it needs some changes to address #461, but this can happen in a follow-up.

oscillator/README.md Outdated Show resolved Hide resolved
oscillator/README.md Show resolved Hide resolved
oscillator/fmi/Oscillator.fmu Outdated Show resolved Hide resolved
oscillator/fmi/fmu/Oscillator/FMI1CS.xml Outdated Show resolved Hide resolved
oscillator/fmi/fmu/Oscillator/readme.html Outdated Show resolved Hide resolved
oscillator/fmi/fmu/README.md Show resolved Hide resolved
oscillator/fmi/run.sh Outdated Show resolved Hide resolved
@uekerman
Copy link
Member Author

I can now run FMI2 and FMI3 with the newest version of FMpy 0.3.20 and also all plotting options.

Ready to merge from my perspective.

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can now also run and plot the results. Almost ready, I just thought we could remove a few potentially unused files and options (see comments).

oscillator/fmi/fmu/include/FMI1.h Outdated Show resolved Hide resolved
oscillator/fmi/fmu/Oscillator/FMI2.xml Show resolved Hide resolved
@MakisH
Copy link
Member

MakisH commented Mar 15, 2024

Note that if I execute the left with FMI and right with Python, visualizing with

python3 plot-trajectory.py fmi/output/trajectory-Mass-Left.csv TRAJECTORY

gives me this plot:

trajectory-mass-left-fmi-right-python

If I execute the left with Python and right with FMI, visualizing with

python3 plot-trajectory.py python/output/trajectory-Mass-Left.csv TRAJECTORY

gives me this plot:

trajectory-mass-left-python-right-fmi

fmi-fmi gives me the same as python-python:

fmi-fmi

I have not looked into the details, I am just raising this in case it looks strange.

@uekerman
Copy link
Member Author

The different trajectories look like numerical features to me. Depends on which timestepping methods are used and combined. Playing around with WI, we should be able to remove the instability, but that's beyond this PR.

@MakisH MakisH merged commit fc65893 into precice:develop Mar 15, 2024
1 check passed
MakisH added a commit that referenced this pull request Mar 24, 2024
Not fully merged in #466
Related to #461
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

Successfully merging this pull request may close these issues.

None yet

4 participants