You are on page 1of 41

1.

2.
3.

Based on it, the highest real root Graphically representation of the highest root of the
function ≈ 2:
4.
5.

6.
7.
6a.
6b.

7.

8.
9.
1ab.

1c.

2a.
2b.

3.
4.
5.
Theoretical Model in Computing Lab

LAB 3: LINEAR EQUATIONS


Instructor: Dr. Phuong Vo
Q1. Given the equations:
10𝑥1 + 2𝑥2 − 𝑥3 = 27
−3𝑥1 − 6𝑥2 + 2𝑥3 = −61.5
𝑥1 + 𝑥2 + 5𝑥3 = −21.5
(a) Solve by naive Gauss elimination. Show all steps of the computation.
(b) Substitute your results into the original equations to check your answers. You can use a
software package to check.
(c) Develop the program that solves the problem using naïve Gauss elimination.
Q2. (a) Use Gauss elimination with partial pivoting to solve:
8𝑥1 + 2𝑥2 − 2𝑥3 = 8
10𝑥1 + 2𝑥2 + 4𝑥3 = 16
12𝑥1 + 2𝑥2 + 2𝑥3 = 16
Show all steps of the computation. Check your answers by substituting them into the original
equations. You can use a software package to check.
(b) Develop the program that solves the problem using Gauss elimination with partial pivoting.

Q3. (a) Use Gauss-Jordan elimination to solve:


2𝑥1 + 𝑥2 − 𝑥3 = 2
5𝑥1 + 2𝑥2 + 2𝑥3 = 9
3𝑥1 + 𝑥2 + 𝑥3 = 5
Do not employ pivoting. Check your answers by substituting them into the original equations.
You can use a software package to check.
Q4. Solve the following set of equations with LU decomposition:
3𝑥1 − 2𝑥2 + 𝑥3 = −10
2𝑥1 + 6𝑥2 − 4𝑥3 = 44
−𝑥1 − 2𝑥2 + 5𝑥3 = −26

Q5. Given the equations:


15𝑐1 − 3𝑐2 − 𝑐3 = 3300
−3𝑐1 + 18𝑐2 − 6𝑐3 = 1200
−4𝑐1 − 𝑐2 + 12𝑐3 = 2400

1
Theoretical Model in Computing Lab

Solve this problem with the Gauss-Seidel method to 𝜀𝑠 = 5%.

HOMEWORK
Q6. Given the equations
2𝑥1 − 6𝑥2 − 𝑥3 = −38
−3𝑥1 − 𝑥2 + 7𝑥3 = −34
−8𝑥1 + 𝑥2 − 2𝑥3 = −20
(a) Solve by Gauss elimination with partial pivoting. Show all steps of the computation.
Substitute your results into the original equations to check your answers.
(b) Develop the program that solves the problem using Gauss elimination with partial pivoting.

Q7. Solve:
x1 + x2 − x3 = −3
6x1 + 2x2 + 2x3 = 2
−3x1 + 4x2 + x3 = 1
with
(a) naive Gauss elimination,
(b) Gauss elimination with partial pivoting, and
(c) Gauss-Jordan without partial pivoting.
(d) Develop the programs that solves the problem using above methods.

Q8. (a) Use naive Gauss elimination to decompose the following system according to the
description in Sec. 10.1.2.
7𝑥1 + 2𝑥2 − 3𝑥3 = −12
2𝑥1 + 5𝑥2 − 3𝑥3 = −20
𝑥1 − 𝑥2 − 6𝑥3 = −26
Then, multiply the resulting [L] and [U] matrices to determine that [A] is produced.
(b) Use LU decomposition to solve the system. Show all the steps in the computation.

(c) Also solve the system for an alternative right-hand-side vector: 𝑏 𝑇 = [12,18, −6] .

Q9. Use the Gauss-Seidel method to solve the following system until the percent relative error
falls below 𝜀𝑠 = 5%:
10𝑥1 + 2𝑥2 − 𝑥3 = 22

2
Theoretical Model in Computing Lab

−3𝑥1 − 6𝑥2 + 2𝑥3 = −14


𝑥1 + 𝑥2 + 5𝑥3 = 14
-END-

3
Theoretical Model in Computing Lab

LAB 2: ROOT FINDING, LINEAR ALGEBRA


Instructor: Dr. Phuong Vo
Q1. Write the following set of equations in matrix form:
40 = 5𝑥3 + 2𝑥1
10 − 𝑥2 = 𝑥3
4𝑥2 + 8𝑥1 = 21

Q2. A number of matrices are defined as

4 5 4 3 7 3 𝑇
[𝐴] = [1 2] [𝐵] = [1 2 6] [𝐶] = [5]
5 6 2 0 4 1
1 5 9
[𝐷] = [9 4 3 −6
] [𝐸] = [7 2 3] [𝐹] = [2 0 1
] [𝐺] = [7 5 4]
2 −1 6 5 1 7 3
4 0 6
Answer the following questions regarding these matrices:
(a) What are the dimensions of the matrices?
(b) Identify the square, column, and row matrices.
(c) What are the values of the elements: 𝑎12 , 𝑏23 , 𝑑32 , 𝑒22 , 𝑓12 , 𝑔12 ?
(d) Perform the following operations:
(1) 𝐸+𝐵 (7) 𝑡𝑟𝑎𝑐𝑒𝐸
(2) 𝐴𝐹 (8) 𝐷 𝑇
(3) 𝐵−𝐸 (9) 𝐴𝐶
(4) 8𝐵 (10) 𝐼𝐵
(5) 𝑑𝑒𝑡 𝐵 (11) 𝐴𝑇 𝐴
(6) 𝐵−1 (12) 𝐶 𝑇 𝐶
Q3. Determine the highest real root of
𝑓(𝑥) = 2.1𝑥 3 − 11.6𝑥 2 + 17.5𝑥 − 6
(a) Graphically.
(b) Fixed-point iteration method (three iterations, 𝑥0 = 3). Note: Make certain that you develop
a solution that converges on the root.
(c) Newton-Raphson method (three iterations, 𝑥0 = 3).
(d) Secant method (three iterations, 𝑥−1 = 3, 𝑥0 = 4).
(e) Modified secant method (three iterations, 𝑥0 = 3, 𝛿 = 0.01).
Compute the approximate percent relative errors for your solutions.
Q4. (Mabe homework) Use (a) fixed-point iteration and (b) the Newton-Raphson method to
determine a root of 𝑓(𝑥) = −𝑥 2 + 1.8𝑥 + 2.5 using 𝑥0 = 5. Perform the computation until 𝜀𝑎 is
less than 𝜀𝑠 = 0.01%. Also perform an error check of your final answer.

1
Theoretical Model in Computing Lab

HOMEWORK
Q5. Three matrices are defined as
1 5 2
[𝐴] = [ 3 10] [𝐵] = [ 4 3] C= [ −2 ]
0.5 2
−4 3 −35
(a) Perform all possible multiplications that can be computed between pairs of these matrices.
(b) Justify why the remaining pairs cannot be multiplied.
(c) Use the results of (a) to illustrate why the order of multiplication is important.
(d) Calculate 𝐴𝑇 𝐴, 𝐴𝐴𝑇 ,\𝑡𝑟𝑎𝑐𝑒𝐵, 𝑑𝑒𝑡 𝐵 , 𝐴𝐵, 𝐵−1 , 𝐶 𝑇 𝐶, 𝐶𝐶 𝑇

Q6. Determine the highest real root of 𝑓(𝑥) = 0.95𝑥 3 − 5.9𝑥 2 + 10.9𝑥 − 6:
(a) Graphically.
(b) Using the Newton-Raphson method (three iterations, 𝑥0 = 3.5).
(c) Using the secant method (three iterations, 𝑥−1 = 2.5 and 𝑥0 = 3.5).
(d) Using the modified secant method (three iterations, 𝑥0 = 3.5, 𝛿 = 0.01).

Q7. Determine the roots of the simultaneous nonlinear equations


(𝑥 − 4)2 + (𝑦 − 4)2 = 5

𝑥 2 + 𝑦 2 = 16
Use a graphical approach to obtain your initial guesses. Determine refined estimates with the
two-equation Newton-Raphson method described in Sec. 6.6.2.
-END-

You might also like