Solution when number equations is less than than the number of variables

조회 수: 6 (최근 30일)
I am curious if there is some solution method in the case when we have the number of equation less the number of variables. For example, and X , Y are two variables. I would appreciate any guidance on this very basic querry.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 10월 23일
Is it a linear system? If so then do you want the equations that define the (hyper-) plane of solutions, or do you want a particular solution, such as "closest point" ?
Saifullah Khalid
Saifullah Khalid 2019년 10월 24일
Yes the system is linear and I need to findout the nearest point.

댓글을 달려면 로그인하십시오.

채택된 답변

John D'Errico
John D'Errico 2019년 10월 23일
There is no unique solution in general. That is, infinitely many possible solutions.
In this case, you have TWO variables, and ONE equation. So you could pick any value for X, substitute it into the equation, and then the value for Y is known, as long as b is not equal to zero. That is, you would compute
Y = (c - a*X)/b
Likewise, you could pick any value for Y, and then solve for X, as a function of Y. Again, that requires only that a is non-zero.
X = (c - b*Y)/a
Either approach is equally valid. There are also ways you can write a solution in the form of one that minimizes the norm of the vector [X,Y]. That is just another way to choose one of the infinitely many solutions.
So does a solution exist? Well, no. And, yes. But just not "a" solution. Any solution you desire.
  댓글 수: 5
Saifullah Khalid
Saifullah Khalid 2019년 10월 24일
Walter thanks, this method gives an exact solution but coefficients are set to 0 except the last one.
A = [4,5,6];%[a b]
c = 3;
S = A\c
% gives out
S =
0
0
0.5000
Instead can we use psuedo onverse method e.g.
A = [4,5,6];%[a b]
c = 3;
S = pinv(A)*c
% gives out
S =
0.1558
0.1948
0.2338
Saifullah Khalid
Saifullah Khalid 2019년 10월 24일
Thank you very much for very detailed insight. I have many unknowns but one eqaution. Your e answers provided me the solution, I was looking for.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by