diff --git a/bms/blocks/nonlinear.py b/bms/blocks/nonlinear.py index 798d592..675931e 100644 --- a/bms/blocks/nonlinear.py +++ b/bms/blocks/nonlinear.py @@ -62,8 +62,8 @@ def Evaluate(self, it, ts): delay_in_steps = int(self.delay // ts) delay_remainder = self.delay % ts - if it - delay_in_steps-1 < 0: - print(it, 'a', self.inputs[0].initial_values[-1]) + if (it - delay_in_steps -1) < 0: +# print(it, 'a', self.inputs[0].initial_values[-1]) return self.inputs[0].initial_values[-1] else: # Performing interpolation diff --git a/scripts/delay.py b/scripts/delay.py index 346876c..f999229 100644 --- a/scripts/delay.py +++ b/scripts/delay.py @@ -1,7 +1,7 @@ from bms.blocks import Delay from bms.core import DynamicSystem from bms.signals.functions import Ramp -from bms.core import Signal, Variable +from bms.core import Variable """ test that we can delay a signal by 2 seconds @@ -10,7 +10,7 @@ """ delay = 2.3 # time end_time = 10 -time_step = 20 +time_step = 200 input_ = Ramp() output_ = Variable(('output', 'o')) delay = Delay(input_, output_, delay)