Measuring Work for solving N by N linear system A x = b

The goal of your second computational experiment will be to measure the CPU time to perform a standard calculation and compare this with the predicted work of the algorithm. You are asked to use the CPU time as your measure of work and the known operation count of Gaussian Elimination to discover how the mathematical operation count is reflected in an actual computation.

Examine the codes and identify where you think significant computation is taking place. You'll want to insert a dtime call immediately before and after each such place and collect the statistics for your summarizing report.

    Items to cover in the written report:
  1. How does the actual CPU time for the various operations vary with system size, N? How well do your computed values agree with the mathematical operation count.
    The operation count states for the LU decomposition that work_lu(N) = N^3 - N^2/2 + N/2 so that for "large enough" N, work_lu(N) ~= N^3/3 When we examine a larger sized system, say dimension 2N work_lu(2N) ~= (2N)^3/3 = 8 N^3/3 = 8 work_lu(N) Therefore, one would expect to see a factor of eight
                    work_lu(2N)
                    ----------- ~= 8
                     work_lu(N)
    
    increase in the work "eventually".

    What increase would you expect to see for the "solve"?

    You are also using good mathematical software which estimates a quantity called the "condition number" of the matrix, A,

                              1
                    K(A) = -------
                            rcond
    
    "rcond" is the "reciprocal conditon number" estimated by sgeco.

    The inequality from linear algebra that relates the residual to the error

           ||ae ||           ||r||
         ----------- <= K(A) ------
          ||x_true||         ||b||
    
    where || r || indicates the norm of the vector r. Similarly for the vectors b, ae = absolute error = x_computed - x_true. Of course, we do not know x_true in this problem. This shows that a small residual, r, does not always indicate a correct answer and your computational experiment will let you precisely quantify this statement.
    Back to Report2_Diffusion