You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
modal canonical form does not work with repeated eigenvalues #318
It looks like matlab's strategy to deal with repeated eigenvalues is to reduce the A matrix to block schur form. The MB03RD routine in slicot can do this, given a matrix in already in real schur form.
So maybe the strategy to solve this would be to first wrap MB03RD over in slycot. We can use scipy.linalg.schur to put A into real schur form before the call to MB03RD.
On Sun, 21 Jul 2019 at 20:50, Arnold ***@***.***> wrote:
Just a couple thoughts on this.
It looks like matlab's strategy to deal with repeated eigenvalues is to
reduce the A matrix to block schur form. The MB03RD
<http://slicot.org/objects/software/shared/doc/MB03RD.html> routine in
slicot can do this, given a matrix in already in real schur form.
So maybe the strategy to solve this would be to first wrap MB03RD over in
slycot. We can use scipy.linalg.schur to put A into real schur form
before the call to MB03RD.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#318?email_source=notifications&email_token=AAVKIDNWPA6WU5VV44TCFULQASVYPA5CNFSM4H22AJ72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2OJJ4A#issuecomment-513578224>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVKIDLB635XB2QZV3A3R3LQASVYPANCNFSM4H22AJ7Q>
.
--
René van Paassen | ______o____/_| Rene.vanPaassen@gmail.com
<[___\_\_-----< t: +31 15 2628685
| o' mobile: +31 6 39846891
How important is the ordering of the eigenvalues in the result? If it is important, do we have eigenvalue sorting routines (I did a search for "sort" in the code, couldn't spot anything obvious) ?
With this:
defmodal_form(xsys, pmax=None):
"""Convert a system into modal canonical form Parameters ---------- xsys : StateSpace object System to be transformed, with state `x` pmax: float An upper bound on individual transformations. Default eps ** -0.25. Returns ------- zsys : StateSpace object System in modal canonical form, with state `z` T : matrix Coordinate transformation: z = T * x Notes ----- pmax is passed to slycot.mb03rd. The pmax value allows for a trade-off: larger values give smaller modal blocks, but worse-conditioned T. """ifpmaxisNone:
pmax=finfo(float64).eps**-0.5aschur, tschur=schur(xsys.A)
_, tmodal, _, _=mb03rd(aschur.shape[0], aschur, tschur, pmax=pmax)
returnsimilarity_transform(xsys, tmodal, inverse=True), tmodaldefsimilarity_transform(xsys, T, timescale=1, inverse=False):
"""Perform a similarity transformation, with option time rescaling. Transform a linear state space system to a new state space representation z = T x, where T is an invertible matrix. Parameters ---------- xsys : StateSpace object System to transform T : 2D invertible array The matrix `T` defines the new set of coordinates z = T x. timescale : float If present, also rescale the time unit to tau = timescale * t inverse: boolean If True (default), transform so z = T x. If False, transform so x = T z. Returns ------- zsys : StateSpace object System in transformed coordinates, with state 'z' """# Create a new system, starting with a copy of the old onezsys=StateSpace(xsys)
# Define a function to compute the right inverse (solve x M = y)defrsolve(M, y):
returntranspose(solve(transpose(M), transpose(y)))
# Update the system matricesifnotinverse:
zsys.A=rsolve(T, dot(T, zsys.A)) /timescalezsys.B=dot(T, zsys.B) /timescalezsys.C=rsolve(T, zsys.C)
else:
zsys.A=solve(T, zsys.A).dot(T) /timescalezsys.B=solve(T, zsys.B) /timescalezsys.C=zsys.C.dot(T)
returnzsys
I can find a modal decomposition of 1 / (s+1)**3 / (s**2 + s + 100) ** 2
(triply-repeated eigenvalues at -1, and double repeated complex pole pair).
on pmax: cond(A B) <= cond(A) cond(B); the mb03rd docs state that the condition numbers on the order of pmax ** 2, so to get an upper bound of on cond(T) of 1/sqrt(eps), I've set pmax to 1/sqrt(sqrt(eps)).
Activity
rabraker commentedon Jul 21, 2019
Just a couple thoughts on this.
It looks like matlab's strategy to deal with repeated eigenvalues is to reduce the
Amatrix to block schur form. The MB03RD routine in slicot can do this, given a matrix in already in real schur form.So maybe the strategy to solve this would be to first wrap
MB03RDover in slycot. We can usescipy.linalg.schurto putAinto real schur form before the call toMB03RD.repagh commentedon Aug 2, 2019
roryyorke commentedon Dec 30, 2020
Some references:
How important is the ordering of the eigenvalues in the result? If it is important, do we have eigenvalue sorting routines (I did a search for "sort" in the code, couldn't spot anything obvious) ?
With this:
I can find a modal decomposition of
1 / (s+1)**3 / (s**2 + s + 100) ** 2(triply-repeated eigenvalues at -1, and double repeated complex pole pair).
on pmax:
cond(A B) <= cond(A) cond(B); the mb03rd docs state that the condition numbers on the order of pmax ** 2, so to get an upper bound of on cond(T) of 1/sqrt(eps), I've set pmax to 1/sqrt(sqrt(eps)).