@@ -386,8 +386,8 @@ def f_dot(x, t):
386386
387387 return T , yout , xout
388388
389- def step_response (sys , T = None , X0 = 0. , input = 0 , output = None , \
390- transpose = False , ** keywords ):
389+ def step_response (sys , T = None , X0 = 0. , input = 0 , output = None ,
390+ transpose = False , ** keywords ):
391391 #pylint: disable=W0622
392392 """Step response of a linear system
393393
@@ -468,8 +468,8 @@ def step_response(sys, T=None, X0=0., input=0, output=None, \
468468 return T , yout
469469
470470
471- def initial_response (sys , T = None , X0 = 0. , input = 0 , output = 0 , transpose = False ,
472- ** keywords ):
471+ def initial_response (sys , T = None , X0 = 0. , input = 0 , output = None , transpose = False ,
472+ ** keywords ):
473473 #pylint: disable=W0622
474474 """Initial condition response of a linear system
475475
@@ -498,7 +498,8 @@ def initial_response(sys, T=None, X0=0., input=0, output=0, transpose=False,
498498 Index of the input that will be used in this simulation.
499499
500500 output: int
501- Index of the output that will be used in this simulation.
501+ Index of the output that will be used in this simulation. Set to None
502+ to not trim outputs
502503
503504 transpose: bool
504505 If True, transpose all input and output arrays (for backward
@@ -529,7 +530,10 @@ def initial_response(sys, T=None, X0=0., input=0, output=0, transpose=False,
529530 >>> T, yout = initial_response(sys, T, X0)
530531 """
531532 sys = _convertToStateSpace (sys )
532- sys = _mimo2siso (sys , input , output , warn_conversion = True )
533+ if output == None :
534+ sys = _mimo2simo (sys , input , warn_conversion = False )
535+ else :
536+ sys = _mimo2siso (sys , input , output , warn_conversion = False )
533537
534538 # Create time and input vectors; checking is done in forced_response(...)
535539 # The initial vector X0 is created in forced_response(...) if necessary
@@ -538,11 +542,11 @@ def initial_response(sys, T=None, X0=0., input=0, output=0, transpose=False,
538542 U = np .zeros_like (T )
539543
540544 T , yout , _xout = forced_response (sys , T , U , X0 , transpose = transpose ,
541- ** keywords )
545+ ** keywords )
542546 return T , yout
543547
544548
545- def impulse_response (sys , T = None , X0 = 0. , input = 0 , output = 0 ,
549+ def impulse_response (sys , T = None , X0 = 0. , input = 0 , output = None ,
546550 transpose = False , ** keywords ):
547551 #pylint: disable=W0622
548552 """Impulse response of a linear system
@@ -572,7 +576,8 @@ def impulse_response(sys, T=None, X0=0., input=0, output=0,
572576 Index of the input that will be used in this simulation.
573577
574578 output: int
575- Index of the output that will be used in this simulation.
579+ Index of the output that will be used in this simulation. Set to None
580+ to not trim outputs
576581
577582 transpose: bool
578583 If True, transpose all input and output arrays (for backward
@@ -603,7 +608,10 @@ def impulse_response(sys, T=None, X0=0., input=0, output=0,
603608 >>> T, yout = impulse_response(sys, T, X0)
604609 """
605610 sys = _convertToStateSpace (sys )
606- sys = _mimo2siso (sys , input , output , warn_conversion = True )
611+ if output == None :
612+ sys = _mimo2simo (sys , input , warn_conversion = True )
613+ else :
614+ sys = _mimo2siso (sys , input , output , warn_conversion = True )
607615
608616 # System has direct feedthrough, can't simulate impulse response numerically
609617 if np .any (sys .D != 0 ) and isctime (sys ):
0 commit comments