



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




ME2016A, Spring 2004, Dr. Ferri Name: ____ Solution _________ Test 2, March 19, 2004
This test is closed-book and closed-notes. Please show all your work.
Honor Pledge: On my honor, I pledge that I have neither given nor received any inappropriate aid in the preparation of this test.
Signature
Problem 1. (10 points) Consider the 4 linear algebraic equations of the form [A]*{x} = {B}:
4
3
2
1
x
x
x
x
Note that the matrix[A] is tridiagonal. (a) Without pivoting, find the LU decomposition for the matrix [A]. Show all of your steps (b) Solve for {x} using forward-and backward substitutions, showing all of your steps. (c) Without actually carrying out the procedure, how would your solution procedure change if you performed partial pivoting whenever called for?
Solution
(a) To eliminate a 21 , a 31 , and a 41 , we needs f 21 = 2, f 31 = 0, and f 41 = 0.
4
3
2
1
x
x
x
x
To eliminate a 32 , and a 42 , we needs f 32 = 0.5, and f 42 = 0.
4
3
2
1
x
x
x
x
To eliminate a 43 , we needs f 43 = 0.4.
4
3
2
1
x
x
x
x
Therefore, the LU decomposition of [A] is given by
[ L ] , and
(b) Define {d} = [U]{x}. Then, solve [L]{d}={B}:
4
3
2
1
d
d
d
d
L d
By forward substitution, d 1 = 3, d 2 = -4, d 3 = 5, d 4 = 0. Now solve for {x}
4
3
2
1
x
x
x
x
U x d
By back-substitution, x 4 =0, x 3 = 5/2.5 = 2, x 2 = (-4 + 2)/(-2) = 1, x 1 = (3 - 2) = 1. Thus:
4
3
2
1
x
x
x
x
(c) With pivoting: In step k = 1, we would switch rows 1 and 2 to place the largest element in column 1 into the (1,1) spot.
Problem 2. (10 points) Consider again the system of equations from problem 1, repeated here for your convenience:
4
3
2
1
x
x
x
x
(a) Starting from an initial guess of {x} = {0}, what is the value of the vector {x} after one iteration of the Jacobi iteration procedure? (b) Starting from an initial guess of {x} = {0}, what is the value of the vector {x} after one iteration of the Gauss-Seidel procedure?
Solution
The equations from which both algorithms are derived are as follows
11
a
x = b − a x , 22
a
x = b − a x − a x , 33
a
x = b − a x − a x , 44
a
x = b − a x
(a) With Jacobi iteration, keep {x}=0 constant until all four equations are evaluated:
x = − , 1 2
x = − + ,
x = + − , 2 1
x = −
(b) With Gauss-Seidel, we perform intermediate updates:
x = − , 2 2
x = − + ,
x = − − , 1. 5 1
x = −
Problem 3. (10 points) A scaffolding system consists of three lightweight rigid bars hanging from a series of ropes as shown. The equations of equilibrium for this system are as follows:
T (^) E + TF = P 3
P 3 − 4 TF = 0
TC + TD − TE = 0
2 TE − 3 TD = 0
TA + TB − TC − TD − TF = 0
− 9 TB + TC + 4 TD + 7 TF = 0
3
where TA, TB, etc, are the tensions in ropes A, B, etc, respectively. Write a Matlab program that solves for all of the rope tensions when P3 = 1000N, and also calculates the sum of the absolute values of all rope tensions. You may use any “standard” Matlab functions in your code.
Solution
Define {T} = [ TA TB TC TD TE TF ]T
P3 = 1000; A = [0 0 0 0 1 1; 0 0 0 0 0 4; 0 0 1 1 -1 0; 0 0 0 -3 2 0; 1 1 -1 -1 0 -1; 0 -9 1 4 0 7]; B = [P3; P3; 0; 0; 0; 0]; T = inv(A)*B sum_abs_T = sum(abs(T))