|
From: Roberto B. <rob...@su...> - 2014-08-17 06:35:02
|
Another method to implement the correct dare functions is to use the
sllycot routine "sb02od"
# Check dimensions for consistency
nstates = B.shape[0];
ninputs = B.shape[1];
if (A.shape[0] != nstates or A.shape[1] != nstates):
raise ControlDimension("inconsistent system dimensions")
elif (Q.shape[0] != nstates or Q.shape[1] != nstates or
R.shape[0] != ninputs or R.shape[1] != ninputs) :
raise ControlDimension("incorrect weighting matrix dimensions")
X,rcond,w,S,T = \
sb02od(nstates, ninputs, A, B, Q, R, 'D');
return X
which returns the correct result too.
Roberto
On 08/16/2014 10:49 PM, Clancy Rowley wrote:
> Branch: refs/heads/master
> Home: https://github.com/python-control/python-control
> Commit: 38514c9c3f57f80d332bb13b8ef71e401c94407a
> https://github.com/python-control/python-control/commit/38514c9c3f57f80d332bb13b8ef71e401c94407a
> Author: Clancy Rowley <cwr...@pr...>
> Date: 2014-08-16 (Sat, 16 Aug 2014)
>
> Changed paths:
> M control/matlab.py
>
> Log Message:
> -----------
> Correct docstrings in matlab time response functions
>
> Fixes #35
>
>
> Commit: 8c1fdeb2b401866777a2f9c22a968e13199fdf0b
> https://github.com/python-control/python-control/commit/8c1fdeb2b401866777a2f9c22a968e13199fdf0b
> Author: Clancy Rowley <cwr...@pr...>
> Date: 2014-08-16 (Sat, 16 Aug 2014)
>
> Changed paths:
> M control/tests/mateqn_test.py
>
> Log Message:
> -----------
> Improve readability of matrix equation tests
>
>
> Commit: 7cf9630146a961c28c38817d48794525d22c6287
> https://github.com/python-control/python-control/commit/7cf9630146a961c28c38817d48794525d22c6287
> Author: Clancy Rowley <cwr...@pr...>
> Date: 2014-08-16 (Sat, 16 Aug 2014)
>
> Changed paths:
> M control/mateqn.py
> M control/tests/mateqn_test.py
>
> Log Message:
> -----------
> 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.
>
>
> Compare: https://github.com/python-control/python-control/compare/b798bfa1cbd9...7cf9630146a9
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> python-control-developers mailing list
> pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/python-control-developers
|