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

Improve Default Interval when using simulateCS #258

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

halentin
Copy link
Contributor

Currently, if the user doesnt pass saveat or dt to simulateCS, we fall back to dt=1e-3, which is a decent default value for short Simulations, but leads to really long simulation times for longer timespans (t_stop-t_start>10). When not provided with any arguments, i would expect the simulation environment to pick a more sensible default value. Both Dymola and FMPy do this by picking a dt so that the number of saved values is 500 (Dymola) or 500-1000 (FMPy). This PR copies the behaviour from FMPy.

As we dont have any other Files apart from sim.jl, i added auto_interval in there. Maybe it would make sense to put it in a new file like utils.jl or helpers.jl?

This could possibly be considered breaking because it somewhat changes the default behaviour?

@halentin
Copy link
Contributor Author

Note, that currently tests dont pass, because of an older version of BoundaryValueDiffEq failing precompilation, and the FMISensitivity-Test-Dependency blocking from updating to a newer version (that actually precompiles). The CS-Tests (they dont require FMISensitivity) are passing.

@ThummeTo
Copy link
Owner

ThummeTo commented Dec 2, 2024

Can you please add a line comment that links to the file within FMPy if code is reused?

@ThummeTo ThummeTo merged commit a584a5b into ThummeTo:main Dec 9, 2024
20 of 22 checks passed
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.

2 participants