@@ -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 )
@@ -648,12 +657,10 @@ def test_forced_response_legacy(self):
648
657
@pytest .mark .parametrize (
649
658
"tsystem, fr_kwargs, refattr" ,
650
659
[pytest .param ("siso_ss1" ,
651
- {'X0' : [0.5 , 1 ], 'T' : np .linspace (0 , 1 , 10 )},
652
- 'yinitial' ,
660
+ {'T' : np .linspace (0 , 1 , 10 )}, 'yinitial' ,
653
661
id = "ctime no U" ),
654
662
pytest .param ("siso_dss1" ,
655
- {'T' : np .arange (0 , 5 , 1 ,),
656
- 'X0' : [0.5 , 1 ]}, 'yinitial' ,
663
+ {'T' : np .arange (0 , 5 , 1 ,)}, 'yinitial' ,
657
664
id = "dt=True, no U" ),
658
665
pytest .param ("siso_dtf1" ,
659
666
{'U' : np .ones (5 ,)}, 'ystep' ,
@@ -671,6 +678,8 @@ def test_forced_response_legacy(self):
671
678
indirect = ["tsystem" ])
672
679
def test_forced_response_T_U (self , tsystem , fr_kwargs , refattr ):
673
680
"""Test documented forced_response behavior for parameters T and U."""
681
+ if refattr == 'yinitial' :
682
+ fr_kwargs ['X0' ] = tsystem .X0
674
683
t , y = forced_response (tsystem .sys , ** fr_kwargs )
675
684
np .testing .assert_allclose (t , tsystem .t )
676
685
np .testing .assert_allclose (y , getattr (tsystem , refattr ), rtol = 1e-3 )
0 commit comments