(Difference between revisions)
 Revision as of 08:02, 14 September 2005 (view source)Zxaar (Talk | contribs)← Older edit Revision as of 08:18, 14 September 2005 (view source)Zxaar (Talk | contribs) Newer edit → Line 12: Line 12: === Algorithm === === Algorithm === - + ---- - Allocate temperary vectors p, phat, s, shat, t, v, rtilde
+ :  Allocate temperary vectors p, phat, s, shat, t, v, rtilde
- Allocate temerary reals rho_1, rho_2 , alpha, beta, omega
+ :  Allocate temerary reals rho_1, rho_2 , alpha, beta, omega
- r := b - A[itex]\bullet[/itex]x
+ :
- rtilde = r
+ :  r := b - A[itex]\bullet[/itex]x
- for i := 1 step 1 until max_itr do + :  rtilde = r
- rho_1 = rtilde[itex]\bullet[/itex]r
+ :
- if i = 1 then p := r else
+ :  for i := 1 step 1 until max_itr do - beta = (rho_1/rho_2) * (alpha/omega)
+ ::      rho_1 = rtilde[itex]\bullet[/itex]r
- p = r + beta * (p - omega * v)
+ ::      if i = 1 then p := r else
- end if
+ :::        beta = (rho_1/rho_2) * (alpha/omega)
- solve (M[itex]\bullet[/itex]phat  = p )
+ :::        p = r + beta * (p - omega * v)
- v = A[itex]\bullet[/itex]phat
+ ::      end if
- alpha = rho_1 / (rtilde[itex]\bullet[/itex]v)
+ ::      solve (M[itex]\bullet[/itex]phat  = p )
- s = r - alpha * v
+ ::      v = A[itex]\bullet[/itex]phat
- solve (M[itex]\bullet[/itex]shat = s )
+ ::      alpha = rho_1 / (rtilde[itex]\bullet[/itex]v)
- t = A * shat; + ::      s = r - alpha * v
- omega = (t[itex]\bullet[/itex]s) / (t[itex]\bullet[/itex]t)
+ ::      solve (M[itex]\bullet[/itex]shat = s )
- x = x + alpha * phat + omega * shat
+ ::      t = A * shat; - r = s - omega * t
+ ::      omega = (t[itex]\bullet[/itex]s) / (t[itex]\bullet[/itex]t)
- rho_2 = rho_1
+ ::      x = x + alpha * phat + omega * shat
- end (i-loop) + ::      r = s - omega * t
- + ::      rho_2 = rho_1
- deallocate all temp memory
+ :  end (i-loop) - return TRUE
+ :
+ :  deallocate all temp memory
+ :  return TRUE
+ ----

## Revision as of 08:18, 14 September 2005

Biconjugate gradient stabilized 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 p, phat, s, shat, t, v, rtilde
Allocate temerary reals rho_1, rho_2 , alpha, beta, omega

r := b - A$\bullet$x
rtilde = r

for i := 1 step 1 until max_itr do
rho_1 = rtilde$\bullet$r
if i = 1 then p := r else
beta = (rho_1/rho_2) * (alpha/omega)
p = r + beta * (p - omega * v)
end if
solve (M$\bullet$phat = p )
v = A$\bullet$phat
alpha = rho_1 / (rtilde$\bullet$v)
s = r - alpha * v
solve (M$\bullet$shat = s )
t = A * shat;
omega = (t$\bullet$s) / (t$\bullet$t)
x = x + alpha * phat + omega * shat
r = s - omega * t
rho_2 = rho_1
end (i-loop)

deallocate all temp memory
return TRUE