Commit 7cf9630
committed
Fix bug in dare so that it returns a stabilizing solution
The new implementation calls the routine
scipy.linalg.solve_discrete_are(A, B, Q, R)
which is included in scipy versions >= 0.11. The old implementation
using slycot did satisfy the Riccati equation, but did not return a
stabilizing solution. The scipy implementation apparently works
correctly, though. This change fixes #8.
Unit tests now make sure closed-loop eigenvalues lie inside
the unit circle.
Note: the scipy implementation handles only the case S = 0, E = I,
the default values. If S and E are specified, the old routine (using
slycot) is called. This passes the existing tests, but the tests
include only one simple case, so it would be good to test this more
extensively.1 parent 8c1fdeb commit 7cf9630
2 files changed
+30
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
670 | | - | |
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
| |||
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
693 | 704 | | |
694 | 705 | | |
695 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
181 | 185 | | |
182 | 186 | | |
183 | 187 | | |
| |||
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
| |||
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
| |||
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
| |||
0 commit comments