Assignment #2 - Solutions
Assignment #2 - Solutions
0.5x|-x2=-9.5
1.01 xi -2x2=-18. 8
(a) Compute the determinant of the coefficient matrix, (b) Solve by elimination of unknowns.
(c) Again solve by elimination of unknowns, (d) Comment on the system's condition.
a,5- -(
2) ,A(=
I,¢! -1
!) ¥a=O,9.t4,+gpF _ Pi=f"Jstl{G'g#;+9jFjJ/I,o6
det(A)--48
Forward elimination:
cr2i is eliminated by multiplying row 1 by 6/1 = 6 and subtracting the result from row 2. cz3i is
eliminated by multiplying row 1 by -3/1 = -3 and subtracting the result from row 3.
C'32 is eliminated by multiplying row 2 by 7/(4) = -1.75 and subtracting the result from row
Back substitution:
X3=Z=2.25
20 -8(2.25)
= -0.5
-4
-3 -(-1)(2.25) -1(-0.5)
= -0.25
c) The system is expressed as the above augmented matrix.
[-i
Multiply row by 1/6 = 0.16667 and subtract from row 2 to eliminate cz2i. Multiply row 1 by
-3/6 = -0.5 and subtract from row 3 to eliminate cz3i.
-3.33333
Pivot:
22
52
0.66667 -1.33333
Multiply row 2 by 0.66667/5 = 0.133333 and subtract from row 3 to eliminate cz32.
Back substitution:
x3--#-225
2 -2(2.25)
X2= = -0.5
5
2 - 2(2.25) -2(-0.5) = -0.25
'tl=
Normalize the first row, and then eliminate cJ2i and a3i,
uJ|;=
a , = -a\ 2
a d\L= _`.0 -*-. ='-i ir2\ThL) = ` :h\v`S_i \
grl5 = -2-9 . a 9 „ ,?
i lj{--r= :, dr?79
I ~± :3.a ~i,,,i
o3'7 =i `rfet.if
dc L t[ ±~ , r:J` :S
0 c, -byS',ito?£J :cj®®91 - R.6f~ RE
B€i€`fr Substifus`iSi& :
-3
-3,1438S
-S.19~$55 :-:.-:§-::i:::::.,-:.:-
-£*£,ffis£#
= #. SS?# `l ?
-S.1S.*5S
-lfi¢5?14-{~2.E4Sff,'`.}{`4.SS?91?}
= -1 ]46faT§
4.428.ST|
-l£-f,-3)4.S$7#1?-3ti,48S?-q?
= ®A71S??
E£H#k gutsg[itut`iffFn:
-3
-E ¢ i i28S
-S.1S-$55
-.a.48.S$7
•io? = =S.£g}=S
i£,i#tr%£5
ldy.5-14~3~g~8.i43S#}£<S..i$25,\§
=`3,56¥u£
#.#=8§?1
12~€-3}{ffi.~S$2.S+j-3€<`3.S#2.S}
=S.S.$75
Use the Gauss-Seidel method to solve the following system until the relative error falls below €s=5%
lou,+2x2-x3=27
-3Xi-6X2+2x3=-61.5
Xi+X2+5#3=-21.5
The first iteration can be implemented as (use 0 as initial estimate for j*2 and x3)
27 -2x2 + x3 = 27 - 2(0) + 0 -_2.J
't,=
1010
-61.5 + 3x, -2x3 = -61.5 + 3(2.7) -2(0)
j*2=
=8.9
-6 -6
-21.5 -Xi -X2 -21.5 -(2.7) -8.9
X3=
= -6.62
Second iteration:
27 -2(8.9) -6.62 = 0.258
Xl=
10
-61.5 + 3(0.25 8) -2(-6.62)
X2= =7.914333
-6
-21.5 -(0.258) -7.914333
JX3=
= -5.934467
7.914333 -8.9
x 100% = 12.45%
7.91433.3
-5.934467 -(-6.62)
€a.3- x 1 0 0 °/o = 1 I . 5 5 0/o
-5 .934467
The remainder of the calculation proceeds until all the errors fall below the stopping criterion
of 5%. The entire can be summarized as
iteration unknown value maximum €a
xl 2.7 100.00%
X2 8.9 100.000/o
X3 -6.62 100.00% 100%
Xi 0.258 946.51 °/o
X2 7.914333 12.45%
X3 -5.93447 11.550/o 946%
Xi 0.523687 50.73%
X2 8.010001 1.19%
X3 -6.00674 1.200/o 50.73%
Xi 0.497326 5.30%
X2 7.999091 0.14%
X3 -5.99928 0.12% 5.30%
Xi 0.500253 0.59%
X2 8.000112 0.01%
X3 -6.00007 0.01 % 0.59%
= 0.500253, jx2 =
Thus, after 5 iterations, the maximum error is0.59% and we arrive at the result: xi
8.000112 and #3 = -6.00007.
A civil engineer requires 4800, 5800, and 5700 m3 of sand, fine gravel, and coarse gravel, respectively,
for a building project. There are three pits from which these materials can be obtained with composition
as specified in the table. Formulate the correct linear system and determine how many cubic meters must
be hauled from each pit.
sand(o/o) flne gravel (o/o) coarse gravel (°/o)
Pitl 25 20 55
Pit2 25 45 30
Pit3 55 30 15
Let xj = the volume taken from pit I.. Therefore, the following system of equations must hold
0.25x, + 0.25x2 + 0.55x3 = 4800
0.20x, + 0.45X2 + 0.30X3 = 5800
These can then be solved for xi = 4690, x2 = 9193, and x3 = 2417 m3. I used MATLAB to
solve [A] {x}={b} :
A-
X=
I.Oe+003 *
4.6900
9.1933
2.4167
Employing the same methods as used to analyze Fig. 12.4, determine the forces and reactions for the truss
shown. Formulate the matrix system and solve with Matlab or Excel.
i-h\
zTft=0=-~r`L®jLe56~SS0
ZTv=O I iJfro`VI|€®-¥e
i
Tb/€T:2
¥iH =0 = T{ e¢jts5` + Tz i T5 c¢7fro.vy-Tc 6®<j3o-