Teljes Matlab script kiegészítő függvényekkel.
File: d2018_01_13_Kalman_decomp_LPV_v3.m Directory: projects/3_outsel/2018_01_10_LPV_inversion Author: Peter Polcz (ppolcz@gmail.com)
Created on 2018. January 13.
Inherited from
Kalman decomposition
File: Kalman_decomposition.m Directory: demonstrations/oktatas/ccs/2017fall Author: Peter Polcz (ppolcz@gmail.com)
Created on 2018. January 13.
Inhereted from:
CCS 2017 fall. Homework 2. Solutions
File: d2017_10_26_hf2_mo.m Directory: demonstrations/oktatas/ccs/2017fall Author: Peter Polcz (ppolcz@gmail.com)
Created on 2017. October 04. Reviewed on 2017. October 30.
Given the following LPV system:
$$ \begin{aligned} &\dot x = A(\rho) x + B(\rho) u,~~~ \rho \in \mathcal P \\ &y = C x \\ &\begin{aligned} \text{where: } & A(\rho) = A_0 + A_1 \rho \in \mathbb{R}^{n\times n} \\ & B(\rho) = B_0 + B_1 \rho \in \mathbb{R}^{n\times r} \\ & C \in \mathbb{R}^{m\times n} \\ & D = 0_{m\times r} \end{aligned} \end{aligned} $$
load LPV_18_01_13_Time211859
A_fh = @(rho) A0 + A1*rho;
B_fh = @(rho) B0 + B1*rho;
C_fh = @(rho) C0 + C1*rho;
D_fh = @(rho) D0 + D1*rho;
A = {A0, A1};
B = {B0, B1};
C = {C0, C1};
D = {D0, D1};
AA = [A{:}];
BB = [B{:}];
\begin{equation}
A(\rho) =
\left(\begin{array}{ccccccc}
1.0 & -1.1 & 2.7 & -0.068 & 1.0 & -0.39 & -0.68 \\
0 & -1.210^{-3} & -0.67 & 0 & 1.6 & 0 & -0.82 \\
0 & 0.17 & -0.7 & 0 & 1.1 & 0 & -0.55 \\
-0.73 & 2.1 & -3.4 & 0.3 & -3.4 & 2.2 & 0.93 \\
-0.73 & 0.82\rho +0.93 & -1.6 & -1.1 & -2.0 & 0.33 & 0.93 \\
0 & 1.0 & -1.6 & 1.0 & -1.0 & -1.7 & 0 \\
-1.5 & 2.2 & -4.6 & -2.2 & -6.5 & 0.67 & 3.1 \\
\end{array}\right)
\end{equation}
\begin{equation}
B(\rho) =
\left(\begin{array}{cc}
0.98 & 0.88 \\
0 & 0 \\
0 & 0 \\
0.85\rho -0.5 & -0.44 \\
0.15 & 0.13 \\
-0.23 & -0.21 \\
0.29 & 0.26 \\
\end{array}\right)
\end{equation}
\begin{equation}
C(\rho) = C =
\left(\begin{array}{ccccccc}
0 & -1.7 & 2.6 & -0.23 & 0.23 & -2.2 & 0 \\
0 & -0.4 & 0.61 & -1.3 & 1.3 & 1.0 & 0 \\
\end{array}\right)
\end{equation}
Nálam az $E_c$ most az $Im(B)$ (én így értelmeztem).
Im_B = IMA([B{1} B{2}]);
Ker_C = INTS(KER(C{1}), KER(C{2}));
[R,V] = CSA([A{1} A{2}], Im_B, Ker_C);
% Check the strong invertibility condition, the followings has to be empty
INTS(V, Im_B)
ans = 0 0 0 0 0 0 0
% State transformation, invariant feedback design
Lambda = ORTCO(Im_B)';
Co_V = ORTCO(V)';
T = [ Co_V ; Lambda ];
\begin{equation}
T = \left(\begin{array}{ccccccc}
0 & 0.4755 & -0.7133 & 0.2393 & -0.2393 & 0.388 & 0 \\
0 & 0 & 0 & 0.5329 & -0.5329 & -0.6573 & 0 \\
0.3805 & 0 & 0 & 0 & -0.336 & 0.5391 & -0.6721 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0.9316 & 0.2274 & -0.2835 \\
0 & 0 & 0 & 0 & 0 & 0.7801 & 0.6257
\end{array}\right)
\end{equation}
N = numel(A);
tA = cell(1,N);
tB = cell(1,N);
tC = cell(1,N);
tD = cell(1,N);
for i = 1:numel(A)
tA{i} = round(T*A{i}/T, -log10(tol));
tB{i} = round(T*B{i}, -log10(tol));
tC{i} = round(C{i}/T, -log10(tol));
tD{i} = round(D{i}, -log10(tol));
end
tA_fh = @(rho) tA{1} + tA{2}*rho;
tB_fh = @(rho) tB{1} + tB{2}*rho;
tC_fh = @(rho) tC{1} + tC{2}*rho;
tD_fh = @(rho) tD{1} + tD{2}*rho;
\begin{equation}
\bar A(\rho) =
\left(\begin{array}{ccccccc}
0.99 & 0.93 & 0 & 0.098-0.2\rho & -0.15 & 0 & 0 \\
3.2 & -1.3 & 0 & -0.44\rho -1.6 & 2.3 & 0 & 0 \\
-9.8 & 8.8 & 4.3 & 3.0-0.28\rho & -3.2 & 9.3 & 4.6 \\
0 & 0 & 0 & -1.210^{-3} & -0.67 & 1.8 & -0.51 \\
0 & 0 & 0 & 0.17 & -0.7 & 1.2 & -0.34 \\
1.4 & -0.91 & -0.7 & 0.77\rho -0.17 & 0.44 & -0.73 & -1.1 \\
4.7 & -3.1 & -2.4 & -0.033 & -0.73 & -6.7 & -2.5 \\
\end{array}\right)
\end{equation}
\begin{equation}
\bar B(\rho) =
\left(\begin{array}{cc}
0.2\rho -0.24 & -0.22 \\
0.45\rho -0.19 & -0.17 \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
\end{array}\right)
\end{equation}
\begin{equation}
\bar C(\rho) = C =
\left(\begin{array}{ccccccc}
-3.6 & 1.2 & 0 & 0 & 0 & 0 & 0 \\
-0.85 & -2.1 & 0 & 0 & 0 & 0 & 0 \\
\end{array}\right)
\end{equation}