Jacobi Plane rotation for a matrix A

6 ビュー (過去 30 日間)
Ravindra
Ravindra 2020 年 8 月 21 日
編集済み: Ravindra 2020 年 8 月 24 日
How to perform the Jacobi Rotation (Jacobi Method) for given matrix
There exists a rotation (c = cos(theta) and s = sin(theta))
For example how can we estimate rotation for the following matrix
A = [-17.7147 -38.4117 30.6475
-51.3024 17.3859 -10.0354
-19.3323 -38.8931 30.3686
-51.2891 18.9043 -11.1523
-21.42 -39.2796 29.9065
-51.1701 20.7146 -12.4891
-24.2543 -39.5276 29.3515
-51.0782 22.9095 -14.1458]
Using C++ Eigen libaray the result is following: http://eigen.tuxfamily.org/dox-3.2/classEigen_1_1JacobiRotation.html
Result = [ 110.564 -7.77137 -0.308057
0 87.445 -64.7691
0 0 1.86159
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0]
Using matlab inbuilt function qr ([~,R]=qr(A)) gives me the following:
R = [ 110.5645 -7.7714 -0.3081
0 -87.4451 64.7691
0 0 -1.8616
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0]
As you can see the first row result is same in C++ and matlab.
whereas the second and third row signs are not matching.
What is the correct solution or how can it be implemented in matlab?
Thank you!!

回答 (1 件)

KSSV
KSSV 2020 年 8 月 21 日
Define the ngle of your rotation theta:
A = [-17.7147 -38.4117 30.6475
-51.3024 17.3859 -10.0354
-19.3323 -38.8931 30.3686
-51.2891 18.9043 -11.1523
-21.42 -39.2796 29.9065
-51.1701 20.7146 -12.4891
-24.2543 -39.5276 29.3515
-51.0782 22.9095 -14.1458] ;
theta = pi/4 ;
R = [cos(theta) sin(theta) 0 ;
-sin(theta) cos(theta) 0 ;
0 0 1] ;
Ar = A*R
  1 件のコメント
Ravindra
Ravindra 2020 年 8 月 21 日
編集済み: Ravindra 2020 年 8 月 21 日
So for Jacobi Method we start from the bottom of the matrix with values -24.2543 and -51.0782. if we correctly estimate the cos and sin angles the result should be
[c,s] = -0.4289 0.9033
The rotation matrix will be
[ -0.4289 -0.9033
0.9033 -0.4289]
The A matrix is modified using this rotation and will be:
-17.7147 -38.4117 30.6475
-51.3024 17.3859 -10.0354
-19.3323 -38.8931 30.3686
-51.2891 18.9043 -11.1523
-21.4200 -39.2796 29.9065
-51.1701 20.7146 -12.4891
56.5443 -3.7398 0.1882
0 -45.5334 32.5819
The next step will be with values -51.1701 and 56.5443
[c,s] = 0.6710 0.7415
in C++ at this step the estimated c & s both have negative signs
-0.6710 -0.7415 % in C++
The problem is the Jacobi rotation matrices from C++ are different what I calculate with my own algorithm.
This results in different answers. I am not sure which is correct.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange3-D Scene Control についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by