(Difference between revisions)
 Revision as of 08:02, 14 September 2005 (view source)Zxaar (Talk | contribs)← Older edit Revision as of 00:30, 15 September 2005 (view source)Zxaar (Talk | contribs) Newer edit → Line 12: Line 12: === Algorithm === === Algorithm === - Has to be added very soon. + ---- + :  Allocate temperary vectors r,z,p,q, rtilde,ztilde,qtilde
+ :  Allocate temerary reals rho_1, rho_2 , alpha, beta
+ :
+ :  r := b - A[itex]\bullet[/itex]x
+ :  rtilde = r
+ :
+ :  for i := 1 step 1 until max_itr do + ::      solve (M[itex]\bullet[/itex]z = r )
+ ::      solve (MT[itex]\bullet[/itex]ztilde = rtilde )
+ ::      rho_1 = z[itex]\bullet[/itex]rtilde
+ ::      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[itex]\bullet[/itex]p
+ ::      qtilde := AT[itex]\bullet[/itex]ptilde
+ ::      alpha = rho_1 / (ptilde[itex]\bullet[/itex]q)
+ ::      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
+ ----

## Revision as of 00:30, 15 September 2005

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 precondioning matrix constructued 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$\bullet$x
rtilde = r

for i := 1 step 1 until max_itr do
solve (M$\bullet$z = r )
solve (MT$\bullet$ztilde = rtilde )
rho_1 = z$\bullet$rtilde
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$\bullet$p
qtilde := AT$\bullet$ptilde
alpha = rho_1 / (ptilde$\bullet$q)
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