Closed ivvaan closed 5 months ago
Each solver instance has an internal state (the last time t
and state y
), and successive calls to .run
start from the last time. So, you can do this:
solver = nbkode.ForwardEuler(func, t0, y0)
ts1, ys1 = solver.run([0., 5., 10.])
ts2, ys2 = solver.run([15., 20., 25.])
but you have to create a new instance to "restart" it:
solver = nbkode.ForwardEuler(func, t0, y0)
ts, ys = solver.run([0., 5., 10.])
solver = nbkode.ForwardEuler(func, t0, y0)
ts, ys = solver.run([0., 5., 10.])