stqp2034 tutorial 2

4
STQP2033/34 Kaedah Berangka UKSD/270710 1 STQP2033/34: Kaedah Berangka/Numerical Methods TUTORIAL 2 Semester 1, 2010-11 1. Given the system of equations 1 2 1 2 0.77 14.25 1.2 1.7 20 x x x x + = + = (a) Solve graphically and check your results by substituting them back into the equations. (b) On the basis of the graphical solution, what do you expect regarding the condition of the system? (c) Compute the determinant. (d) Solve by the elimination of unknowns. 2. For the set of equations 2 3 1 2 3 1 2 2 5 1 2 1 3 2 x x x x x x x + = + + = + = (a) Compute the determinant. (b) Use Cramer’s rule to solve for the x’s. (c) Substitute your results back into the original equation to check your results. 3. Given the equations 1 2 3 1 2 3 1 2 3 10 2 27 3 6 2 61.5 5 21.5 x x x x x x x x x + - = - - + =- + + =- Solve by Gauss elimination. Show all the steps of the computation. 4. Use Gauss elimination to solve: 1 2 3 1 2 3 1 2 3 4 2 5 2 4 6 6 x x x x x x x x x + - =- + + = + + = Employ partial pivoting in your computation.

Upload: sabariah-othman

Post on 08-Apr-2015

642 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: STQP2034 Tutorial 2

STQP2033/34 Kaedah Berangka

UKSD/270710

1

STQP2033/34: Kaedah Berangka/Numerical Methods

TUTORIAL 2 Semester 1, 2010-11

1. Given the system of equations

1 2

1 2

0.77 14.25

1.2 1.7 20

x x

x x

+ =

+ =

(a) Solve graphically and check your results by substituting them back into

the equations.

(b) On the basis of the graphical solution, what do you expect regarding the

condition of the system?

(c) Compute the determinant.

(d) Solve by the elimination of unknowns.

2. For the set of equations

2 3

1 2 3

1 2

2 5 1

2 1

3 2

x x

x x x

x x

+ =

+ + =

+ =

(a) Compute the determinant.

(b) Use Cramer’s rule to solve for the x’s.

(c) Substitute your results back into the original equation to check your

results.

3. Given the equations

1 2 3

1 2 3

1 2 3

10 2 27

3 6 2 61.5

5 21.5

x x x

x x x

x x x

+ − =

− − + = −

+ + = −

Solve by Gauss elimination. Show all the steps of the computation.

4. Use Gauss elimination to solve:

1 2 3

1 2 3

1 2 3

4 2

5 2 4

6 6

x x x

x x x

x x x

+ − = −

+ + =

+ + =

Employ partial pivoting in your computation.

Page 2: STQP2034 Tutorial 2

STQP2033/34 Kaedah Berangka

UKSD/270710

2

5. Given the equations

1 2 3

1 2 3

1 2 3

2 6 38

3 7 34

8 2 20

x x x

x x x

x x x

− − = −

− − + = −

− + − = −

Solve by Gauss elimination with partial pivoting. Show all steps of the

computation.

6. Given the system of equations

2 3

1 2 3

1 2

3 7 2

2 3

5 2 2

x x

x x x

x x

− + =

+ − =

− =

(a) Compute the determinant.

(b) Use Cramer’s rule to solve for the x’s.

(c) Use Gauss elimination with partial pivoting to solve for the x’s.

7. (a) Solve the following system of equations by LU decomposition without

pivoting

1 2 3

1 2 3

1 2 3

7 4 51

4 4 9 62

12 3 8

x x x

x x x

x x x

+ − = −

− + =

− + =

(b) Determine the matrix inverse. Check your results by verifying that

1[ ][ ] [ ].A A I− =

(Note: For finding inverse using LU decomposition, you can refer to Chapra

and Canale (2010) page 283 to 285).

8. Solve the following system of equations using LU decomposition with partial

pivoting:

1 2 3

1 2 3

1 2 3

2 6 38

3 7 34

8 2 20

x x x

x x x

x x x

− − = −

− − + = −

− + − = −

9. Determine the LU decomposition without pivoting by hand for the following

matrix.

8 2 1

3 7 2

2 3 9

.

Employ the result to compute the determinant. (Hint: Use the determinant’s

properties).

Page 3: STQP2034 Tutorial 2

STQP2033/34 Kaedah Berangka

UKSD/270710

3

10. Use the following LU decomposition

[ ] [ ][ ]

1 3 2 1

0.6667 1 7.3333 4.6667

0.3333 0.3636 1 3.6364

A L U

= = − − −

to

(a) compute the determinant,

(b) solve [ ]{ } { } with { } [ 10 44 26].TA x b b= = − −

11. Solve the following tridiagonal systems with the Thomas algorithm.

(a)

1

2

3

0.8 0.4 41

0.4 0.8 0.4 25

0.4 0.8 105

x

x

x

− − = −

(b)

1

2

3

4

2.01475 0.020875 4.175

0.020875 2.01475 0.020875 0

0.020875 2.01475 0.020875 0

0.020875 2.01475 2.0875

T

T

T

T

− − = − − −

12. Use the Gauss-Seidel method to solve the tridiagonal system from Problem 12 (a),

where 5%s

ε = . Use overrelaxation with 1.2.λ =

13. Use the Gauss-seidel method

a. without relaxation, b. with relaxation, 0.95λ =

to solve the following system to a tolerance of 5%.sε = If necessary, rearrange

the equations to achieve convergence.

1 2 3

1 2 3

1 2 3

3 12 50

6 3

6 9 40

x x x

x x x

x x x

− + + =

− − =

+ + =

14. Use the Gauss-Seidel method

a. without relaxation, b. with relaxation, 1.2λ =

to solve the following system to a tolerance of 5%.sε = If necessary, rearrange

the equations to achieve convergence.

1 2 3

1 2 3

1 2 3

2 6 38

3 7 34

8 2 20

x x x

x x x

x x x

− − = −

− − + = −

− + − = −

Page 4: STQP2034 Tutorial 2

STQP2033/34 Kaedah Berangka

UKSD/270710

4

15. The following system of equations is designed to determine concentrations (the c’s in g/m3) in a series of coupled reactors as a function of the amount of mass

input to each reactor (the right-hand sides in g/day),

1 2 3

1 2 3

1 2 3

15 3 3300

3 18 6 1200

4 12 2400

c c c

c c c

c c c

− − =

− + − =

− − + =

a. Determine the matrix inverse.

b. Use the inverse to determine the solution.

c. Determine how much the rate of mass input to reactor 3 must be increased

to induce a 10 gm/m3 rise in the concentration of reactor 1.

d. How much will the concentration in reactor 3 be reduced if the rate of

mass input to reactors 1 and 2 is reduced by 700 and 350 g/day, respectively?

e. Solve this problem with the Gauss-seidel method to 5%.sε =

f. Repeat (e) using Jacobi iteration.

Solutions to be submitted:

Group 1 to 4 : Questions 6, 7, 8, 11 (a) and 13.

Group 5 to 8 : Questions 5, 7, 9, 11 (b) and 14.

Submit to me before 12.00 noon, Monday – 16th

August 2010.