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

make model runs end at the time specified. #115

Open
amoodie opened this issue Dec 9, 2020 · 0 comments
Open

make model runs end at the time specified. #115

amoodie opened this issue Dec 9, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@amoodie
Copy link
Member

amoodie commented Dec 9, 2020

Currently, model runs specified with the time input to the high-level api do not end at the exact specified time. They get close, but it is inexact because the timestep is not necessarily a factor of the specified end time. One way to address this:

Just before entering the iteration-updating-while-loop, take the model calculated dt = deltamodel.dt and do whole = endtime // dt and rem = endtime % dt, then just set up a loop that runs whole times, and then a single update that sets deltamodel.dt = rem / deltamodel.dt and then runs one final deltamodel.update().

@amoodie amoodie added enhancement New feature or request good first issue Good for newcomers labels Dec 9, 2020
@amoodie amoodie added this to the Stable API milestone Dec 9, 2020
@amoodie amoodie added this to To do in Version 2.0 via automation Dec 9, 2020
@amoodie amoodie removed this from To do in Version 2.0 Mar 14, 2021
@amoodie amoodie removed this from the Stable API milestone Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant