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

Test FMI-CS simulation with CVODE #193

Open
casella opened this issue Feb 7, 2025 · 6 comments
Open

Test FMI-CS simulation with CVODE #193

casella opened this issue Feb 7, 2025 · 6 comments

Comments

@casella
Copy link
Collaborator

casella commented Feb 7, 2025

@adrpo, OpenModelica/OpenModelica#13582 shows that we probably have serious problems with non-trivial implementations of FMI-CS.

In principle, if we use stiff CVODE as internal solver and a co-simulation time step equal to the Interval annotation (or to the default 500 steps), all the simulations that run with the regular runtime and the stiff DASSL solver should also run successfully. If they don't, it means there's some problem in the internal implementation of the ODE solver in the CS FMU, which should be checked.

I would suggest that we add yet another FMI task where we generate FMI-CS with stiff CVODE and then use OMSimulator to simulate them. Could run once every week or something.

@bilderbuchi
Copy link

all the simulations that run with the regular runtime and the stiff DASSL solver should also run successfully

I guess you could extend that with "and give the same results up to a tolerance", to catch differences in solution behaviour caused by bugs in the FMI-CS implementation? Or is that too high a bar to clear (at first)?

@casella
Copy link
Collaborator Author

casella commented Feb 11, 2025

That was implicit. The CI infrastructure always compares the simulation results if they are provided. Thanks for making that clear.

However, I guess there could be problems verifying the results of models with events, since FMI-CS won't report the additional time points where events take place, I guess.

@bilderbuchi
Copy link

bilderbuchi commented Feb 12, 2025

since FMI-CS won't report the additional time points where events take place, I guess.

(Disclaimer: I'm still not familiar enough with FMI to answer this confidently myself)
It's unclear to me if you mean that this is a FMI limitation or an OM/tool limitation?
It looks to me to be the latter, as the bouncing ball example at the end of https://fmi-standard.org/docs/3.0.2/#_event_mode seems to very much suggest that additional time points at events are in fact reported.
Or is that an FMI3-only thing?

@adrpo
Copy link
Member

adrpo commented Feb 12, 2025

Or is that an FMI3-only thing?

Yes, that is only FMI3, in FMI2 one reports the events at the end of the doStep.

@casella
Copy link
Collaborator Author

casella commented Feb 12, 2025

@casella
Copy link
Collaborator Author

casella commented Feb 12, 2025

We'll get there, eventually. We are already implementing some FMI 3.0.x features, but we also still need to make sure that FMI 2.0.4 export works well.

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