how to get not zero roots for equations equating to zero?

Hi, I want to multiply a 3x3 matrix A with a column matrix [u11;u12;u13] and it is equated to 3x1 zero matrix. I want to get values of u11,u12 and u13.
%%%BxA=O A=?
B=[9.2 -5 0;-5 9.2 -5;0 -5 3.88]
A=[u11;u12;u13]
O=[0;0;0]

 Accepted Answer

You are not looking to find the roots, but a non-zero solution to a singular linear system in a homogeneous problem. Well, that is a technical way of saying it.
You want to solve the matrix problem B*u = 0. B is a 3x3 matrix, u a vector of unknowns.
The zero right hand side (all zero constant terms for the equation system) makes it homogeneous.
If B is not singular, then no solution exists, except for an all-zero solution. That essentially comes out from the definition of linear independence. So B must be singular for a non-zero solution to exist, to the problem with a zero right hand side.
So, can we find a set of linear combinations of the columns of the matrix B that sum to all zeros? That is really what you are trying to solve here.
We can learn that by computing the condition number of B, or simpler, the numerical rank of B. B is a 3x3 matrix. If it has rank 3, then there is no solution to the problem.
B=[9.2 -5 0;-5 9.2 -5;0 -5 3.88]
B =
9.2 -5 0
-5 9.2 -5
0 -5 3.88
rank(B)
ans =
3
cond(B)
ans =
1160.5
So B has rank 3. In fact, B has a condition number of 1160. The condition number for a double precision matrix must be roughly on the order of 1e16 or so for the matrix to be considered numerically singular. 1160 is not even in the ballpark. Both rank and cond tell you that B is not a singular matrix. Not even close.
So there is no solution at all, that will ever give you a zero result here. NONE.
If there were a solution possible, then the function null is the best way to generate it. null generates a basis for the null space of the matrix. Again, the technical description for finding a non-zero solution to your problem.
u = null(B)
u =
3×0 empty double matrix
So null agrees that no possible solution that is non-zero can ever exist for this problem.

3 Comments

So what if my matrixes are on the order 1e16. I have a 4x4 matrix which cond values are above 1e16. How can we solve the sistem ? When I write a basic solver for 4 unknowns I get my 4 unknow values all eqaul to zero. How can I solve this ?
Please Help its urgent
Read my answer again. you NEED the matrix to be singular. Anyway, you don't want to write your own solver! USE NULL!!!!!!!
A = [1 2 3 4;
5 6 7 8;
2 3 4 5;
3 4 5 7];
rank(A)
ans = 3
So A has rank 3. The conditino number of A should be effectively inf, or at least numerically so.
cond(A)
ans = 1.9177e+16
x = null(A)
x = 4×1
-0.4082 0.8165 -0.4082 -0.0000
I can scale that arbitrarily.
x = x/x(1)
x = 4×1
1.0000 -2.0000 1.0000 0.0000
You do NOT want to write your own solver, certainly not if you don't understand what I have said in my answer.
A*x
ans = 4×1
1.0e-14 * -0.0142 0.4156 0.1154 0.2415
And the result is floating point trash, effectively all zeros. This is as good as you can do in double precision arithmetic. You can do slightly better, if you use syms, since this is an integer matrix.
xsym = null(sym(A))
xsym = 
And here we see a solution that will be exact.
A*xsym
ans = 
Again, the use of sym was necessary to avoid the floating point trash.
My reading is that @Yigit Aygen has a situation where they have a matrix that they believe is not singular, and they are trying to solve the system, but they are getting all zeros out of their solver.
They could try solving sym() of their matrix to get something out.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!