similarity_transform(sys, T) changes the state coordinates of a linear
model list(A, B, C, D) (as returned by linearize()) with T x2 = x:
\(A_2 = T^{-1} A T\), \(B_2 = T^{-1} B\), \(C_2 = C T\). With
unitary = TRUE the transpose of T is used instead of its inverse.
reorder_unknowns(sys, old, new) permutes the states from the order
old (the states of a linearize() result) to new.
Arguments
- sys
A list with matrices
A,B,C,D.- T
The transformation matrix.
- unitary
Whether
Tis unitary.- old, new
The current and desired orders of the states: lists of variables or character vectors. For a result of
linearize()the current order is itsstates.
Examples
lsys <- list(A = matrix(c(-1, 0, 0, -2), 2), B = matrix(c(1, 0), 2),
C = matrix(c(0, 1), 1), D = matrix(0, 1, 1))
similarity_transform(lsys, matrix(c(0, 1, 1, 0), 2), unitary = TRUE)$A
#> [,1] [,2]
#> [1,] -2 0
#> [2,] 0 -1
reorder_unknowns(lsys, c("a", "b"), c("b", "a"))$A
#> [,1] [,2]
#> [1,] -2 0
#> [2,] 0 -1