@@ -51,6 +51,7 @@ def tsystem(self, request):
51
51
siso_ss1 .ystep = np .array ([9. , 17.6457 , 24.7072 , 30.4855 , 35.2234 ,
52
52
39.1165 , 42.3227 , 44.9694 , 47.1599 ,
53
53
48.9776 ])
54
+ # X0 = [0.5, 1]
54
55
siso_ss1 .yinitial = np .array ([11. , 8.1494 , 5.9361 , 4.2258 , 2.9118 ,
55
56
1.9092 , 1.1508 , 0.5833 , 0.1645 , - 0.1391 ])
56
57
ss1 = siso_ss1 .sys
@@ -135,6 +136,7 @@ def tsystem(self, request):
135
136
136
137
siso_dss1 = copy (siso_dtf1 )
137
138
siso_dss1 .sys = tf2ss (siso_dtf1 .sys )
139
+ siso_dss1 .yinitial = np .array ([- 1. , - 0.5 , 0.75 , - 0.625 , 0.4375 ])
138
140
139
141
siso_dss2 = copy (siso_dtf2 )
140
142
siso_dss2 .sys = tf2ss (siso_dtf2 .sys )
@@ -634,19 +636,23 @@ def test_forced_response_legacy(self):
634
636
[pytest .param ("siso_ss1" ,
635
637
{'X0' : [0.5 , 1 ], 'T' : np .linspace (0 , 1 , 10 )},
636
638
'yinitial' ,
637
- id = "ctime no T" ),
639
+ id = "ctime no U" ),
640
+ pytest .param ("siso_dss1" ,
641
+ {'T' : np .arange (0 , 5 , 1 ,),
642
+ 'X0' : [0.5 , 1 ]}, 'yinitial' ,
643
+ id = "dt=True, no U" ),
638
644
pytest .param ("siso_dtf1" ,
639
645
{'U' : np .ones (5 ,)}, 'ystep' ,
640
- id = "dt=True, no U " ),
646
+ id = "dt=True, no T " ),
641
647
pytest .param ("siso_dtf2" ,
642
648
{'U' : np .ones (25 ,)}, 'ystep' ,
643
- id = "dt=0.2, no U " ),
649
+ id = "dt=0.2, no T " ),
644
650
pytest .param ("siso_ss2_dtnone" ,
645
651
{'U' : np .ones (10 ,)}, 'ystep' ,
646
- id = "dt=None, no U " ),
652
+ id = "dt=None, no T " ),
647
653
pytest .param ("siso_dtf3" ,
648
654
{'U' : np .ones (10 ,)}, 'ystep' ,
649
- id = "dt with rounding error" ),
655
+ id = "dt with rounding error, no T " ),
650
656
],
651
657
indirect = ["tsystem" ])
652
658
def test_forced_response_T_U (self , tsystem , fr_kwargs , refattr ):
@@ -661,13 +667,13 @@ def test_forced_response_invalid_c(self, tsystem):
661
667
with pytest .raises (TypeError ,
662
668
match = "StateSpace.*or.*TransferFunction" ):
663
669
forced_response ("not a system" )
664
-
665
- # ctime
666
670
with pytest .raises (ValueError , match = "T.*is mandatory for continuous" ):
667
671
forced_response (tsystem .sys )
668
672
with pytest .raises (ValueError , match = "time values must be equally "
669
673
"spaced" ):
670
674
forced_response (tsystem .sys , [0 , 0.1 , 0.12 , 0.4 ])
675
+ with pytest .raises (ValueError , match = "must start with 0" ):
676
+ forced_response (tsystem .sys , [1 , 1.1 , 1.2 , 1.3 ])
671
677
672
678
@pytest .mark .parametrize ("tsystem" , ["siso_dss2" ], indirect = True )
673
679
def test_forced_response_invalid_d (self , tsystem ):
0 commit comments