File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -846,8 +846,8 @@ def _ideal_tfinal_and_dt(sys, is_step=True):
846
846
The system whose time response is to be computed
847
847
is_step : bool
848
848
Scales the dc value by the magnitude of the nonzero mode since
849
- integrating the impulse response gives
850
- :math:`\int e^{-\lambda t} = -e^{-\lambda t}/ \lambda`
849
+ integrating the impulse response gives
850
+ :math:`\\ int e^{-\\ lambda t} = -e^{-\\ lambda t}/ \ \ lambda`
851
851
Default is True.
852
852
853
853
Returns
@@ -900,8 +900,10 @@ def _ideal_tfinal_and_dt(sys, is_step=True):
900
900
p_u , p = p [m_u ], p [~ m_u ]
901
901
if p_u .size > 0 :
902
902
m_u = (p_u .real < 0 ) & (np .abs (p_u .imag ) < sqrt_eps )
903
- t_emp = np .max (log_decay_percent / np .abs (np .log (p_u [~ m_u ])/ dt ))
904
- tfinal = max (tfinal , t_emp )
903
+ if np .any (~ m_u ):
904
+ t_emp = np .max (
905
+ log_decay_percent / np .abs (np .log (p_u [~ m_u ]) / dt ))
906
+ tfinal = max (tfinal , t_emp )
905
907
906
908
# zero - negligible effect on tfinal
907
909
m_z = np .abs (p ) < sqrt_eps
You can’t perform that action at this time.
0 commit comments