@@ -126,9 +126,18 @@ def tsystem(self, request):
126
126
[ 0. , - 0.1097 , - 0.1902 , - 0.2438 , - 0.2729 ,
127
127
- 0.2799 , - 0.2674 , - 0.2377 , - 0.1934 , - 0.1368 ])
128
128
129
+ """dtf1 converted statically, because Slycot and Scipy produce
130
+ different realizations, wich means different initial condtions,"""
129
131
siso_dss1 = copy (siso_dtf1 )
130
- siso_dss1 .sys = tf2ss (siso_dtf1 .sys )
131
- siso_dss1 .yinitial = np .array ([- 1. , - 0.5 , 0.75 , - 0.625 , 0.4375 ])
132
+ siso_dss1 .sys = StateSpace ([[- 1. , - 0.25 ],
133
+ [ 1. , 0. ]],
134
+ [[1. ],
135
+ [0. ]],
136
+ [[0. , 1. ]],
137
+ [[0. ]],
138
+ True )
139
+ siso_dss1 .X0 = [0.5 , 1. ]
140
+ siso_dss1 .yinitial = np .array ([1. , 0.5 , - 0.75 , 0.625 , - 0.4375 ])
132
141
133
142
siso_dss2 = copy (siso_dtf2 )
134
143
siso_dss2 .sys = tf2ss (siso_dtf2 .sys )
@@ -647,12 +656,10 @@ def test_forced_response_legacy(self):
647
656
@pytest .mark .parametrize (
648
657
"tsystem, fr_kwargs, refattr" ,
649
658
[pytest .param ("siso_ss1" ,
650
- {'X0' : [0.5 , 1 ], 'T' : np .linspace (0 , 1 , 10 )},
651
- 'yinitial' ,
659
+ {'T' : np .linspace (0 , 1 , 10 )}, 'yinitial' ,
652
660
id = "ctime no U" ),
653
661
pytest .param ("siso_dss1" ,
654
- {'T' : np .arange (0 , 5 , 1 ,),
655
- 'X0' : [0.5 , 1 ]}, 'yinitial' ,
662
+ {'T' : np .arange (0 , 5 , 1 ,)}, 'yinitial' ,
656
663
id = "dt=True, no U" ),
657
664
pytest .param ("siso_dtf1" ,
658
665
{'U' : np .ones (5 ,)}, 'ystep' ,
@@ -670,6 +677,8 @@ def test_forced_response_legacy(self):
670
677
indirect = ["tsystem" ])
671
678
def test_forced_response_T_U (self , tsystem , fr_kwargs , refattr ):
672
679
"""Test documented forced_response behavior for parameters T and U."""
680
+ if refattr == 'yinitial' :
681
+ fr_kwargs ['X0' ] = tsystem .X0
673
682
t , y = forced_response (tsystem .sys , ** fr_kwargs )
674
683
np .testing .assert_allclose (t , tsystem .t )
675
684
np .testing .assert_allclose (y , getattr (tsystem , refattr ), rtol = 1e-3 )
0 commit comments