You are on page 1of 4

Computational Hydraulics

Carlos Serrano Moreno

Homework 1 1) A flowrate of 25m3/s occurs in a trapezoidal channel, which has a bottom width of 6m, side slope of 1.5, bed slope of 0.001 and Manning's coefficient of 0.025. Assuming the flow in this channel is uniform, calculate the uniform slope by N-S method. Q = 25 m3/s Area = A
( [

S0 = 0.001
] )

n = 0.025 =
( )

( ( [

) ) ] ( ( ) ) ) ) ( )

( )

( ( (

( ) (

( (

) )

( )

) (

( ) ( ) ( )

)(

( (

Then applying N-S method and starting with a initial guess process. Knowing that
( ( ) )

we start the iteration

, we obtain:

Computational Hydraulics

Carlos Serrano Moreno

i 0 1 2 3 4 1 2.2047 1.9052 1.8821 1.8819 -16.9561 8.56988 0.5723 0.0033 1.13

( )

Then, after a few iterations we find that 2) Solve the system Ax = b with multiple values of b, by Gaussian elimination and GaussSeidel. Comparing the results of two methods, which method is the best one?
( ) ( )

* +

2.a) Gaussian elimination:

| )

Computational Hydraulics

Carlos Serrano Moreno

2.b) Gauss-Seidel Applying the Gauss-Seidel algorithm to the first system we obtain:

I
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -2 -3 -1 -0.222 -0.242 -0.461 -0.598 -0.630 -0.614 -0.596 -0.588 -0.588 -0.590 -0.591 -0.591 1 -1 -2 -1.861 -1.507 -1.312 -1.278 -1.308 -1.336 -1.346 -1.346 -1.343 -1.341 -1.340 -1.341 3 7 6 4.819 4.313 4.293 4.415 4.499 4.522 4.515 4.504 4.499 4.498 4.499 4.500 4 5 4.33333333 3.634 3.354 3.355 3.430 3.479 3.491 3.486 3.479 3.476 3.476 3.477 3.477

Computational Hydraulics

Carlos Serrano Moreno

and for the second one: , I


0 1 2 3 4 5 6 7 8 9 10 11 12 13 2 -0.667 0.259 0.512 0.432 0.314 0.257 0.252 0.263 0.272 0.275 0.274 0.273 0.273 2 0.667 0.380 0.544 0.727 0.803 0.805 0.786 0.773 0.769 0.771 0.772 0.773 0.773 0 0.333 -0.394 -0.956 -1.131 -1.097 -1.029 -0.993 -0.988 -0.994 -0.999 -1.001 -1.001 -1.000 0 0.111 -0.344 -0.671 -0.764 -0.738 -0.697 -0.677 -0.675 -0.678 -0.681 -0.683 -0.682 -0.682

In order to compare both methods the first thing that one should do is understand the main difference between both of them: Gauss-Seidel is an iterative method while Gaussian elimination is a direct method. This means that when we use Gaussian elimination we will obtain the exact solution while when we use Gauss-Seidel we will obtain an approximate solution to our problem. As we said by using Gaussian elimination we will obtain the exact solution after performing a finite sequence of operations. When solving a system of n equations for n unknowns we will perform around operations. The arithmetic complexity of this method, ( ), makes that the computational cost becomes prohibitive for systems where thousands of equations are involved. This is the reason why this large systems are solved by using iterative methods. On the other hand when we use Gauss Seidel Method we have to decide which is the threshold up to which we will accept our approximated solution as a the correct one. Then even we don't know how many operations are going to be involved when using this method we now that, for a system with n equations for n unknowns, we will perform 2mn2 operations, where m is the number of iterations. Then, we can see that for a large number of equations we can obtain a solution using a lower number of calculations.

You might also like