Skip to content
Discussion options

You must be logged in to vote

@RemDelaporteMathurin Id say using the event system. The blocks have a Block.reset() method that, for the integrator, resets it to the initial state. You could trigger this with scheduled events. Right now, your example would require three separate events, because they are not evenly spaced like this:

from pathsim.blocks import Integrator
from pathsim.events import Schedule

#integrator with initial state of 10
itg = Integrator(10)

#callback that resets the integrator to initial state
def reset_itg():
    itg.reset()

#build single scheduled event for each event time
events = []
for t in [5, 10.1, 15]:
    events.append(
        Schedule(
            t_start=t,
            t_end=t,
     …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by RemDelaporteMathurin
Comment options

You must be logged in to vote
1 reply
@milanofthe
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@milanofthe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants