You are on page 1of 22

Exercise 3: Linear Algebraic Equations And Matrices

1)

Numerical Methods

Use the graphical method to solve

x1 x2 3
4 x1 x2 2
Check your result using substitution method.

Answer: x1 1, x2 2
2)

Given the system of linear equations

3 x 2 7 x3 2
x1 2 x 2 x3 3
5 x1 2 x 2

Solve the above system using:


(a)

Cramers rule.

(b)

Gauss elimination with partial pivoting.

Substitute your result back into the original equations to check your solutions.

Answer: x1 0.9855, x2 1.4638, x3 0.9130


3)

Solve the following system using Nave Gauss elimination.


0.8 0.4
x 41
0.4 0.8 0.4 y 25

0.4 0.8 z 105

Answer: x 173.7553, y 245.0105, z 253.7658

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


4)

Numerical Methods

By using the Nave Gauss elimination method, solve the following system of
linear equations.

pq 0
2 p 3q 3r 1
p q r 1

2
2
1

Answer: p 5 , q 5 , r 5

5)

The upward velocity of a rocket is given at three different times as depicted in


Table 1.
Time,t ( s )

12

Velocity,v(ms 1 )

106.8

177.2

279.2

TEST 1
BUM2313 1112I
BAM2012 10111

Table 1
The velocity data is approximated by a polynomial as

v(t ) a1t 2 a2t a3


Solve the above system using Nave Gauss elimination as LU factorization. Use
four decimal places in your calculation.

Answer: a1 0.29048, a2 19.69, a3 1.0857

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

6) A typical statics problem to calculate forces in a bridge is represented by the


following:
TEST 1
BUM2313 1213I
BAM2012 10111

From the diagram, we obtain the following equations (these equations come from
statics theory):
Vertical forces:
F1 sin 69.3 F2 sin 71.1 F3 sin 56.6 + 926 = 0
Horizontal forces:
F1 cos 69.3 F2 cos 71.1 + F3 cos 56.6 = 0
Moments:
7.80 F1 sin 69.3 1.50 F2 sin 71.1 5.20 F3 sin 56.6 = 0
Rewrite the above equations in matrix form, AX B.
Hence, find the forces F1 , F2 and F3 using Gauss elimination as LU
factorization
u11 u12 u13
1 0 0

(Hint: Use DEGREE mode, U 0 u 22 u 23 and L l 21 1 0 )


0
l31 l32 1
0 u33

a.
b.

Answer: F1 425.5090, F2 1079.8749, F3 362.1843

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


7)

Numerical Methods

Given the system of linear equations in matrix form, AX b

9 0 0 x1 12
0 25 0 x 15

2
0 0 4 x3 6
(i)

Compute the Cholesky decomposition of [A].

(ii)

Hence, solve the above system.

Answer:(a ) U 0

(b) x1 , x2

8)

0 0
5 0
0 2
3
3
, x3
5
2

Given the system of linear equations

3x y 2 z 2
x 2 y 3z 1
2x 2 y z 3
(i)

Write the above system in matrix form, AX b .

(ii)

Compute the Crout decomposition of [A].

(iii)

Hence, solve the system of linear equations.

3 1 2 x 2

Answer:(a) 1 2 3 y 1

2 2 1 z 3

0
0 1 1/ 3 2 / 3
3 1 2 3

(b) 1 2 3 1 7 / 3 0 0
1
1

2 2 1 2 4 / 3 1 0

0
1

(c) x 1.1429, y 0, z 0.7143

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


9)

Numerical Methods

Solve the following system of equations using Jacobi method. Compute up to the

v 1
0

third iteration by taking the initial vector,

1 1 .
T

4 2 1 x1 11
1 2 0 x 3

2
2 1 4 x3 16
7
63
93

Answer:
x

,
x

,
x

1
2
3

8
32
32

10)

A civil engineer involved in construction requires 4800, 5800, and 5700 m 3 of


sand, fine gravel, and coarse gravel respectively for a building project. There are
three pits from which these materials can be obtained. The composition of these
pits are
Sand

Fine Gravel

Coarse Gravel

Pit 1 (x)

0.55

0.30

0.15

Pit 2 (y)

0.25

0.45

0.30

Pit 3 (z)

0.25

0.20

0.55

FINAL EXAM
BAM2012 1011I
BAM2012 10111

(i)

Set up the system of linear equations which modeling the problem above.

(ii)

Derive Gauss Seidel formula based on system of linear equations in (i).

(iii)

How many cubic meters can be hauled from each pit in order to meet the
engineers needs by using two iterations of Gauss Seidel method with

1000 m 3

initial estimation of sand, fine gravel and coarse gravel are 1000 m 3 .
1000 m 3

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

Answer:(a) 0.55 x 0.25 y 0.25 z 4800

0.30 x 0.45 y 0.20 z 5800

0.15 x 0.30 y 0.55 z 5700

k
k

4800 0.25 y 0.25 z

(b) x k 1
0.55

k 1
k
5800 0.30 x
0.20 z

y k 1
0.45

k 1
k 1
5700 0.15 x
0.30 y
k 1

0.55

(c) x 2660.8921, y 9030.5657 , z 4712.1754

11)

FINAL EXAM
BET2553 1011II
BAM2012 10111

Given the following matrix

0
2 1

A 1 2 1 .
0
1 2
Find the dominant eigenvalue of matrix A using power method. Take the initial

vector v

0

1 and perform three iterations.
0

Answer:The dominant eigenvalue of A is 6.2942

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


12)

Numerical Methods

Determine the solution of the simultaneous nonlinear equations


y x 2 x 0.5

y 5 xy x 2
Use the Newton-Raphson method and employ two iterations with initial guesses
of x y 1.2
Answer: x 1.36624, y 0.23673

13) Consider the circuit in Figure 1, where R1 = R2 = R3 = R4 = 5, R5 = R6 =R7 = R8 = 2


and

V1 = V2 = 5.

TEST I
BUM2313 1213II

Figure 1
Using Kirchoffs law, we have

V1 (i2 i1 ) R2 (i4 i1 ) R4 i1 R1
V2 i2 R3 (i2 i1 ) R2 (i2 i3 ) R5
0 i3 R8 (i3 i2 ) R5 (i3 i4 ) R7
0 (i4 i3 ) R7 (i4 i1 ) R4 i4 R6

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

which can be written in matrix form ( Ax b ) as

R1 R2 R4

R2

R4

R2
R2 R3 R5
R5
0

0
R5
R5 R7 R8
R7

R4
i1 V1
i V
0
2 2
i3 0
R7

R4 R6 R7 i4 0

(a)

Find matrix A by substituting the values of R1 , R2 , R3 , R4 , R5 , R6 , R7 and R8 .

(b)

By using Cholesky factorization

show that upper triangular matrix,

0
1.291
3.873 1.291
0
3.2145 0.6222 0.5185

.
U
0
0
2.3691 0.9804

0
0
2.4705
0
(c)

Hence, solve the loop currents i1 , i2 , i3 and i4 .

i1 0.2768
15 5 0 5

Answer : (a)A 5 12 2 0 (c) i2 0.3108

i3 0.0565
0 2 6 2

5 0 2 9
i4 0.1412

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

14) Thermistors measure temperature, have a nonlinear output and are valued for a
limited range. So when a thermistor is manufactured, the manufacturer supplies a
resistance versus temperature curve. An accurate representation of the curve is generally
given by
1
T
where T is temperature in Celsius, R is resistance in ohms, and x1 , x2 , x3 are constants of
x1 x2 ln R x3 (ln R ) 2

the calibration curve. Given the following for a thermistor


R (ohm)

T ( C )

911.3

30.131

636.0

40.120

451.1

50.128

TEST2
BUM2313 1213II

(a)
(b)

Set up the system of linear equations which modeling the problem above.
Rewrite in matrix form, [A][ x] [B] based on the system of linear equations in

(c)

(a).
Hence, find the dominant eigenvalue and its corresponding eigenvector of matrix

1, 0,1

A using power method. Given the initial vector, v(0)

and carry out

the first THREE iterations .

Answer : (a) x1 6.8149 x2 46.4425 x3 0.0332

x1 6.4552 x2 41.6696 x3 0.0249

x1 6.1117 x2 37.3527 x3 0.0199

(b) [A][ x] [B];

1 6.8149 46.4425 x1 0.0332

1 6.4552 41.6696 x 0.0249

1 6.1117 37.3527 x3 0.0199

(c) 0.9063 , 45.3249

0.8212

SUPPLEMENTARY EXERCISES
Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

GAU SS ELIMINATION METHOD

1.

Given the equations

2 x1 6 x2 x3 38
3x1 x2 7 x3 34
8 x1 x2 2 x3 20
(a)

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

(b)

Substitute your result into the original equations to check your answer.

Answer: x1 4, x2 8, x3 2
2.

An electrical engineer supervises the production of three types of electrical


components. Three kind of material-metal, plastic and rubber- are required for
production. The amounts needed to produce each component are

Component

Metal

Plastic

Rubber

(g/component) (g/component)

(g/component)

15

0.30

1.0

17

0.40

1.2

19

0.55

1.5

If totals of 3.89, 0.095, and 0.282 kg of metal, plastic, and rubber, respectively,
are available each day, how many components can be produced per day?

Answer:c1 90.60, c2 59.17, c3 80.28

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

3. A problem in electrical engineering that requires solutions of a system of equations is


shown in Figure 1.

TEST 1
BMM2112
1011I

Figure 1: Electrical Circuit.


Using Kirchoffs law, the currents i1 , i2 , i3 and i4, can be determined by solving the
following systems of equations:
9i1 4i2 2i3 24

4i1 17i2 6i3 3i4 16


2i1 6i2 14i3 6i4 0
3i2 6i3 11i4 18
(i)

Find i1 for the system of linear equations using Cramers rule. (Use 4

decimal

(ii)

places in your calculation)

Find i2 , i3 and i4, for the system of linear equations using Nave Gauss
Elimination methods. (Use 4 decimal places in your calculation)

Answer : (i) i1 4.0343

(ii) i2 1.6545, i3 2.8452, i4 3.6395

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

LU FACTORI ZATION

4. Given

2
1

3
2

1
2
2
1
1

1
2
9
1
5

3
1
1
7
1

2 x1 29
1 x 2 20

5 x3 61

1 x 4 41

8 x5 63

Show that

Then, solve the above system by using Cholesky factorization. (Use 5 decimal places)

Answer: x1 1, x2 2, x3 3, x4 4, x5 5
5. Given

2
1

3
2

Universiti Malaysia Pahang

1
2
2
1
1

1
2
9
1
5

3
1
1
7
1

2 x1 74
1 x 2 55

5 x3 151

1 x 4 106

8 x5 148

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

Show that

Then, solve the above system by using Cholesky factorization. (Use 5 decimal places)

Answer: x1 6, x2 7, x3 8, x4 9, x5 10
6. (a) Use nave Gauss elimination to factor the following system

10x1 2 x 2 x 3 27
3x1 6 x 2 2 x 3 61.5
x1 x 2 5 x 3 21.5

Then, multiply the resulting [L] and [U] matrices to determine that [A] is
produced.
(b) Use LU factorization to solve the system of equations in Prob 1. Show all
the steps in the computation.

0
0 0
2
1
1

1
0 0 5.4
1.7
Answer:(a) L U 0.3

0.1 0.1481 1 0
0
5.3519

(b) x1 0.5, x2 8, x3 6

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


7.

Numerical Methods

Decompose the following system into [L] and [U] using Gauss elimination as LU

factorization.

8 x1 x2 2 x3 20
2 x1 6 x2 x3 38
3x1 x2 7 x3 34

0
0 8
1
2
1

1
0 0 5.75 1.5
Answer: L U 0.25

0.375 0.2391 1 0
0
8.1087

8. (a) Perform a Cholesky factorization of the following symmetric system

8 20 15 x1 50
20 80 50 x 250

2
15 50 60 x 3 100

(b) Employ the result of the factorization [U] to determine the solution for the
right hand side vector.

2.8284 7.0711 5.3033

5.4772 2.2822
Answer:(a) U

5.1640

(b) x1 2.7344, x2 4.8828, x3 1.7187

9. Solve the following set of equations with LU factorization:

3x1 2 x 2 x 3 10
2 x1 6 x 2 4 x 3 44
x1 2 x 2 5 x 3 26

Answer: x1 1, x2 5, x3 3

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

10.

Numerical Methods

A liquid-liquid extraction process conducted in the Electrochemical Materials


Laboratory involved the extraction of nickel from the aqueous phase into an
organic phase. A typical set of experimental data from the laboratory is given
below.
Ni aqueous phase, a g l

2.5

Ni organic phase, g g l

8.57

10

12

TEST 1
BUM2313
1112I

Assuming g is the amount of Ni in the organic phase and a is the amount of Ni


in the aqueous phase, the quadratic interpolant that estimates g is given by

g x1a2 x2a x3 .
Solve the above system using Nave gauss elimination as LU factorization.

Answer: x1 1.14, x2 2.27, x3 8.55


11.

Consider the following system of linear equations:

TEST 1
BET2553
1011II

x 2 y 3 z 4
4 x 5 y 6 z 4
7 x 8 y 10z 7

(i)

Write down the coefficient matrix, A and the vector of right-hand-side


constants, b.

(ii)

Decompose A into lower matrix, L and upper matrix, U .

Answer:(i) A 4

(ii) A 4

Universiti Malaysia Pahang

2 3
4

5 6 b 4
7
8 10

0 0 1 2 3
1 0 0 3 6
2 1 0 0 1

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods
FINAL
EXAM
BET2553
0910II

12. Given the system of linear equations

2 x1 2 x 2 x3 2
5 x1 x 2 3x3 0
3x1 4 x 2 x3 9
(i)

Transform the above system of linear equations in matrix form, AX B.

(ii)

Decompose matrix A into lower matrix and upper matrix.

(iii)

Hence, solve the system of linear equations using LU decomposition.

2 2

Answer: 5 1

3 4

x1 1, x2

1 x1 2

3 x2 0
1 x3 9
1, x3 2
TEST 1
BUM2313
1011II

13. An engineer supervises the production of three types of electrical components.


Three kinds of material are metal, plastic and rubber. This material required for
production. The amounts needed to produce each component are

The total of 2.12, 0.0434 and 0.1640 kg of metal, plastic and rubber, respectively
are available each day.
(i)

Transform the above problem into upper triangular matrix by using nave
Gauss elimination method.

(ii)

Hence,

find

the

solution

for

the

matrix

vector

{ x}

by

using LU decomposition method.

Answer: x1 0.02, x2 0.04, x3 0.06


Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

ITER ATI VE METHOD S


14. Determine the solution of the linear equations

x1 2 x 2 10x3 42
10x1 3x2 x3 38
2 x1 10x 2 3x3 37
Using TWO iterations of the Jacobi iteration. Compute the estimated errors after
each iteration. If necessary, rearrange the equations to achieve convergence.
Let x 0 0,0,0 . Use THREE decimal places in your calculation.

1 x1 38
10 3


Answer: 2 10 3 x2 37

1
2 10 x3 42

x1 2.27, x2 5.72, x3 3.08

15. Determine the solution of the linear equations

2 x1 x2 5 x3 15
4 x1 x2 x3 7
4 x1 8 x2 x3 21
Using TWO iterations of the Jacobi iteration. Compute the estimated errors after
each iteration. If necessary, rearrange the equations to achieve convergence.
Let x 0 0,0,0 . Use THREE decimal places in your calculation.

4 1 1 x1 7


Answer: 4 8 1 x2 21

2 1 5 x3 15

x1 1.656, x2 3.875, x3 3.175

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices


16.

Numerical Methods

An electrical engineer supervises the production of three types of electrical


components. Three kind of material-metal, plastic and rubber- are required for
production. The amounts needed to produce each component are
Component

Metal

Plastic

Rubber

(g/component)

(g/component)

(g/component)

15

0.30

1.0

17

0.40

1.2

19

0.55

1.5

The totals of 3.89, 0.095, and 0.282 kg of metal, plastic, and rubber, respectively,
are available each day. Using Gauss Seidal method with initial guesses of

c 0 0.05,0.05,0.05 , how many components can be produced per day?


T

Compute up to 2 iterations.

Answer: c1 0.1311, c2 0.0791, c3 0.0373


17. The sum of two acute angles in a right triangle is 90. The measure of
angle A is 6 less than 2 times the measure of the angle B.

FINAL
EXAM
BAM2012
1011I

(i)

Set up the system of linear equations which modeling the problem above.

(ii)

Derive Gauss Seidel formula based on system of linear equations in (i).

(iii)

Find the measure of each angle by using Gauss Seidel method with initial

45
guess of acute angle A and B are and stopping criterion of 20%.
45

Answer:(i) A B 90

A 2B 6

(ii) A k 1 90 B k

6 A k 1
k 1
B

A 54.75

(iii)

B 30.375

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

18. Given the following matrix

9 4

A
4 3
Find the dominant eigenvalue of matrix A and the corresponding eigenvector
1
using power method. Take the initial vector v 0 and compute up to THREE
1
iterations.

Answer: Dominant eigenvalue =11.014

Corresponding eigenvector =

0.5003

19. Given the following matrix

4 1 1
A 2 4 1
0 1 4

FINAL
EXAM
BET2553
1011II

Find the dominant eigenvalue of matrix A using power method. Take the initial
T
vector v 0 1 1 1 and stop the calculation when a 5% .

Answer: Dominant eigenvalue = 6.2

0.7742

Corresponding eigenvector = 1

0.5484

Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

20. Given the following matrix A

1 2 0

2 1 2
1 3 1

FINAL
EXAM
BET2553
0910II

Find the dominant eigenvalue, 1 of matrix A and the corresponding eigenvector


using power method.

Take the initial vector v 0 1 1 1 and iterate until


T

a 20%
Answer: Dominant eigenvalue = 2.6363

0.0345

Corresponding eigenvector = 1

0.2414

21. Using three iterations, find the dominant eigenvalue, 1 of matrix A and the
corresponding eigenvector using power method for the following matrix A:

(a)

2 1 1
T
A 1 2 1 , v(0) 1 1 2
1 1 2

(b)

1 1 1
T
A 1 1 0 , v(0) 1 1 1
1 0 1

(c)

1 1 0
T
A 2 4 2 , v(0) 1 2 1
0 1 2
Answer: (a)

(b)

(c)

Universiti Malaysia Pahang

Corresponding eigenvector = 0.9167 0.75 1

Dominant eigenvalue = 3

Corresponding eigenvector = 1 1 1

Dominant eigenvalue = 5
T
Corresponding eigenvector = 0.2895 1 0.2105
Dominant eigenvalue = 3.6667

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

NONLINE AR SYSTEMS

22. Use the multiple-equation Newton-Raphson method with ONE iteration only to
determine roots of

x12 x1 x2 10
x2 3 x1 x2 2 57
Initiate the computation with guesses of x1 1.5 and x2 3.5.

Answer: x1 2.0360, x2 2.8439


23. Determine the solution of the simultaneous nonlinear equations

x2 5 y2
y 1 x2
using Newton-Raphson with TWO iterations and initial guesses of x y 1.5

Answer: x 1.6005, y 1.5616


24. Given

10x3 y 0
xy 1 0
Find the solution of the following equations using Newton-Raphson method with
TWO iterations and initial guesses of x 1.8552, y 0.4718.

Answer: x 1.6495, y 0.5320


25. Given

10x 2 y 2 10 0
x2 y2 4x 2 y 1 0
Find the solution of the following equations using Newton-Raphson method with
ONE iteration only. Initiate the computation with guesses of x y 1.

Answer: x 0.5, y 8
Universiti Malaysia Pahang

Exercise 3: Linear Algebraic Equations And Matrices

Numerical Methods

26. Given

TEST 2
BMM2112
1011I

10x 2 y 2 10 0
x2 y2 4x 2 y 1 0

Perform ONE iteration of Newton-Raphsons method to determine roots of the


above

equations. Initiate the computation with guesses of x 0.6295 and

y 2.4566.

[Answer: x 0.6296, y 2.4567 ]

REFERENCES

E. Balagurusamy, Numerical Methods, McGraw Hill, New Delhi, 1999.


R. K. Sankara, Numerical Methods for Scientists and Engineers, Prentice Hall, New
Delhi, 2005.
S. C. Chapra and R. P. Canale, Numerical Methods for Engineers, McGraw Hill, 2010.
S. Guha, Numerical Methods for Engineering and Science, Oxford University Press, New
Delhi, 2010
T. Veerarajan, Numerical Methods with Programs in C, McGraw Hill, New Delhi, 2006

Universiti Malaysia Pahang

You might also like