Why do my laptop and work computer produce different results when adding a small term to a matrix?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Luqman Saleem
am 12 Aug. 2024
Bearbeitet: Torsten
am 12 Aug. 2024
In the following code, when I add the term eye(8)*(0.0001) to the matrix F, my laptop and my work computer return different values for the variable Uk. Could anyone please help me understand what is happening?
I am using MATLAB R2024a on both computers.
clear; clc;
% constants
a = 1;
x1 = 1;
x2 = 0;
x4 = 0;
lambda = 1;
sigma3 = diag([1 1 1 1 -1 -1 -1 -1]);
kx = -2.0944;
ky = -3.6276;
F = [ - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, - lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 - 4.082e-17i) - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 - 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 - 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 - 1.347i), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), 0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 - 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 - 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 - 5.443e-17i)), - lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 - 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i - a*ky*0.433i)*(0.8889 + 1.11e-16i)), - lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.3333 + 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 - 1.155i) - 1.0*x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i))
- lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 - 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 - 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 - 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 - 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 - 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 - 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 - 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 - 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.6667 - 1.027e-33i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i - 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i - a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 - 1.027e-33i) - 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i - a*ky*0.433i))
lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 - 0.1925i), - lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 - 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i - a*ky*0.433i)*(0.8889 + 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.6667 - 1.027e-33i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 + 1.54i), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 - 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 - 1.388e-17i))
lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 - 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 - 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, - lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.3333 + 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 - 1.155i) - 1.0*x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 - 1.027e-33i) - 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i - a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 - 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 - 1.388e-17i)), 0
0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), - lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.6667 - 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 - 1.11e-16i) + exp(a*kx*0.25i - a*ky*0.433i)*(0.8889 - 1.11e-16i)), - lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.3333 - 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) - 1.0*x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i)*(0.8889 - 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 - 5.551e-17i)), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, - lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 - 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 - 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 - 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 - 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 - 0.1925i)
lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.6667 + 1.027e-33i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 - 1.54i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) - 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i - a*ky*0.433i)), - lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 - 4.082e-17i) - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 - 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 - 2.721e-17i)), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 - 1.347i)
- lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.6667 - 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 - 1.11e-16i) + exp(a*kx*0.25i - a*ky*0.433i)*(0.8889 - 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.6667 + 1.027e-33i) + x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i - 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i - a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 - 1.347i), lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 - 0.1925i), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i)
- lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.3333 - 0.5774i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) - 1.0*x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i)*(0.8889 - 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 - 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) - 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i - a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i - 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i - a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i - a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i)) + x2*(exp(- a*kx*0.75i - a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) - x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i - a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 - 0.2887i) - x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 - 0.1925i), - 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda
];
FF = F; % this gives same "Uk" on both computers
FF = F + eye(8)*(0.0001); % this gives different "Uk" on both computers
K = chol(FF,"upper");
Q = K*sigma3*(K'); % Q is same on both computers
[RV,D,~] = eig(Q);
[D,I] = sort(diag(real(D)),'descend');
RV = RV(:, I);
Uk = RV;
Lk = diag(D);
% more specifically i get these results with "FF = F + eye(8)*(0.0001)":
Uk_on_laptop = [-0.5581 - 0.2520i -0.4914 - 0.1718i -0.1074 - 0.3017i 0.2309 - 0.2705i 0.0962 - 0.0850i -0.1447 - 0.2249i 0.1924 - 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 - 0.1237i 0.1084 - 0.2927i -0.2900 + 0.2300i -0.2030 + 0.1332i -0.0739 - 0.1924i 0.2089 - 0.0371i 0.0000 + 0.0000i
-0.0445 - 0.4460i -0.0758 - 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i -0.2467 - 0.0430i -0.1713 + 0.1603i 0.0220 + 0.2039i 0.0000 - 0.0000i
0.3210 - 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 - 0.4949i 0.0400 - 0.2456i 0.1073 + 0.1394i 0.2399 - 0.1355i 0.0000 - 0.0000i
0.0000 - 0.0000i 0.1304 - 0.0722i -0.2064 + 0.0175i 0.0769 - 0.0629i -0.2355 + 0.1429i 0.2359 - 0.0767i 0.2660 - 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 - 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i 0.1507 - 0.1648i 0.2370 - 0.2627i 0.4938 - 0.4630i 0.2283 - 0.3953i
-0.0000 - 0.0000i -0.0689 - 0.1710i 0.0363 - 0.2315i 0.0199 + 0.2998i 0.0948 - 0.6211i -0.0523 + 0.5134i -0.0370 - 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i -0.5286 + 0.0000i -0.5890 + 0.0000i 0.3516 + 0.0000i 0.2500 + 0.0000i];
Uk_on_work = [-0.5581 - 0.2520i -0.4914 - 0.1718i -0.1074 - 0.3017i 0.2309 - 0.2705i -0.0962 + 0.0850i -0.1447 - 0.2249i -0.1924 + 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 - 0.1237i 0.1084 - 0.2927i -0.2900 + 0.2300i 0.2030 - 0.1332i -0.0739 - 0.1924i -0.2089 + 0.0371i 0.0000 + 0.0000i
-0.0445 - 0.4460i -0.0758 - 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i 0.2467 + 0.0430i -0.1713 + 0.1603i -0.0220 - 0.2039i 0.0000 - 0.0000i
0.3210 - 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 - 0.4949i -0.0400 + 0.2456i 0.1073 + 0.1394i -0.2399 + 0.1355i 0.0000 - 0.0000i
0.0000 - 0.0000i 0.1304 - 0.0722i -0.2064 + 0.0175i 0.0769 - 0.0629i 0.2355 - 0.1429i 0.2359 - 0.0767i -0.2660 + 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 - 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i -0.1507 + 0.1648i 0.2370 - 0.2627i -0.4938 + 0.4630i 0.2283 - 0.3953i
-0.0000 - 0.0000i -0.0689 - 0.1710i 0.0363 - 0.2315i 0.0199 + 0.2998i -0.0948 + 0.6211i -0.0523 + 0.5134i 0.0370 + 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i 0.5286 + 0.0000i -0.5890 + 0.0000i -0.3516 + 0.0000i 0.2500 + 0.0000i];
0 Kommentare
Akzeptierte Antwort
Torsten
am 12 Aug. 2024
Verschoben: Torsten
am 12 Aug. 2024
In the representation with 4 decimal places, the results don't seem to differ.
But it's not unusual that computations on different computers can give different results:
4 Kommentare
Torsten
am 12 Aug. 2024
Bearbeitet: Torsten
am 12 Aug. 2024
I repeat:
If the eigenvalues are simple (as it seems in your case), the eigenvectors are only unique up to their sign. The MATLAB algorithms on both computers seem to differ: one of them chose e, the other chose -e for the 5th eigenvalue.
Comparing eigenvectors will become almost impossible if you have eigenvalues of multiplicity > 1.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!