2018-08-19 20:27 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003015OpenFOAM[All Projects] Bugpublic2018-07-24 16:41
Reportermarniemann 
Assigned Towill 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86_64OSUbuntuOS Version16.04 and 17.04
Product Version5.x 
Target VersionFixed in Version6 
Summary0003015: eigenValue and eigenVector computation give wrong results
DescriptionFor some cases eigenvalues are computed with the wrong sign, e.g. negative instead of positive eigenvalues for the (3x3) identity matrix.
Moreover, eigenvectors for eigenvalues with multiplicity are identical.

The following short example illustrates this behavior where the analytical results were computed using wolframalpha.com, e.g. with eigenvalues{{1,0,0},{0,1,0},{0,0,1}}:

    tensor test, test2;
    vector test1;
    test = tensor(1,0,0, 0,1,0, 0,0,1);
    test1 = eigenValues(test);
    test2 = eigenVectors(test, test1);
    // analytical values: (1, 1, 1)
    // vectors: (0,0,1), (0,1,0), (0,0,1)
    Info << "EVtest: " << test << ", " << test1 << ", " << test2 << endl;
    test = tensor(1,2,0, 2,1,0, 0,0,1);
    test1 = eigenValues(test);
    test2 = eigenVectors(test, test1);
    // analytical values: (3, 1, -1)
    // vectors: (1,1,0), (-1,1,0), (0,0,1)
    Info << "EVtest: " << test << ", " << test1 << ", " << test2 << endl;
    test = tensor(2,1,1, 1,2,1, 1,1,2);
    test1 = eigenValues(test);
    test2 = eigenVectors(test, test1);
    // analytical values: (4, 1, 1)
    // vectors: (1,1,1), (-1,0,1), (-1,1,0)
    Info << "EVtest: " << test << ", " << test1 << ", " << test2 << endl;

Output of this example:

EVtest: (1 0 0 0 1 0 0 0 1), (-1 -1 -1), (1 0 0 1 0 0 1 0 0)
EVtest: (1 2 0 2 1 0 0 0 1), (-1 1 3), (0.707107 -0.707107 0 -0 -0 1 0.707107 0.707107 0)
EVtest: (2 1 1 1 2 1 1 1 2), (-1 -1 4), (0.942809 -0.235702 -0.235702 0.942809 -0.235702 -0.235702 0.57735 0.57735 0.57735)
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0009874

will (manager)

Thanks for the report. There was a bug in the handling of repeated roots in cubicEqn and quadraticEqn.

Resolved in dev by commit 9cf8078f, and in version 6 by 82b3c0c1.
+Notes

-Issue History
Date Modified Username Field Change
2018-07-24 13:27 marniemann New Issue
2018-07-24 16:41 will Assigned To => will
2018-07-24 16:41 will Status new => resolved
2018-07-24 16:41 will Resolution open => fixed
2018-07-24 16:41 will Fixed in Version => 6
2018-07-24 16:41 will Note Added: 0009874
+Issue History