problem in eigenValues
Hi,
I checked the way calculating eigenValues in OF 2.1.1and found a problem. In OF, Code:
scalar a = -t.xx() - t.yy() - t.zz(); The eigenValues can be calculated as following: http://www.brown.edu/Departments/Eng...s/eq0158MP.gif |
let check it:
scalar Q = (a*a - 3*b)/9; 00137 scalar R = (2*a*a*a - 9*a*b + 27*c)/54; scalar sqrtQ = sqrt(Q); 00146 scalar theta = acos(R/(Q*sqrtQ)); 00147 00148 scalar m2SqrtQ = -2*sqrtQ; 00149 scalar aBy3 = a/3; So R=q/2;Q=-p/3;sqrtQ=sqrt(-p/3);theta=acos(R/(Q*sqrtQ))=acos(-3q*sqrt(-3/p)/(2p)) Then, the problem comes that theta is not equal to acos(3q*sqrt(-3/p)/2p) as in the above formulations in the picture Is it a bug? PS: why in OF, -lambda is returned instead of lambda? Xianbei |
after a further calculation, I found that it's right in OF if we list all the eigenValues.
for simplification, take 3q*sqrt(-3/p)/2p =x, in OF, theta = -x, so according to OF, lambda (only the cosin term)should be: 1\ cos(1/3*arccos(theta)+2*pi/3) 2\ cos(1/3*arccos(theta)) 3\ cos(1/3*arccos(theta)-2*pi/3) if we use x instead 1\ cos(1/3*arccos(x)+2*pi/3) 2\ cos(1/3*arccos(x)-2*pi/3) 3\ cos(1/3*arccos(theta)) which is the same as in the original form. So it's not a bug , but a misunderstanding of mine. But I still want to ask: why is -lambda returned instead of lambda? Xianbei |
Hi Xianbei,
Quote:
I say this because of this bug report and subsequent fixes: http://www.openfoam.org/mantisbt/view.php?id=1373 Best regards, Bruno |
All times are GMT -4. The time now is 00:37. |