ある行列の一般逆行列を求める際にpinvを使用すると、フリーズしてしまいます。
Show older comments
行列の一般逆行列を計算する際、行列によってすぐに計算されるものとフリーズしてしまうものがあります。行列のサイズに大きな差はないのですが、、、 たとえば、 A =
[ 3^(1/2)/6, 0, 1/2, -3^(1/2)/(3*h), 0, -1/h, 0, 0]
[ 3^(1/2)/6, 0, 1/2, 3^(1/2)/(3*h), 0, 1/h, 0, 0]
[ -3^(1/2)/12, 3^(1/2)/4, 0, 3^(1/2)/(6*h), -3^(1/2)/(2*h), 0, 0, 0]
[ -3^(1/2)/12, 3^(1/2)/4, 0, -3^(1/2)/(6*h), 3^(1/2)/(2*h), 0, 0, 0]
[ 3^(1/2)/6, 0, -1/2, -3^(1/2)/(3*h), 0, 1/h, 0, 0]
[ 3^(1/2)/6, 0, -1/2, 3^(1/2)/(3*h), 0, -1/h, 0, 0]
[ 0, 0, 0, 0, 0, 0, -1/s, 0]
[ 0, 0, 0, 0, 0, 0, 1/(2*s), 3^(1/2)/(2*s)]
[ 0, 0, 0, 0, 0, 0, 1/(2*s), -3^(1/2)/(2*s)]
はすぐに計算されますが、
B =
[ 3/4, 3^(1/2)/4, 0, 3^(1/2)/8, 3/4, 3^(1/2)/4, 0, 0, 0, 0, 0, 0]
[ 3^(1/2)/4, 0, 0, 0, -3^(1/2)/4, 0, 0, 0, 0, 0, 0, 0]
[ 1/4, 0, 1, 3^(1/2)/4, 1/4, 3^(1/2)/4, 0, 0, 0, 0, 0, 0]
[ -(3*h)/8, (3^(1/2)*h)/8, 0, (3^(1/2)*h)/16, -(3*h)/8, (3^(1/2)*h)/16, 0, 0, 0, 0, 0, 0]
[ -(3^(1/2)*h)/8, 0, 0, 0, (3^(1/2)*h)/8, 0, 0, 0, 0, 0, 0, 0]
[ -h/8, 0, -h/2, (3^(1/2)*h)/8, -h/8, (3^(1/2)*h)/8, 0, 0, 0, 0, 0, 0]
[ 0, 0, 0, 0, 0, 0, (3^(1/2)*s)/4, 0, 0, -(3^(1/2)*s)/4, 0, -(3^(1/2)*s)/4]
[ 0, 0, 0, 0, 0, 0, 0, 0, -s/4, s/4, s/4, -s/4]
はフリーズします。(s,hはsyms s hでシンボリック変数を作成しています。) 問題点を指摘していただければ、幸いです。よろしくお願い致します。
2 Comments
Aoi Midori
on 3 Dec 2018
上の記述で行列AとBを作成すると1x8および1x12のサイズになるのですが、9x8および8x12のサイズでpinv実行されたということですよね?
m17td024
on 3 Dec 2018
Accepted Answer
More Answers (0)
Categories
Find more on 線形代数 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!