@@ -43,6 +43,7 @@ def tsystem(self, request):
4343 siso_ss1 .ystep = np .array ([9. , 17.6457 , 24.7072 , 30.4855 , 35.2234 ,
4444 39.1165 , 42.3227 , 44.9694 , 47.1599 ,
4545 48.9776 ])
46+ # X0 = [0.5, 1]
4647 siso_ss1 .yinitial = np .array ([11. , 8.1494 , 5.9361 , 4.2258 , 2.9118 ,
4748 1.9092 , 1.1508 , 0.5833 , 0.1645 , - 0.1391 ])
4849 ss1 = siso_ss1 .sys
@@ -127,6 +128,7 @@ def tsystem(self, request):
127128
128129 siso_dss1 = copy (siso_dtf1 )
129130 siso_dss1 .sys = tf2ss (siso_dtf1 .sys )
131+ siso_dss1 .yinitial = np .array ([- 1. , - 0.5 , 0.75 , - 0.625 , 0.4375 ])
130132
131133 siso_dss2 = copy (siso_dtf2 )
132134 siso_dss2 .sys = tf2ss (siso_dtf2 .sys )
@@ -641,19 +643,23 @@ def test_forced_response_legacy(self):
641643 [pytest .param ("siso_ss1" ,
642644 {'X0' : [0.5 , 1 ], 'T' : np .linspace (0 , 1 , 10 )},
643645 'yinitial' ,
644- id = "ctime no T" ),
646+ id = "ctime no U" ),
647+ pytest .param ("siso_dss1" ,
648+ {'T' : np .arange (0 , 5 , 1 ,),
649+ 'X0' : [0.5 , 1 ]}, 'yinitial' ,
650+ id = "dt=True, no U" ),
645651 pytest .param ("siso_dtf1" ,
646652 {'U' : np .ones (5 ,)}, 'ystep' ,
647- id = "dt=True, no U " ),
653+ id = "dt=True, no T " ),
648654 pytest .param ("siso_dtf2" ,
649655 {'U' : np .ones (25 ,)}, 'ystep' ,
650- id = "dt=0.2, no U " ),
656+ id = "dt=0.2, no T " ),
651657 pytest .param ("siso_ss2_dtnone" ,
652658 {'U' : np .ones (10 ,)}, 'ystep' ,
653- id = "dt=None, no U " ),
659+ id = "dt=None, no T " ),
654660 pytest .param ("siso_dtf3" ,
655661 {'U' : np .ones (10 ,)}, 'ystep' ,
656- id = "dt with rounding error" ),
662+ id = "dt with rounding error, no T " ),
657663 ],
658664 indirect = ["tsystem" ])
659665 def test_forced_response_T_U (self , tsystem , fr_kwargs , refattr ):
@@ -668,13 +674,13 @@ def test_forced_response_invalid_c(self, tsystem):
668674 with pytest .raises (TypeError ,
669675 match = "StateSpace.*or.*TransferFunction" ):
670676 forced_response ("not a system" )
671-
672- # ctime
673677 with pytest .raises (ValueError , match = "T.*is mandatory for continuous" ):
674678 forced_response (tsystem .sys )
675679 with pytest .raises (ValueError , match = "time values must be equally "
676680 "spaced" ):
677681 forced_response (tsystem .sys , [0 , 0.1 , 0.12 , 0.4 ])
682+ with pytest .raises (ValueError , match = "must start with 0" ):
683+ forced_response (tsystem .sys , [1 , 1.1 , 1.2 , 1.3 ])
678684
679685 @pytest .mark .parametrize ("tsystem" , ["siso_dss2" ], indirect = True )
680686 def test_forced_response_invalid_d (self , tsystem ):
0 commit comments