How to get the solution of AX=b using Conjugate gradient with A non square?

조회 수: 7 (최근 30일)
M.Shaarawy
M.Shaarawy 2018년 1월 9일
댓글: Jan 2018년 1월 9일
Hi guys.. I want to solve a linear system AX=b using Conjugate gradient, with A non-square matrix (13*52),and b (13*1) with the answer must be x (52*1)???
  댓글 수: 3
John D'Errico
John D'Errico 2018년 1월 9일
편집: John D'Errico 2018년 1월 9일
And why do you want to solve a tiny problem using an iterative solver when several better direct approaches are available? (Why do I think the only reason that makes any sense is to do your homework?)
I'll give you a hint, one that may not be terribly useful though. Since your CG code will need a starting point for the iteration, just use the result of backslash to start it. Thus...
X0 = A\b;
The nice thing is, since it already starts out at a solution itself, the code would not need to run at all. As Matt points out, this is only one of infinitely many solutions.
Or, how about this variation? Solve the linear system
eye(52)*X = A\b
using CG iterations. The nice thing is, it is VERY well posed as a linear system.
Jan
Jan 2018년 1월 9일
@Mohamed: What exactly is your question? What have you tried so far and which problem occurred?

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

답변 (1개)

John D'Errico
John D'Errico 2018년 1월 9일
편집: John D'Errico 2018년 1월 9일
Since this is surely homework, to forestall someone else just doing your homework for you, I'll give you a hint:
Tools like pcg won't solve a non-square system. So can you find a related problem, one that has the same solution, but does involve a square linear system?
Again, remember that the solution is not unique. But who cares? This is just homework. And since it is YOUR homework, you need to do the thinking, as that is all that is involved in this problem.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by