solve overdetermined linear system

9 次查看(过去 30 天)
Hello. I need to solve overdetermined linear system A*x=B, where x is [a1 a2 a3 a4 a5]. I got a solution with command
inv(A'*A)*A'*B;
but the answer is not what I need, because i have a theoretical solution for this problem. Can I somehow set the initial approximation to get the solution I need?

回答(1 个)

John D'Errico
John D'Errico 2017-12-27
First of all, DON'T USE THAT SOLUTION!!!!!!!! That is a bad idea, because it is terrible when applied to moderately ill-posed problems.
Instead, use
coef = A\b;
This will be more accurate.
You say that the answer is not what you wanted. Too bad. You cannot set an initial start point for a problem that has a unique solution.
An alternative solution is to use lsqr.
coef = lsqr(A,b);
You can set the start point for lsqr. From the help for lsqr...
X = lsqr(A,B,TOL,MAXIT,M1,M2,X0) specifies the P-by-1 initial guess. If
X0 is [] then lsqr uses the default, an all zero vector.
But as long as A is full rank, then you will get the same solution, no matter what the start point.
So, is A of less than full rank? If so, then the solution is non-unique, and there are infinitely many equally good solutions.
If you have additional information about the problem, then you need to explain what it is.
  5 个评论
John D'Errico
John D'Errico 2017-12-27
编辑:John D'Errico 2017-12-27
I cannot run your code though, because I do not know what input to provide.
Your .mat file does not contain A and B, which is all that we need here for the moment.
But if A has rank 2 AND it has 2 columns, then this explains why you get the same answer from both backslash and lsqr. It will be of full rank. If A had 3 or 4 columns and 30-40 rows, and still was rank 2, then backslash and lsqr can return different results, because there will be infinitely many results. So I think you are trying the case where A has 2 columns.
Alexandr Fedorov
Alexandr Fedorov 2017-12-27
编辑:Alexandr Fedorov 2017-12-27
But how i can make the rank of A is 3 or 4, when i take like 3 members in sum? I take for example 40 point, 3 members and 223 MPa of stress. Ok. I finding K1 which is mode I stress-intensity factors by solve this system
The left side of expression is stress from ANSYS and F1n is (q=n/2):
. K1=a1*sqrt(2*pi). In theory K1=Sigma*sqrt(2*pi*l), where l is lenght of fracture, Sigma is the tensile load value. So theta and r i got from picture of stress intensity from ANSYS.
This theory is described in Interference-optical Methods of Solid Mechanics by Razumovsky, Igor A.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Stress and Strain 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by