Skip to content

Commit 242829c

Browse files
committed
allow for delay on diff_rel trip condition
1 parent bce7f78 commit 242829c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/msrDynamics/_msrDynamics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def _check_trip(self, time, state, diff):
113113
s = chspy.interpolate(time - trip_obj.delay, idx, (a1,a2))
114114
elif trip_obj.trip_type == 'diff':
115115
s = chspy.interpolate_diff(time - trip_obj.delay, idx, (a1,a2))
116+
elif trip_obj.trip_type == 'diff_rel':
117+
s = chspy.interpolate_diff(time - trip_obj.delay, idx, (a1,a2))/chspy.interpolate(time - trip_obj.delay, idx, (a1,a2))
116118
else:
117119
raise ValueError('''Invalid trip type. Currently supported
118120
are 'state' and 'diff'.''')

0 commit comments

Comments
 (0)