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

The problems of FMU in Simulink #54

Open
HeisenbergDJ opened this issue May 21, 2024 · 1 comment
Open

The problems of FMU in Simulink #54

HeisenbergDJ opened this issue May 21, 2024 · 1 comment

Comments

@HeisenbergDJ
Copy link

Thank you for your code,

I used your Generator to create an FMU implementation and imported it into the Simulink canvas. Simulink prompted me to choose between Co-simulation and Model-exchange mode. I selected Model-exchange mode. However, during the simulation, I received the following message: 'TerminateSimulation' flag was set to true by FMU 'FMUDemo/FMU' during event iteration. Simulation will stop after the current time step at '0'. This seems to prevent the subsequent simulation from running correctly.

Could you please let me know in which part of the implementation code the 'TerminateSimulation' flag is set?

@ghorwin
Copy link
Owner

ghorwin commented Jul 10, 2024

Hi, sorry for the late reply, but I'm a litte busy in other projects.

Regarding the ModelExchange: the FMI CodeGenerator does not create any code that deals with the TerminateSimulation flag. In any case, could you pass the source code of your Demo-FMU for checking? Often, the TerminateSimulation flag is set by the ModelExchange master if the FMU has invalid/undefined behavior and thus fails to solve equations suitable for Jacobian matrix generation in the master solver.

Can you maybe provide a minimal example?

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

2 participants