Skip to content

Optimization of Dynamic Step Size #156

@teubert

Description

@teubert

Consider optimization of Dynamic Step Size feature so function isn't called when dt is a constant. For example:

# configuring next_time function to define prediction time step, default is constant dt
if callable(config['dt']):
    next_time = config['dt']
    # Simulate
    while t < horizon:
        dt = next_time(t, x)
        t += dt
        # Logic to simulate below
else:
    dt = config['dt']  # saving to optimize access in while loop
    # Simulate
    while t < horizon:
        t += dt
        # Logic to simulate below

Try out implementation and benchmark. It adds complexity/duplicated code, so I want to make sure it's worth it first.

Came out of discussion with @kjjarvis

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions