From 96e5ea4880dfacdf1a018a6279660810b4eab44b Mon Sep 17 00:00:00 2001 From: Rob Clewley Date: Sat, 16 Sep 2017 23:30:18 -0400 Subject: [PATCH] Fixed external phase delay issue described in https://sourceforge.net/p/pydstool/discussion/472291/thread/e55d28a2/ --- PyDSTool/Generator/Vode_ODEsystem.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PyDSTool/Generator/Vode_ODEsystem.py b/PyDSTool/Generator/Vode_ODEsystem.py index 5be7bafc..6d3ed569 100644 --- a/PyDSTool/Generator/Vode_ODEsystem.py +++ b/PyDSTool/Generator/Vode_ODEsystem.py @@ -635,7 +635,7 @@ def compute(self, trajname, dirn='f', ics=None): num_points += 1 if not breakwhile: try: - extralist[self.numpars:listend] = [f(solver.t + self.globalt0, + extralist[self.numpars:listend] = [f(tmesh[0] + self.globalt0, self.checklevel) for f in inputVarList] except ValueError: @@ -654,7 +654,12 @@ def compute(self, trajname, dirn='f', ics=None): 'External input call caused t out of range error: t = %f' % solver.t) raise - solver.set_f_params(extralist) + except IndexError: + # no points left in tmesh, move on and let re-loop catch and break + # to end integration + pass + else: + solver.set_f_params(extralist) breakwhile = not solver.successful() # Check that any terminal events found terminated the code correctly if first_found_t is not None: