Input: A , B , J , w ( 0 ) = [ z 1 ( 0 ) , z 2 ( 0 ) ] T , α ( 0 ) , β ( 0 ) , k m a x ,

1) for k = 0 , 1 , 2 , until convergence do

2) Solve M u = B 1 w for u :

Find the lu factorization of M i.e., [ L , U ] = l u ( M ) .

Solve the lower triangular system L c = B 1 w for c .

Solve the Upper triangular system U u = c for u .

3) Compute n α = w T B 1 J u and n β = w T B 1 u

4) Form the matrix

T = [ n β n α n α n β ] .

5) Find the LU factorization of T , that is [ L , U ] = l u ( T )

6) Solve L c = [ 1 2 ( w T B 1 w + 1 ) n w T w ( 1 + u 2 ) ] for c .

7) Solve U ω = c for ω = [ Δ α Δ β ] .

8) Form the vector w + = Δ α u Δ β J u .

9) Update

[ α + β + ] = [ α β ] + [ Δ α Δ β ] .

10) end for

Output: v ( k m a x ) = [ w ( k m a x ) , α ( k m a x ) , β ( k m a x ) ] .