@@ -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 )
@@ -642,19 +644,23 @@ def test_forced_response_legacy(self):
642644 [pytest .param ("siso_ss1" ,
643645 {'X0' : [0.5 , 1 ], 'T' : np .linspace (0 , 1 , 10 )},
644646 'yinitial' ,
645- id = "ctime no T" ),
647+ id = "ctime no U" ),
648+ pytest .param ("siso_dss1" ,
649+ {'T' : np .arange (0 , 5 , 1 ,),
650+ 'X0' : [0.5 , 1 ]}, 'yinitial' ,
651+ id = "dt=True, no U" ),
646652 pytest .param ("siso_dtf1" ,
647653 {'U' : np .ones (5 ,)}, 'ystep' ,
648- id = "dt=True, no U " ),
654+ id = "dt=True, no T " ),
649655 pytest .param ("siso_dtf2" ,
650656 {'U' : np .ones (25 ,)}, 'ystep' ,
651- id = "dt=0.2, no U " ),
657+ id = "dt=0.2, no T " ),
652658 pytest .param ("siso_ss2_dtnone" ,
653659 {'U' : np .ones (10 ,)}, 'ystep' ,
654- id = "dt=None, no U " ),
660+ id = "dt=None, no T " ),
655661 pytest .param ("siso_dtf3" ,
656662 {'U' : np .ones (10 ,)}, 'ystep' ,
657- id = "dt with rounding error" ),
663+ id = "dt with rounding error, no T " ),
658664 ],
659665 indirect = ["tsystem" ])
660666 def test_forced_response_T_U (self , tsystem , fr_kwargs , refattr ):
@@ -669,13 +675,13 @@ def test_forced_response_invalid_c(self, tsystem):
669675 with pytest .raises (TypeError ,
670676 match = "StateSpace.*or.*TransferFunction" ):
671677 forced_response ("not a system" )
672-
673- # ctime
674678 with pytest .raises (ValueError , match = "T.*is mandatory for continuous" ):
675679 forced_response (tsystem .sys )
676680 with pytest .raises (ValueError , match = "time values must be equally "
677681 "spaced" ):
678682 forced_response (tsystem .sys , [0 , 0.1 , 0.12 , 0.4 ])
683+ with pytest .raises (ValueError , match = "must start with 0" ):
684+ forced_response (tsystem .sys , [1 , 1.1 , 1.2 , 1.3 ])
679685
680686 @pytest .mark .parametrize ("tsystem" , ["siso_dss2" ], indirect = True )
681687 def test_forced_response_invalid_d (self , tsystem ):
0 commit comments