当前位置:网站首页>Using MATLAB to realize: power method, inverse power method (origin displacement)
Using MATLAB to realize: power method, inverse power method (origin displacement)
2022-07-02 07:23:00 【Drizzle】
Use Matlab Realization : Power law 、 Inverse power method ( Origin displacement )
Power law
Example
Use power method , Calculate the main eigenvalue of the following matrix and the corresponding eigenvector .
A = [ 2 − 1 0 − 1 2 − 1 0 − 1 2 ] A= \left[\begin{array}{ccc} 2 & -1 & 0\\ -1 & 2 & -1\\ 0 & -1 & 2 \end{array}\right] A=⎣⎡2−10−12−10−12⎦⎤
Realization
The mathematical iteration formula of power method is :
take v ( 0 ) ≠ 0 , α ≠ 0 , Make u ( 0 ) = v ( 0 ) take v^{(0)} \neq 0,\alpha \neq 0, Make u^{(0)} = v^{(0)} take v(0)̸=0,α̸=0, Make u(0)=v(0)
v ( 1 ) = A v ( 0 ) = A u ( 0 ) v^{(1)} = A v^{(0)} = A u^{(0)} v(1)=Av(0)=Au(0)
u ( 1 ) = v ( 1 ) m a x ( v ( 1 ) ) = A v ( 0 ) m a x ( A v ( 0 ) ) u^{(1)} = \frac{v^{(1)}}{max(v^{(1)})} = \frac{A v^{(0)}}{max(A v^{(0)})} u(1)=max(v(1))v(1)=max(Av(0))Av(0)
v ( 2 ) = A u ( 1 ) = A v ( 1 ) m a x ( A v ( 0 ) ) = A 2 v ( 0 ) m a x ( A 2 v ( 0 ) ) v^{(2)} = A u^{(1)} = \frac{Av^{(1)}}{max(A v^{(0)})} = \frac{A^2 v^{(0)}}{max(A^2 v^{(0)})} v(2)=Au(1)=max(Av(0))Av(1)=max(A2v(0))A2v(0)
u ( 2 ) = v ( 2 ) m a x ( v ( 2 ) ) = A 2 v ( 0 ) m a x ( A 2 v ( 0 ) ) u^{(2)} = \frac{v^{(2)}}{max(v^{(2)})} = \frac{A^2 v^{(0)}}{max(A^2 v^{(0)})} u(2)=max(v(2))v(2)=max(A2v(0))A2v(0)
By analogy .
Use Matlab Realization :
format long g;
v0 = [1;1;1];
u0 = [1;1;1];
A = [2,-1,0;-1,2,-1;0,-1,2];
v = A * u0;
u = v / norm(v, inf);
i = 0;
while norm(u - u0, inf) >= 1e-5
u0 = u;
v = A * u0;
u = v / norm(v, inf);
i ++;
end;
norm(v, inf)
i
u
To solve the need to :
i = 8 , u ( 9 ) = ( 0.70711 , − 1 , 0.70711 ) T , λ = m a x ( v ( 9 ) ) = 3.41422 i = 8,u^{(9)} = (0.70711, -1, 0.70711)^T,\lambda = max(v^{(9)}) = 3.41422 i=8,u(9)=(0.70711,−1,0.70711)T,λ=max(v(9))=3.41422
Inverse power method
Example
The following matrices are known to have eigenvalues λ \lambda λ Approximate value p = 4.3 p = 4.3 p=4.3 , Use the inverse power method of origin displacement , Find the corresponding eigenvector u u u , And improve λ \lambda λ .
A = [ 3 0 − 10 − 1 3 4 0 1 − 2 ] A= \left[\begin{array}{ccc} 3 & 0 & -10\\ -1 & 3 & 4\\ 0 & 1 & -2 \end{array}\right] A=⎣⎡3−10031−104−2⎦⎤
Realization
Inverse power method , Is based on the power method , A method for finding the minimum eigenvalue is derived . Due to the nature of eigenvalues , It can be used to find the exact eigenvalue of an approximate value .
The mathematical iteration method is as follows :
First , The matrix A − p I A - p I A−pI Triangulate , It is convenient to find the solution of the equations later .
A − p I = L U A - p I = L U A−pI=LU
seek v ( k ) v^{(k)} v(k) when , It is equivalent to finding two trigonometric equations .
{ L y ( k ) = u ( k − 1 ) U v ( k ) = y ( k ) \begin{cases} L y^{(k)} = u^{(k - 1)}\\ U v^{(k)} = y^{(k)}\\ \end{cases} { Ly(k)=u(k−1)Uv(k)=y(k)
And then there is :
u ( k ) = v ( k ) m a x ( v ( k ) ) u^{(k)} = \frac{v^{(k)}}{max(v^{(k)})} u(k)=max(v(k))v(k)
Use Matlab Realization :
A = [3,0,-10;-1,3,4;0,1,-2];
I = eye(3,3);
p = 4.3;
u0 = [1;1;1];
v = inv(A - p * I) * u0;
u = v / norm(v, inf);
i = 0;
while norm(u - u0, inf) > 1e-5
u0 = u;
v = inv(A - p * I) * u0;
u = v / norm(v, inf);
i ++;
end;
i
u
x = p + 1 / norm(v, inf)
To solve the need to :
i = 6 , u ( 7 ) = ( − 0.96606 , 1 , 0.15210 ) T , λ = p + 1 m a x ( v ( k ) ) = 4.57447 i = 6,u^{(7)} = (-0.96606, 1, 0.15210)^T,\lambda = p + \frac{1}{max(v^{(k)})} = 4.57447 i=6,u(7)=(−0.96606,1,0.15210)T,λ=p+max(v(k))1=4.57447
边栏推荐
- Oracle rman自动恢复脚本(生产数据向测试迁移)
- SSM laboratory equipment management
- oracle-外币记账时总账余额表gl_balance变化(上)
- Oracle apex 21.2 installation and one click deployment
- CONDA creates, replicates, and shares virtual environments
- Sqli-labs customs clearance (less2-less5)
- parser.parse_args 布尔值类型将False解析为True
- 【信息检索导论】第三章 容错式检索
- Alpha Beta Pruning in Adversarial Search
- Oracle EBS ADI development steps
猜你喜欢

Cognitive science popularization of middle-aged people

Principle analysis of spark

Cloud picture says | distributed transaction management DTM: the little helper behind "buy buy buy"

ORACLE 11G利用 ORDS+pljson来实现json_table 效果

ORACLE EBS ADI 开发步骤

【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
![[introduction to information retrieval] Chapter 7 scoring calculation in search system](/img/cc/a5437cd36956e4c239889114b783c4.png)
[introduction to information retrieval] Chapter 7 scoring calculation in search system

Message queue fnd in Oracle EBS_ msg_ pub、fnd_ Application of message in pl/sql

Proteus -- RS-232 dual computer communication
![[tricks] whiteningbert: an easy unsupervised sentence embedding approach](/img/8e/3460fed55f2a21f8178e7b6bf77d56.png)
[tricks] whiteningbert: an easy unsupervised sentence embedding approach
随机推荐
解决万恶的open failed: ENOENT (No such file or directory)/(Operation not permitted)
[tricks] whiteningbert: an easy unsupervised sentence embedding approach
使用Matlab实现:Jacobi、Gauss-Seidel迭代
Spark SQL task performance optimization (basic)
Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
MapReduce concepts and cases (Shang Silicon Valley Learning Notes)
ORACLE EBS 和 APEX 集成登录及原理分析
Oracle EBS interface development - quick generation of JSON format data
Oracle apex Ajax process + dy verification
第一个快应用(quickapp)demo
ORACLE EBS ADI 开发步骤
Oracle APEX 21.2 installation et déploiement en une seule touche
MySQL无order by的排序规则因素
[medical] participants to medical ontologies: Content Selection for Clinical Abstract Summarization
【信息检索导论】第七章搜索系统中的评分计算
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
ORACLE APEX 21.2安装及一键部署
JSP智能小区物业管理系统
Oracle general ledger balance table GL for foreign currency bookkeeping_ Balance change (Part 1)
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization