@@ -1111,6 +1111,8 @@ def forced_response(sys, T=None, U=0., X0=0., transpose=False,
1111
1111
1112
1112
return TimeResponseData (
1113
1113
tout , yout , xout , U , issiso = sys .issiso (),
1114
+ output_labels = sys .output_labels , input_labels = sys .input_labels ,
1115
+ state_labels = sys .state_labels ,
1114
1116
transpose = transpose , return_x = return_x , squeeze = squeeze )
1115
1117
1116
1118
@@ -1374,8 +1376,16 @@ def step_response(sys, T=None, X0=0., input=None, output=None, T_num=None,
1374
1376
# Figure out if the system is SISO or not
1375
1377
issiso = sys .issiso () or (input is not None and output is not None )
1376
1378
1379
+ # Select only the given input and output, if any
1380
+ input_labels = sys .input_labels if input is None \
1381
+ else sys .input_labels [input ]
1382
+ output_labels = sys .output_labels if output is None \
1383
+ else sys .output_labels [output ]
1384
+
1377
1385
return TimeResponseData (
1378
1386
response .time , yout , xout , uout , issiso = issiso ,
1387
+ output_labels = output_labels , input_labels = input_labels ,
1388
+ state_labels = sys .state_labels ,
1379
1389
transpose = transpose , return_x = return_x , squeeze = squeeze )
1380
1390
1381
1391
@@ -1704,9 +1714,15 @@ def initial_response(sys, T=None, X0=0., input=0, output=None, T_num=None,
1704
1714
# Figure out if the system is SISO or not
1705
1715
issiso = sys .issiso () or (input is not None and output is not None )
1706
1716
1717
+ # Select only the given output, if any
1718
+ output_labels = sys .output_labels if output is None \
1719
+ else sys .output_labels [0 ]
1720
+
1707
1721
# Store the response without an input
1708
1722
return TimeResponseData (
1709
1723
response .t , response .y , response .x , None , issiso = issiso ,
1724
+ output_labels = output_labels , input_labels = None ,
1725
+ state_labels = sys .state_labels ,
1710
1726
transpose = transpose , return_x = return_x , squeeze = squeeze )
1711
1727
1712
1728
@@ -1798,7 +1814,7 @@ def impulse_response(sys, T=None, X0=0., input=None, output=None, T_num=None,
1798
1814
-----
1799
1815
This function uses the `forced_response` function to compute the time
1800
1816
response. For continuous time systems, the initial condition is altered to
1801
- account for the initial impulse. For discrete-time aystems, the impulse is
1817
+ account for the initial impulse. For discrete-time aystems, the impulse is
1802
1818
sized so that it has unit area.
1803
1819
1804
1820
Examples
@@ -1869,8 +1885,16 @@ def impulse_response(sys, T=None, X0=0., input=None, output=None, T_num=None,
1869
1885
# Figure out if the system is SISO or not
1870
1886
issiso = sys .issiso () or (input is not None and output is not None )
1871
1887
1888
+ # Select only the given input and output, if any
1889
+ input_labels = sys .input_labels if input is None \
1890
+ else sys .input_labels [input ]
1891
+ output_labels = sys .output_labels if output is None \
1892
+ else sys .output_labels [output ]
1893
+
1872
1894
return TimeResponseData (
1873
1895
response .time , yout , xout , uout , issiso = issiso ,
1896
+ output_labels = output_labels , input_labels = input_labels ,
1897
+ state_labels = sys .state_labels ,
1874
1898
transpose = transpose , return_x = return_x , squeeze = squeeze )
1875
1899
1876
1900
0 commit comments