Skip to content

Commit

Permalink
remove prescale (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen authored Jan 28, 2022
1 parent a9ad53d commit 9455a54
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
21 changes: 0 additions & 21 deletions src/matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -599,27 +599,6 @@ function similarity_transform(sys::ST, T; unitary=false) where ST <: AbstractSta
ST(A,B,C,D,sys.timeevol)
end

"""
syst, S = prescale(sys)
Perform a eigendecomposition on system state-transition matrix `sys.A`.
```
à = S⁻¹AS
B̃ = S⁻¹ B
C̃ = CS
D̃ = D
```
Such that `Ã` is diagonal.
Returns a new scaled state-space object and the associated transformation
matrix.
"""
function prescale(sys::AbstractStateSpace)
d, S = eigen(sys.A)
A = Diagonal(d)
B = S\sys.B
C = sys.C*S
normalized_sys = iscontinuous(sys) ? ss(A, B, C, sys.D) : ss(A, B, C, sys.D, sys.Ts)
return normalized_sys, S
end

"""
sysi = innovation_form(sys, R1, R2)
Expand Down
5 changes: 0 additions & 5 deletions test/test_matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ syst = similarity_transform(sys, Tr)
@test sys.B Tr*syst.B
@test sys.C*Tr syst.C

nsys, T = prescale(sys)
@test isdiag(nsys.A)
@test T*nsys.A sys.A*T
@test T*nsys.B sys.B
@test nsys.C sys.C*T

sys = ss([1 0.1; 0 1], ones(2), [1. 0], 0)
sysi = ControlSystems.innovation_form(sys, I, I)
Expand Down

0 comments on commit 9455a54

Please sign in to comment.