This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Least Squares Solving gives wrong results

Tags: eigen, least squares, equation system eigen, least squares, equation system eigen, least squares, equation system
(comma "," separated)
Martin Hennig
Registered Member
Posts
2
Karma
0
Hi all,
I want to solve an equation system Ax=b with least squares.
In my program I do the following:
VectorXd x(54);
MatrixXd A(44, 54);
VectorXd b(44);
//Fill A, x and b with values...
x = A.jacobiSvd(ComputeFullU | ComputeFullV).solve(b);
double relative_error = (A*x - b).norm() / b.norm();

I always get real big values in my x vector and my relative error is around a million... Am I doing something wrong?
I know that in the solution vector should be values around -2.0 to 2.0 and with matlab I get a nice x vector with just a little error.
Problem is I cant use Matlab in my program.

Here is my input data:
A=[1.0000,1.0000,1.0000,0.9510,0.9510,0.9510,0.8996,0.8996,0.8996,0.8612,0.8612,0.8612,0.8862,0.8862,0.8862,0.8136,0.8136,0.8136,0.8136,0.8136,0.8136,0.7871,0.7871,0.7871,0.7778,0.7778,0.7778,0.8284,0.8284,0.8284,0.8825,0.8825,0.8825,0.8472,0.8472,0.8472,0.8731,0.8731,0.8731,0.8576,0.8576,0.8576,-4.8718,2.9077,6.6832,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;1.0000,1.0000,1.0000,0.9510,0.9510,0.9510,0.8996,0.8996,0.8996,0.8612,0.8612,0.8612,0.8862,0.8862,0.8862,0.8136,0.8136,0.8136,0.8136,0.8136,0.8136,0.7871,0.7871,0.7871,0.7778,0.7778,0.7778,0.8284,0.8284,0.8284,0.8825,0.8825,0.8825,0.8472,0.8472,0.8472,0.8731,0.8731,0.8731,0.8576,0.8576,0.8576,0.0000,0.0000,0.0000,-4.8718,2.9077,6.6832,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;1.0000,1.0000,1.0000,0.9510,0.9510,0.9510,0.8996,0.8996,0.8996,0.8612,0.8612,0.8612,0.8862,0.8862,0.8862,0.8136,0.8136,0.8136,0.8136,0.8136,0.8136,0.7871,0.7871,0.7871,0.7778,0.7778,0.7778,0.8284,0.8284,0.8284,0.8825,0.8825,0.8825,0.8472,0.8472,0.8472,0.8731,0.8731,0.8731,0.8576,0.8576,0.8576,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,-4.8718,2.9077,6.6832,0.0000,0.0000,1.0000;0.9510,0.9510,0.9510,1.0000,1.0000,1.0000,0.9441,0.9441,0.9441,0.9019,0.9019,0.9019,0.9193,0.9193,0.9193,0.7864,0.7864,0.7864,0.7887,0.7887,0.7887,0.8112,0.8112,0.8112,0.7992,0.7992,0.7992,0.8443,0.8443,0.8443,0.8901,0.8901,0.8901,0.8753,0.8753,0.8753,0.8989,0.8989,0.8989,0.8782,0.8782,0.8782,-1.8379,3.0729,7.7347,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.9510,0.9510,0.9510,1.0000,1.0000,1.0000,0.9441,0.9441,0.9441,0.9019,0.9019,0.9019,0.9193,0.9193,0.9193,0.7864,0.7864,0.7864,0.7887,0.7887,0.7887,0.8112,0.8112,0.8112,0.7992,0.7992,0.7992,0.8443,0.8443,0.8443,0.8901,0.8901,0.8901,0.8753,0.8753,0.8753,0.8989,0.8989,0.8989,0.8782,0.8782,0.8782,0.0000,0.0000,0.0000,-1.8379,3.0729,7.7347,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.9510,0.9510,0.9510,1.0000,1.0000,1.0000,0.9441,0.9441,0.9441,0.9019,0.9019,0.9019,0.9193,0.9193,0.9193,0.7864,0.7864,0.7864,0.7887,0.7887,0.7887,0.8112,0.8112,0.8112,0.7992,0.7992,0.7992,0.8443,0.8443,0.8443,0.8901,0.8901,0.8901,0.8753,0.8753,0.8753,0.8989,0.8989,0.8989,0.8782,0.8782,0.8782,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,-1.8379,3.0729,7.7347,0.0000,0.0000,1.0000;0.8996,0.8996,0.8996,0.9441,0.9441,0.9441,1.0000,1.0000,1.0000,0.9545,0.9545,0.9545,0.9176,0.9176,0.9176,0.7634,0.7634,0.7634,0.7656,0.7656,0.7656,0.8463,0.8463,0.8463,0.8286,0.8286,0.8286,0.8423,0.8423,0.8423,0.8719,0.8719,0.8719,0.8905,0.8905,0.8905,0.8976,0.8976,0.8976,0.8763,0.8763,0.8763,1.8380,3.1862,7.5737,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8996,0.8996,0.8996,0.9441,0.9441,0.9441,1.0000,1.0000,1.0000,0.9545,0.9545,0.9545,0.9176,0.9176,0.9176,0.7634,0.7634,0.7634,0.7656,0.7656,0.7656,0.8463,0.8463,0.8463,0.8286,0.8286,0.8286,0.8423,0.8423,0.8423,0.8719,0.8719,0.8719,0.8905,0.8905,0.8905,0.8976,0.8976,0.8976,0.8763,0.8763,0.8763,0.0000,0.0000,0.0000,1.8380,3.1862,7.5737,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8996,0.8996,0.8996,0.9441,0.9441,0.9441,1.0000,1.0000,1.0000,0.9545,0.9545,0.9545,0.9176,0.9176,0.9176,0.7634,0.7634,0.7634,0.7656,0.7656,0.7656,0.8463,0.8463,0.8463,0.8286,0.8286,0.8286,0.8423,0.8423,0.8423,0.8719,0.8719,0.8719,0.8905,0.8905,0.8905,0.8976,0.8976,0.8976,0.8763,0.8763,0.8763,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.8380,3.1862,7.5737,0.0000,0.0000,1.0000;0.8612,0.8612,0.8612,0.9019,0.9019,0.9019,0.9545,0.9545,0.9545,1.0000,1.0000,1.0000,0.8902,0.8902,0.8902,0.7477,0.7477,0.7477,0.7502,0.7502,0.7502,0.8770,0.8770,0.8770,0.8541,0.8541,0.8541,0.8300,0.8300,0.8300,0.8478,0.8478,0.8478,0.8867,0.8867,0.8867,0.8773,0.8773,0.8773,0.8600,0.8600,0.8600,4.6911,2.9359,6.7477,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8612,0.8612,0.8612,0.9019,0.9019,0.9019,0.9545,0.9545,0.9545,1.0000,1.0000,1.0000,0.8902,0.8902,0.8902,0.7477,0.7477,0.7477,0.7502,0.7502,0.7502,0.8770,0.8770,0.8770,0.8541,0.8541,0.8541,0.8300,0.8300,0.8300,0.8478,0.8478,0.8478,0.8867,0.8867,0.8867,0.8773,0.8773,0.8773,0.8600,0.8600,0.8600,0.0000,0.0000,0.0000,4.6911,2.9359,6.7477,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8612,0.8612,0.8612,0.9019,0.9019,0.9019,0.9545,0.9545,0.9545,1.0000,1.0000,1.0000,0.8902,0.8902,0.8902,0.7477,0.7477,0.7477,0.7502,0.7502,0.7502,0.8770,0.8770,0.8770,0.8541,0.8541,0.8541,0.8300,0.8300,0.8300,0.8478,0.8478,0.8478,0.8867,0.8867,0.8867,0.8773,0.8773,0.8773,0.8600,0.8600,0.8600,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,4.6911,2.9359,6.7477,0.0000,0.0000,1.0000;0.8862,0.8862,0.8862,0.9193,0.9193,0.9193,0.9176,0.9176,0.9176,0.8902,0.8902,0.8902,1.0000,1.0000,1.0000,0.7299,0.7299,0.7299,0.7469,0.7469,0.7469,0.7857,0.7857,0.7857,0.7887,0.7887,0.7887,0.8910,0.8910,0.8910,0.9136,0.9136,0.9136,0.9140,0.9140,0.9140,0.9546,0.9546,0.9546,0.9268,0.9268,0.9268,0.1066,0.7369,12.1840,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8862,0.8862,0.8862,0.9193,0.9193,0.9193,0.9176,0.9176,0.9176,0.8902,0.8902,0.8902,1.0000,1.0000,1.0000,0.7299,0.7299,0.7299,0.7469,0.7469,0.7469,0.7857,0.7857,0.7857,0.7887,0.7887,0.7887,0.8910,0.8910,0.8910,0.9136,0.9136,0.9136,0.9140,0.9140,0.9140,0.9546,0.9546,0.9546,0.9268,0.9268,0.9268,0.0000,0.0000,0.0000,0.1066,0.7369,12.1840,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8862,0.8862,0.8862,0.9193,0.9193,0.9193,0.9176,0.9176,0.9176,0.8902,0.8902,0.8902,1.0000,1.0000,1.0000,0.7299,0.7299,0.7299,0.7469,0.7469,0.7469,0.7857,0.7857,0.7857,0.7887,0.7887,0.7887,0.8910,0.8910,0.8910,0.9136,0.9136,0.9136,0.9140,0.9140,0.9140,0.9546,0.9546,0.9546,0.9268,0.9268,0.9268,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.1066,0.7369,12.1840,0.0000,0.0000,1.0000;0.8136,0.8136,0.8136,0.7864,0.7864,0.7864,0.7634,0.7634,0.7634,0.7477,0.7477,0.7477,0.7299,0.7299,0.7299,1.0000,1.0000,1.0000,0.9010,0.9010,0.9010,0.7515,0.7515,0.7515,0.7439,0.7439,0.7439,0.7130,0.7130,0.7130,0.7550,0.7550,0.7550,0.7291,0.7291,0.7291,0.7318,0.7318,0.7318,0.7281,0.7281,0.7281,-8.9944,1.4907,-5.7811,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8136,0.8136,0.8136,0.7864,0.7864,0.7864,0.7634,0.7634,0.7634,0.7477,0.7477,0.7477,0.7299,0.7299,0.7299,1.0000,1.0000,1.0000,0.9010,0.9010,0.9010,0.7515,0.7515,0.7515,0.7439,0.7439,0.7439,0.7130,0.7130,0.7130,0.7550,0.7550,0.7550,0.7291,0.7291,0.7291,0.7318,0.7318,0.7318,0.7281,0.7281,0.7281,0.0000,0.0000,0.0000,-8.9944,1.4907,-5.7811,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8136,0.8136,0.8136,0.7864,0.7864,0.7864,0.7634,0.7634,0.7634,0.7477,0.7477,0.7477,0.7299,0.7299,0.7299,1.0000,1.0000,1.0000,0.9010,0.9010,0.9010,0.7515,0.7515,0.7515,0.7439,0.7439,0.7439,0.7130,0.7130,0.7130,0.7550,0.7550,0.7550,0.7291,0.7291,0.7291,0.7318,0.7318,0.7318,0.7281,0.7281,0.7281,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,-8.9944,1.4907,-5.7811,0.0000,0.0000,1.0000;0.8136,0.8136,0.8136,0.7887,0.7887,0.7887,0.7656,0.7656,0.7656,0.7502,0.7502,0.7502,0.7469,0.7469,0.7469,0.9010,0.9010,0.9010,1.0000,1.0000,1.0000,0.7472,0.7472,0.7472,0.7651,0.7651,0.7651,0.7563,0.7563,0.7563,0.7932,0.7932,0.7932,0.7616,0.7616,0.7616,0.7600,0.7600,0.7600,0.7634,0.7634,0.7634,-8.5737,-4.7366,-3.4230,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8136,0.8136,0.8136,0.7887,0.7887,0.7887,0.7656,0.7656,0.7656,0.7502,0.7502,0.7502,0.7469,0.7469,0.7469,0.9010,0.9010,0.9010,1.0000,1.0000,1.0000,0.7472,0.7472,0.7472,0.7651,0.7651,0.7651,0.7563,0.7563,0.7563,0.7932,0.7932,0.7932,0.7616,0.7616,0.7616,0.7600,0.7600,0.7600,0.7634,0.7634,0.7634,0.0000,0.0000,0.0000,-8.5737,-4.7366,-3.4230,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8136,0.8136,0.8136,0.7887,0.7887,0.7887,0.7656,0.7656,0.7656,0.7502,0.7502,0.7502,0.7469,0.7469,0.7469,0.9010,0.9010,0.9010,1.0000,1.0000,1.0000,0.7472,0.7472,0.7472,0.7651,0.7651,0.7651,0.7563,0.7563,0.7563,0.7932,0.7932,0.7932,0.7616,0.7616,0.7616,0.7600,0.7600,0.7600,0.7634,0.7634,0.7634,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,-8.5737,-4.7366,-3.4230,0.0000,0.0000,1.0000;0.7871,0.7871,0.7871,0.8112,0.8112,0.8112,0.8463,0.8463,0.8463,0.8770,0.8770,0.8770,0.7857,0.7857,0.7857,0.7515,0.7515,0.7515,0.7472,0.7472,0.7472,1.0000,1.0000,1.0000,0.9094,0.9094,0.9094,0.7586,0.7586,0.7586,0.7709,0.7709,0.7709,0.8109,0.8109,0.8109,0.7853,0.7853,0.7853,0.7778,0.7778,0.7778,8.5503,2.1315,-0.6662,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.7871,0.7871,0.7871,0.8112,0.8112,0.8112,0.8463,0.8463,0.8463,0.8770,0.8770,0.8770,0.7857,0.7857,0.7857,0.7515,0.7515,0.7515,0.7472,0.7472,0.7472,1.0000,1.0000,1.0000,0.9094,0.9094,0.9094,0.7586,0.7586,0.7586,0.7709,0.7709,0.7709,0.8109,0.8109,0.8109,0.7853,0.7853,0.7853,0.7778,0.7778,0.7778,0.0000,0.0000,0.0000,8.5503,2.1315,-0.6662,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.7871,0.7871,0.7871,0.8112,0.8112,0.8112,0.8463,0.8463,0.8463,0.8770,0.8770,0.8770,0.7857,0.7857,0.7857,0.7515,0.7515,0.7515,0.7472,0.7472,0.7472,1.0000,1.0000,1.0000,0.9094,0.9094,0.9094,0.7586,0.7586,0.7586,0.7709,0.7709,0.7709,0.8109,0.8109,0.8109,0.7853,0.7853,0.7853,0.7778,0.7778,0.7778,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,8.5503,2.1315,-0.6662,0.0000,0.0000,1.0000;0.7778,0.7778,0.7778,0.7992,0.7992,0.7992,0.8286,0.8286,0.8286,0.8541,0.8541,0.8541,0.7887,0.7887,0.7887,0.7439,0.7439,0.7439,0.7651,0.7651,0.7651,0.9094,0.9094,0.9094,1.0000,1.0000,1.0000,0.7946,0.7946,0.7946,0.7953,0.7953,0.7953,0.8406,0.8406,0.8406,0.8028,0.8028,0.8028,0.8043,0.8043,0.8043,8.1652,-3.8769,0.1605,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.7778,0.7778,0.7778,0.7992,0.7992,0.7992,0.8286,0.8286,0.8286,0.8541,0.8541,0.8541,0.7887,0.7887,0.7887,0.7439,0.7439,0.7439,0.7651,0.7651,0.7651,0.9094,0.9094,0.9094,1.0000,1.0000,1.0000,0.7946,0.7946,0.7946,0.7953,0.7953,0.7953,0.8406,0.8406,0.8406,0.8028,0.8028,0.8028,0.8043,0.8043,0.8043,0.0000,0.0000,0.0000,8.1652,-3.8769,0.1605,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.7778,0.7778,0.7778,0.7992,0.7992,0.7992,0.8286,0.8286,0.8286,0.8541,0.8541,0.8541,0.7887,0.7887,0.7887,0.7439,0.7439,0.7439,0.7651,0.7651,0.7651,0.9094,0.9094,0.9094,1.0000,1.0000,1.0000,0.7946,0.7946,0.7946,0.7953,0.7953,0.7953,0.8406,0.8406,0.8406,0.8028,0.8028,0.8028,0.8043,0.8043,0.8043,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,8.1652,-3.8769,0.1605,0.0000,0.0000,1.0000;0.8284,0.8284,0.8284,0.8443,0.8443,0.8443,0.8423,0.8423,0.8423,0.8300,0.8300,0.8300,0.8910,0.8910,0.8910,0.7130,0.7130,0.7130,0.7563,0.7563,0.7563,0.7586,0.7586,0.7586,0.7946,0.7946,0.7946,1.0000,1.0000,1.0000,0.9354,0.9354,0.9354,0.9322,0.9322,0.9322,0.9321,0.9321,0.9321,0.9596,0.9596,0.9596,0.0534,-6.6492,12.1198,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8284,0.8284,0.8284,0.8443,0.8443,0.8443,0.8423,0.8423,0.8423,0.8300,0.8300,0.8300,0.8910,0.8910,0.8910,0.7130,0.7130,0.7130,0.7563,0.7563,0.7563,0.7586,0.7586,0.7586,0.7946,0.7946,0.7946,1.0000,1.0000,1.0000,0.9354,0.9354,0.9354,0.9322,0.9322,0.9322,0.9321,0.9321,0.9321,0.9596,0.9596,0.9596,0.0000,0.0000,0.0000,0.0534,-6.6492,12.1198,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8284,0.8284,0.8284,0.8443,0.8443,0.8443,0.8423,0.8423,0.8423,0.8300,0.8300,0.8300,0.8910,0.8910,0.8910,0.7130,0.7130,0.7130,0.7563,0.7563,0.7563,0.7586,0.7586,0.7586,0.7946,0.7946,0.7946,1.0000,1.0000,1.0000,0.9354,0.9354,0.9354,0.9322,0.9322,0.9322,0.9321,0.9321,0.9321,0.9596,0.9596,0.9596,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0534,-6.6492,12.1198,0.0000,0.0000,1.0000;0.8825,0.8825,0.8825,0.8901,0.8901,0.8901,0.8719,0.8719,0.8719,0.8478,0.8478,0.8478,0.9136,0.9136,0.9136,0.7550,0.7550,0.7550,0.7932,0.7932,0.7932,0.7709,0.7709,0.7709,0.7953,0.7953,0.7953,0.9354,0.9354,0.9354,1.0000,1.0000,1.0000,0.9206,0.9206,0.9206,0.9455,0.9455,0.9455,0.9540,0.9540,0.9540,-2.5846,-3.9460,10.1210,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8825,0.8825,0.8825,0.8901,0.8901,0.8901,0.8719,0.8719,0.8719,0.8478,0.8478,0.8478,0.9136,0.9136,0.9136,0.7550,0.7550,0.7550,0.7932,0.7932,0.7932,0.7709,0.7709,0.7709,0.7953,0.7953,0.7953,0.9354,0.9354,0.9354,1.0000,1.0000,1.0000,0.9206,0.9206,0.9206,0.9455,0.9455,0.9455,0.9540,0.9540,0.9540,0.0000,0.0000,0.0000,-2.5846,-3.9460,10.1210,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8825,0.8825,0.8825,0.8901,0.8901,0.8901,0.8719,0.8719,0.8719,0.8478,0.8478,0.8478,0.9136,0.9136,0.9136,0.7550,0.7550,0.7550,0.7932,0.7932,0.7932,0.7709,0.7709,0.7709,0.7953,0.7953,0.7953,0.9354,0.9354,0.9354,1.0000,1.0000,1.0000,0.9206,0.9206,0.9206,0.9455,0.9455,0.9455,0.9540,0.9540,0.9540,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,-2.5846,-3.9460,10.1210,0.0000,0.0000,1.0000;0.8472,0.8472,0.8472,0.8753,0.8753,0.8753,0.8905,0.8905,0.8905,0.8867,0.8867,0.8867,0.9140,0.9140,0.9140,0.7291,0.7291,0.7291,0.7616,0.7616,0.7616,0.8109,0.8109,0.8109,0.8406,0.8406,0.8406,0.9322,0.9322,0.9322,0.9206,0.9206,0.9206,1.0000,1.0000,1.0000,0.9468,0.9468,0.9468,0.9524,0.9524,0.9524,2.7000,-3.8282,9.8333,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8472,0.8472,0.8472,0.8753,0.8753,0.8753,0.8905,0.8905,0.8905,0.8867,0.8867,0.8867,0.9140,0.9140,0.9140,0.7291,0.7291,0.7291,0.7616,0.7616,0.7616,0.8109,0.8109,0.8109,0.8406,0.8406,0.8406,0.9322,0.9322,0.9322,0.9206,0.9206,0.9206,1.0000,1.0000,1.0000,0.9468,0.9468,0.9468,0.9524,0.9524,0.9524,0.0000,0.0000,0.0000,2.7000,-3.8282,9.8333,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8472,0.8472,0.8472,0.8753,0.8753,0.8753,0.8905,0.8905,0.8905,0.8867,0.8867,0.8867,0.9140,0.9140,0.9140,0.7291,0.7291,0.7291,0.7616,0.7616,0.7616,0.8109,0.8109,0.8109,0.8406,0.8406,0.8406,0.9322,0.9322,0.9322,0.9206,0.9206,0.9206,1.0000,1.0000,1.0000,0.9468,0.9468,0.9468,0.9524,0.9524,0.9524,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,2.7000,-3.8282,9.8333,0.0000,0.0000,1.0000;0.8731,0.8731,0.8731,0.8989,0.8989,0.8989,0.8976,0.8976,0.8976,0.8773,0.8773,0.8773,0.9546,0.9546,0.9546,0.7318,0.7318,0.7318,0.7600,0.7600,0.7600,0.7853,0.7853,0.7853,0.8028,0.8028,0.8028,0.9321,0.9321,0.9321,0.9455,0.9455,0.9455,0.9468,0.9468,0.9468,1.0000,1.0000,1.0000,0.9707,0.9707,0.9707,0.1670,-2.1792,11.5973,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8731,0.8731,0.8731,0.8989,0.8989,0.8989,0.8976,0.8976,0.8976,0.8773,0.8773,0.8773,0.9546,0.9546,0.9546,0.7318,0.7318,0.7318,0.7600,0.7600,0.7600,0.7853,0.7853,0.7853,0.8028,0.8028,0.8028,0.9321,0.9321,0.9321,0.9455,0.9455,0.9455,0.9468,0.9468,0.9468,1.0000,1.0000,1.0000,0.9707,0.9707,0.9707,0.0000,0.0000,0.0000,0.1670,-2.1792,11.5973,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8731,0.8731,0.8731,0.8989,0.8989,0.8989,0.8976,0.8976,0.8976,0.8773,0.8773,0.8773,0.9546,0.9546,0.9546,0.7318,0.7318,0.7318,0.7600,0.7600,0.7600,0.7853,0.7853,0.7853,0.8028,0.8028,0.8028,0.9321,0.9321,0.9321,0.9455,0.9455,0.9455,0.9468,0.9468,0.9468,1.0000,1.0000,1.0000,0.9707,0.9707,0.9707,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.1670,-2.1792,11.5973,0.0000,0.0000,1.0000;0.8576,0.8576,0.8576,0.8782,0.8782,0.8782,0.8763,0.8763,0.8763,0.8600,0.8600,0.8600,0.9268,0.9268,0.9268,0.7281,0.7281,0.7281,0.7634,0.7634,0.7634,0.7778,0.7778,0.7778,0.8043,0.8043,0.8043,0.9596,0.9596,0.9596,0.9540,0.9540,0.9540,0.9524,0.9524,0.9524,0.9707,0.9707,0.9707,1.0000,1.0000,1.0000,0.0847,-4.0789,11.5142,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000;0.8576,0.8576,0.8576,0.8782,0.8782,0.8782,0.8763,0.8763,0.8763,0.8600,0.8600,0.8600,0.9268,0.9268,0.9268,0.7281,0.7281,0.7281,0.7634,0.7634,0.7634,0.7778,0.7778,0.7778,0.8043,0.8043,0.8043,0.9596,0.9596,0.9596,0.9540,0.9540,0.9540,0.9524,0.9524,0.9524,0.9707,0.9707,0.9707,1.0000,1.0000,1.0000,0.0000,0.0000,0.0000,0.0847,-4.0789,11.5142,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000;0.8576,0.8576,0.8576,0.8782,0.8782,0.8782,0.8763,0.8763,0.8763,0.8600,0.8600,0.8600,0.9268,0.9268,0.9268,0.7281,0.7281,0.7281,0.7634,0.7634,0.7634,0.7778,0.7778,0.7778,0.8043,0.8043,0.8043,0.9596,0.9596,0.9596,0.9540,0.9540,0.9540,0.9524,0.9524,0.9524,0.9707,0.9707,0.9707,1.0000,1.0000,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0847,-4.0789,11.5142,0.0000,0.0000,1.0000;1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,1.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000;-4.8718,2.9077,6.6832,-1.8379,3.0729,7.7347,1.8380,3.1862,7.5737,4.6911,2.9359,6.7477,0.1066,0.7369,12.1840,-8.9944,1.4907,-5.7811,-8.5737,-4.7366,-3.4230,8.5503,2.1315,-0.6662,8.1652,-3.8769,0.1605,0.0534,-6.6492,12.1198,-2.5846,-3.9460,10.1210,2.7000,-3.8282,9.8333,0.1670,-2.1792,11.5973,0.0847,-4.0789,11.5142,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000,0.0000;];
b=[0.0132;-0.7984;0.3375;0.4238;-0.5040;0.1298;-0.4237;-0.3907;-0.0312;-0.1939;-0.7702;0.4020;0.1066;0.4995;-0.0042;-1.3118;-1.5623;-4.3572;-1.2877;-2.1275;-2.4368;0.8677;-0.9215;0.7576;1.2523;-1.2252;0.7880;0.0534;0.8329;2.3970;0.3824;-0.4462;1.6129;-0.2670;-0.3284;1.3252;0.1670;0.4413;0.8238;0.0847;0.4926;1.1158;0.0000;0.0000];
x=A\b

I hope it's ok to post such big data here...

Thanks in advance for any hints!
Have a nice Weekend,
Martin
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I don't have time to look at your precise example. Sometime ColPivHouseholderQr works better, worth trying it.
Martin Hennig
Registered Member
Posts
2
Karma
0
Thank you, it worked perfectly! I didnt know that this function also could be used for least squared solutions, I thought the equation system had to be definitely solvable for this. Thanks for your help!


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]