当前位置:网站首页>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
边栏推荐
- [medical] participants to medical ontologies: Content Selection for Clinical Abstract Summarization
- parser. parse_ Args boolean type resolves false to true
- TCP attack
- parser.parse_args 布尔值类型将False解析为True
- MySQL无order by的排序规则因素
- Conda 创建,复制,分享虚拟环境
- Oracle EBS数据库监控-Zabbix+zabbix-agent2+orabbix
- Alpha Beta Pruning in Adversarial Search
- Oracle EBS database monitoring -zabbix+zabbix-agent2+orabbix
- pySpark构建临时表报错
猜你喜欢
CAD secondary development object
Alpha Beta Pruning in Adversarial Search
SSM supermarket order management system
Oracle 11g uses ords+pljson to implement JSON_ Table effect
Proteus -- RS-232 dual computer communication
腾讯机试题
Two table Association of pyspark in idea2020 (field names are the same)
DNS attack details
Explain in detail the process of realizing Chinese text classification by CNN
ORACLE 11G利用 ORDS+pljson来实现json_table 效果
随机推荐
A summary of a middle-aged programmer's study of modern Chinese history
Analysis of MapReduce and yarn principles
Implementation of purchase, sales and inventory system with ssm+mysql
Sqli labs customs clearance summary-page2
【信息检索导论】第七章搜索系统中的评分计算
Oracle 11g uses ords+pljson to implement JSON_ Table effect
Agile development of software development pattern (scrum)
ORACLE EBS DATAGUARD 搭建
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
Oracle EBS DataGuard setup
如何高效开发一款微信小程序
[paper introduction] r-drop: regulated dropout for neural networks
Find in laravel8_ in_ Usage of set and upsert
Message queue fnd in Oracle EBS_ msg_ pub、fnd_ Application of message in pl/sql
【论文介绍】R-Drop: Regularized Dropout for Neural Networks
ORACLE 11G SYSAUX表空间满处理及move和shrink区别
Explanation of suffix of Oracle EBS standard table
2021-07-19c CAD secondary development creates multiple line segments
ORACLE EBS接口开发-json格式数据快捷生成
一份Slide两张表格带你快速了解目标检测