Sie sind auf Seite 1von 8

Executive Summary: Conjugate Gradient Squared Method

A. PROBLEM DESCRIPTION
A set of matrix (Matrix B) was given to be evaluated using the Conjugate gradient
squared method and using the L1 norm exit criterion.The algorithm for this method
is as follows:
associated with

x0

. The formula is

. Since this is the first iteration, let

r0

be equal to the

1. Calculate the initial residual vector


given by

r 0=b A x 0

search direction

p0

r0

2. Compute the scalar alpha,


3. Compute next location,

r kT rk
using the equation, k = p T A p
k
k

x k+1=x k + k p k

4. Compute the next residual vector,

r k +1=r k k A p k

. If the value is

sufficiently small, then exit the loop.


r k+1T r k+1
5. Compute the scalar beta, k = r T r
k
k
6. Compute the next search direction,

pk+1 =r k+1 + k p k

7. Compute the new beta using the new search direction


x k+1
8. Finally, find
using the new values computed.
B. PROBLEMS ENCOUNTERED
In generating the code desired, the first challenge was to understand the
difference between L1 norm and L2 norm. After understanding the unique role of
each norm, the code distributed by the professor was encoded into the program
whichrepresents the matrix in question.
Upon completion of the code, the number of iterations was displayed. However,
the mobile phone and program used does not display the complete list of iterations
because L1 norm is not applicable for the limit (n=250).
C. REFERENCES
1. Dongarra, J, Lumsdaine, A., Pozo, R. and Remington, K. " Iterative Methods
Library". http://math.nist.gov/iml++/.

2. Wikimedia
Foundation,
Inc.,
"Conjugate
Gradient
https://en.wikipedia.org/wiki/Conjugate_gradient_method
3. Lecture Notes / C Code given by Dr. Arturo Cortes

Method".

D. RESULT
In executing the program, the matrix was not solved after250
iterationsand L1 norm is not applicable. This means the tolerance of
0.000001 was not met. This suggests that the assigned number of equation or n
is not sufficient, which convey a value of greater than 250.
The resulting matrixdesignated as x using n = 250 and L1 norm are
0.98746535 and 0.98506782respectively. The time elapsed to finish the
execution using mobile phone was approximately 5 sec.
Run window Output (Using L1 norm)

Executive Summary: Bi-Conjugate Gradient Method


A. PROBLEM DESCRIPTION
The same set of matrix was given to be evaluated using the Bi-Conjugate gradient
method and using the L2 norm exit criterion. Unlike the conjugate gradient method,
this algorithm does not require the matrix A to be self-adjoint, but instead one needs
to perform multiplications by the conjugate transpose A*.The generalized algorithm
for this method is:
1. Choose an initial guess
2.

r 0=b A x 0

3.

r 0 =bA x 0

x0

4. Set initial direction position,


5.

p0=r 0

p0 =r 0

6. For

k =0,1, do

rk rk
1. Compute alpha, k = p k A p k
2. Compute next location,

3.

x k+1=x k + k p k

x k+1 =x k + k p k

4. Compute the next residual vector,

r k +1=r k k A p k

sufficiently small, then exit the loop.

5. r k +1 =r k k A p k

6. Compute the scalar beta,

r k+1 r k+1
k=

rk r k

7. Compute the next search direction,


8.

pk+1 =r k+1 + k p k

pk+1 =r k +1 + k p k

7. Finally, find

x k+1

using the new values computed.

. If the value is

8.
B. PROBLEMS ENCOUNTERED
In generating the code desired, the same challenge was experienced to
understand the difference between L1 norm and L2 norm. The prevailing norm for
this method was chosen to be L2.
Upon compiling the code, it was observed that the problem experience on CGS
method is the same for this method. The mobile phone and program used does not
display the complete list of iterations.

C. REFERENCES
1. Dongarra, J, Lumsdaine, A., Pozo, R. and Remington, K. " Iterative Methods
Library". http://math.nist.gov/iml++/.
2. Lecture Notes / C Code given by Dr. Arturo Cortes
3. Wikimedia
Foundation,
Inc.,
"Conjugate
Gradient
Method".
https://en.wikipedia.org/wiki/Biconjugate_gradient_method
D. RESULT
In executing the program, the matrix was solved after 129 iterations
using L2 norm exit criterion equal to 0.00000104.
The resulting matrix designated as x are 1.08421002 and
1.08430721respectively. The time elapsed to finish the execution using mobile
phone was approximately 2 sec.
Run window Output (Using L2 norm)
:56

Executive Summary: ABS Method


A. PROBLEM DESCRIPTION
The same set of matrix was given to be evaluated using the ABS Method. The
algorithm for this method is:
1. Initialize: choose

2. Set search direction


Compute residuals:
3. Iterate:

so that is it nonsingular, set


for any that does not satisfy
.

, where is the step size:

4. Test for convergance (update residuals, if used in test): Is solution


within tolerance? If so, stop; else, continue.
5. Update:
form
6. Increment: let

, where
for

is a rank 1 update of the

such that

and go to step 1.

B. PROBLEMS ENCOUNTERED
In generating the code,the challenge was how to convert the algorithm mentioned
above. However, upon compiling the code, it was observed that the iteration executes
but the values are not present. This means that the code still needs some
improvement.

C. REFERENCES

1. Dongarra, J, Lumsdaine, A., Pozo, R. and Remington, K. " Iterative Methods


Library". http://math.nist.gov/iml++/.
2. Lecture Notes / C Code given by Dr. Arturo Cortes
3. Wikimedia
Foundation,
Inc.,
"Conjugate
Gradient
Method".
https://en.wikipedia.org/wiki/ABS_methods

D. RESULT
In executing the program, the matrix was not solved due to incomplete
inputs on the code prepared. Further improvement should be done to get the
correct solution for this particular method.
Run window Output (Using L2 norm)

Executive Summary: Residual Norm Iteration


A. PROBLEM DESCRIPTION
A set of matrix (Matrix A) was given to be evaluated using the Residual Norm
Iteration using the L1 and L2 norms. The reference for accuracy will be based on the
Gaussian elimination solution.
B. PROBLEMS ENCOUNTERED
The solution to the problem must consists comparison ok results using the two
matrix norms. When L1 was used, the program initialized and took more than 5
hours to converge. The mobile phone crashed due to the long duration of the
program to complete.
The L2 norm, on the other hand, was performed using a computer, the problem
encountered for this is finding a compiler that will suit the already prepared
program. Fortunately, a compatible compiler was available and was used to solve the
problem.
C. REFERENCES
1. Dongarra, J, Lumsdaine, A., Pozo, R. and Remington, K. " Iterative Methods
Library". http://math.nist.gov/iml++/.
2. Lecture Notes / C Code given by Dr. Arturo Cortes
3. Black, Noel and Moore, Shirley. "Minimal Residual Method." From
MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein.
http://mathworld.wolfram.com/MinimalResidualMethod.html
D. RESULT
In executing the program, the matrix was first tested using the L1 norm.
the total number of iteration to solve the problem is not identified due to crashing
of the cellular phone, but it can be seen that after 283000 iterations with
tolerance = 0.00002, the tolerance of 0.000001 is not yet achieved. Elapsed
time before the program crashed is approximately 5 hours from the start of
the execution.

Run window Output (Using L1 norm)

On the other hand, when L2 norm was used in the program, the program converged
after 69984 iterations with an accuracy of 0.00000100. This was performed in a
computer and took 16.828sec to converge. The value of x after n=250 is 0.980603.
Run window Output (Using L2 norm)

Das könnte Ihnen auch gefallen