Group 2 Act 3
Group 2 Act 3
ACTIVITY 3
GROUP 2
Results:
GROUP 2 EEP311L
ACTIVITY 3
2. Write each system of equations as an augmented matrix, then find the solutions using
Gaussian elimination and back substitution (i.e. the exact algorithm in this chapter).
a. 𝑥1 + 𝑥2 = 2, 4𝑥1 + 5𝑥2 = 10
GROUP 2 EEP311L
ACTIVITY 3
2. Write each system of equations as an augmented matrix, then find the solutions using
Gaussian elimination and back substitution (i.e. the exact algorithm in this chapter)
3. Turn in the plot and the two programs. (Do not print any large random matrices.)
a. Write a well-commented Matlab function program mysolvecheck with input a number n that makes a
random n × n matrix A and a random vector b, solves the linear system Ax = b, calculates the scalar
residual r = kAx − bk, and outputs that number as r.
GROUP 2 EEP311L
ACTIVITY 3
3. Turn in the plot and the two programs. (Do not print any large random matrices.)
b. Write a well-commented Matlab script program that calls mysolvecheck 10 times each for n = 5, 10,
20, 40, 80, and 160, then records and averages the results and makes a log-log plot of the average r vs.
n. =
nValues = [5,10,20,40,80,160]
GROUP 2 EEP311L
ACTIVITY 3
nValues = [5,10,20,40,80,160,320,640,1280,2560]
GROUP 2 EEP311L
ACTIVITY 3
>> c = [1; 2]
>> x = B \ c
symbolically as above by wrapping each number in sym. Create a numerical version via Cn = double(Cs)
and define the two vectors d1 = [4; 8] and d2 = [1; 1]. Solve the systems (as in the third line of code
above) Cs*x = d1, Cn*x = d1, Cs*x = d2, and Cn*x = d2. Explain the results. Does the symbolic or non-
symbolic way give more information?
GROUP 2 EEP311L
ACTIVITY 3
Results:
GROUP 2 EEP311L
ACTIVITY 3