CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Wiki > Biconjugate gradient method

Biconjugate gradient method

From CFD-Wiki

(Difference between revisions)
Jump to: navigation, search
m (Algorithm: Made the use of = and := consistent)
 
(5 intermediate revisions not shown)
Line 8: Line 8:
A = coefficient matrix <br>
A = coefficient matrix <br>
-
M = the precondioning matrix constructued by matrix A <br>
+
M = the preconditioning matrix constructed by matrix A <br>
-
 
+
=== Algorithm ===
=== Algorithm ===
Line 16: Line 15:
:  Allocate temerary reals rho_1, rho_2 , alpha, beta<br>
:  Allocate temerary reals rho_1, rho_2 , alpha, beta<br>
: <br>
: <br>
-
:  r := b - A<math>\bullet</math>x <br>
+
:  r := b - A<math>\cdot</math>x <br>
-
:  rtilde = r <br>
+
:  rtilde := r <br>
: <br>
: <br>
:  for i := 1 step 1 until max_itr do
:  for i := 1 step 1 until max_itr do
-
::      solve (M<math>\bullet</math>z = r ) <br>
+
::      solve (M<math>\cdot</math>z = r ) <br>
-
::      solve (M<sup>T</sup><math>\bullet</math>ztilde = rtilde ) <br>
+
::      solve (M<sup>T</sup><math>\cdot</math>ztilde = rtilde ) <br>
-
::      rho_1 = z<math>\bullet</math>rtilde <br>
+
::      rho_1 := z<math>\cdot</math>rtilde <br>
::      if i = 1 then  
::      if i = 1 then  
:::        p := z <br>
:::        p := z <br>
:::        ptilde := ztilde <br>
:::        ptilde := ztilde <br>
::        else <br>
::        else <br>
-
:::        beta = (rho_1/rho_2) <br>
+
:::        beta := (rho_1/rho_2) <br>
-
:::        p = z + beta * p <br>
+
:::        p := z + beta * p <br>
-
:::        ptilde = ztilde + beta * ptilde <br>
+
:::        ptilde := ztilde + beta * ptilde <br>
::      end if <br>
::      end if <br>
-
::      q := A<math>\bullet</math>p <br>
+
::      q := A<math>\cdot</math>p <br>
-
::      qtilde := A<sup>T</sup><math>\bullet</math>ptilde <br>
+
::      qtilde := A<sup>T</sup><math>\cdot</math>ptilde <br>
-
::      alpha = rho_1 / (ptilde<math>\bullet</math>q) <br>
+
::      alpha := rho_1 / (ptilde<math>\cdot</math>q) <br>
-
::      x = x + alpha * p <br>
+
::      x := x + alpha * p <br>
-
::      r = r - alpha * q <br>
+
::      r := r - alpha * q <br>
-
::      rtilde = rtilde - alpha * qtilde <br>
+
::      rtilde := rtilde - alpha * qtilde <br>
-
::      rho_2 = rho_1 <br>
+
::      rho_2 := rho_1 <br>
:  end (i-loop)
:  end (i-loop)
:  <br>   
:  <br>   
Line 43: Line 42:
:  return TRUE <br>
:  return TRUE <br>
----
----
-
 
=== Reference ===
=== Reference ===
-
#'''Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst''', "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods"
+
#'''Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst''', "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Philadelphia, PA: SIAM, 1994. [http://www.netlib.org/linalg/html_templates/node32.html | http://www.netlib.org/linalg/html_templates/Templates.html]
 +
 
 +
----
 +
<i> Return to [[Numerical methods | Numerical Methods]] </i>

Latest revision as of 15:04, 27 July 2006

Contents

Biconjugate gradient method

Biconjugate gradient method could be summarized as follows

System of equation

For the given system of equation
Ax = b ;
b = source vector
x = solution variable for which we seek the solution
A = coefficient matrix

M = the preconditioning matrix constructed by matrix A

Algorithm


Allocate temperary vectors r,z,p,q, rtilde,ztilde,qtilde
Allocate temerary reals rho_1, rho_2 , alpha, beta

r := b - A\cdotx
rtilde := r

for i := 1 step 1 until max_itr do
solve (M\cdotz = r )
solve (MT\cdotztilde = rtilde )
rho_1 := z\cdotrtilde
if i = 1 then
p := z
ptilde := ztilde
else
beta := (rho_1/rho_2)
p := z + beta * p
ptilde := ztilde + beta * ptilde
end if
q := A\cdotp
qtilde := AT\cdotptilde
alpha := rho_1 / (ptilde\cdotq)
x := x + alpha * p
r := r - alpha * q
rtilde := rtilde - alpha * qtilde
rho_2 := rho_1
end (i-loop)

deallocate all temp memory
return TRUE

Reference

  1. Richard Barret, Michael Berry, Tony F. Chan, James Demmel, June M. Donato, Jack Dongarra, Victor Eijihout, Roldan Pozo, Charles Romine, Henk Van der Vorst, "Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods", Philadelphia, PA: SIAM, 1994. | http://www.netlib.org/linalg/html_templates/Templates.html

Return to Numerical Methods

My wiki