Severity: Warning
Message: fopen(/home/polpe/.phpsession/ci_session83389ffedf80504215f9dd0d21efe563f80e18d5): failed to open stream: No space left on device
Filename: drivers/Session_files_driver.php
Line Number: 159
Backtrace:
File: /home/polpe/public_html/application/controllers/Main.php
Line: 17
Function: library
File: /home/polpe/public_html/index.php
Line: 315
Function: require_once
Teljes Matlab script
(és live script)
kiegészítő függvényekkel.
Tekintsd meg LiveEditor nézetben is!
Moore 1981, Principal Component Analysis in Linear Systems: Controllability, Observability, and Model Reduction
File: standard_1d_order_reduction.m
Author: Peter Polcz ppolcz@gmail.com
Created on 2017. September 02.
Reviewed on 2017. September 24.
Reviewed on 2018. February 01. (Geometric control approach)
Automatically generated stuff
global SCOPE_DEPTH
SCOPE_DEPTH = 0;
detT = 0;
while ~(0 < detT && detT <= 2)
T = randn(4);
detT = det(T);
end
T, detT
T = -0.1807 0.1093 -0.7231 0.5939 0.0458 1.8140 0.5265 -2.1860 -0.0638 0.3120 -0.2603 -1.3270 0.6113 1.8045 0.6001 -1.4410 detT = 0.9803
A = [
1 0 1 0
1 1 1 1
0 0 1 0
0 0 1 1
] .* randn(4);
B = [
1
1
0
0
] .* randn(4,1);
C = [ 1 0 1 0 ] .* randn(1,4);
A = T*A/T;
B = T*B;
C = C/T;
D = 0;
rtol = 1e-10;
pcz_display(A,B,C)
A [4x4] = 1.2176 -1.3912 2.3540 0.8540 -3.1447 -4.9249 0.9090 3.9271 0.0526 -0.8850 -0.3092 0.7581 -4.0659 -4.9785 1.0343 4.0206 B [4x1] = -0.1167 -0.0715 -0.0562 0.2754 C [1x4] = -0.9611 0.1386 -0.7023 0.0403
$$\left\lbrace \begin{array}{c}\dot{x} =A\text{ }x+B\text{ }y\\y=C\text{ }x+D\text{ }y\end{array}\right.$$
The state space could be partitioned as follows:
$$\mathcal X = \mathcal X_{co} + \mathcal X_{c \bar o} + \mathcal X_{\bar c o} + \mathcal X_{\bar c \bar o}$$
$\mathcal X_{\cdot \cdot}$ are pairwise orthogonal subspaces of the state space.
Controllability matrix:
Cn = ctrb(A,B), rank(Cn,rtol)
Cn = -0.1167 0.0603 -0.0885 0.0830 -0.0715 1.7495 -1.1670 1.4977 -0.0562 0.2833 -0.2078 0.2548 0.2754 1.8796 -1.1050 1.5123 ans = 2
Observability matrix:
On = obsv(A,C), rank(On,rtol)
On = -0.9611 0.1386 -0.7023 0.0403 -1.8070 1.0752 -1.8776 -0.6467 -3.0505 2.1000 -3.3647 -1.3445 -5.0286 3.5726 -5.6223 -2.3147 ans = 2
[U,Sigma,~] = svd(Cn);
XC_ = U(:,1:rank(Sigma,rtol))
% Alternatively:
% Xcx = orth(Cn)
XC_ = 0.0331 -0.4312 0.6906 -0.5900 0.1155 -0.2560 0.7132 0.6328
[~,Sigma,V] = svd(On);
X_o = V(:,rank(Sigma,rtol)+1:end)
% Alternatively:
% Xx_2 = null(On)
X_o = -0.1386 -0.5128 0.7380 -0.0246 0.3669 0.6659 0.5491 -0.5413
XCo = intersection_of_subspaces(XC_',X_o')';
XCo_ORTH = null(XCo');
XCO = intersection_of_subspaces(XCo_ORTH', XC_')'
XCO = 1.0000 1.3361 0.5889 -1.5056
U = orth(XCO)
U = -0.4304 -0.5750 -0.2535 0.6480
H = tf(ss(A,B,C,D));
H_min = minreal(H)
H_min = 0.1528 ---------- s - 0.4018 Continuous-time transfer function.
We do not need to use minreal.
A_ = U'*A*U;
B_ = U'*B;
C_ = C*U;
D_ = D;
tf(ss(A_,B_,C_,D_))
ans = 0.1528 ---------- s - 0.4018 Continuous-time transfer function.
The transformation matrix is returned by function minreal.
sys = ss(A,B,C,D);
[sysmin,S] = minreal(sys);
Kalman_decomp_A = S*A/S
3 states removed. Kalman_decomp_A = 0.4018 0.0000 -1.5344 0.4391 9.5727 -1.0516 2.5233 3.3105 -0.0000 0.0000 1.6360 0.0000 0.0000 -0.0000 -1.9160 -0.9821
Let us detonte $\mathcal U = \rm{Im}(A)$, $\mathcal V = \rm{Ker}(A)$, where $A \in \mathbb R^{n \times n}$. It is not necessary that $\mathcal U = \mathcal V^\perp$.
A = [
0 1
0 0
];
U = orth(A)
V = null(A)
rank([U V])
U = 1 0 V = -1 0 ans = 1