Skip to content

make model runs end at the time specified. #115

Open
@amoodie

Description

@amoodie

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions