Skip to content

Commit a88d4a0

Browse files
committed
updated matlab impulse function to accept X0
1 parent 8b220f7 commit a88d4a0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

control/matlab/timeresp.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
6666

6767
return yout, T
6868

69-
def impulse(sys, T=None, input=0, output=None, return_x=False):
69+
def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
7070
'''
7171
Impulse response of a linear system
7272
@@ -84,6 +84,11 @@ def impulse(sys, T=None, input=0, output=None, return_x=False):
8484
T: array-like object, optional
8585
Time vector (argument is autocomputed if not given)
8686
87+
X0: array-like or number, optional
88+
Initial condition (default = 0)
89+
90+
Numbers are converted to constant arrays with the correct shape.
91+
8792
input: int
8893
Index of the input that will be used in this simulation.
8994
@@ -110,7 +115,7 @@ def impulse(sys, T=None, input=0, output=None, return_x=False):
110115
>>> yout, T = impulse(sys, T)
111116
'''
112117
from ..timeresp import impulse_response
113-
T, yout, xout = impulse_response(sys, T, 0, input, output,
118+
T, yout, xout = impulse_response(sys, T, X0, input, output,
114119
transpose = True, return_x=True)
115120

116121
if return_x:

0 commit comments

Comments
 (0)