Project_One_Template
pdf
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
350
Subject
Mathematics
Date
Apr 3, 2024
Type
Pages
5
Uploaded by KailahWhitted_
Project One Template
MAT350: Applied Linear Algebra
Kailah Whitted
Date 03/21/24
Problem 1
Develop a system of linear equations for the network by writing an equation for each router (A, B, C, D, and E). Make sure to write your final answer as A
x
=
b
where A is the 5x5 coefficient matrix, x
is the 5x1 vector of unknowns, and b
is a 5x1 vector of constants.
Solution:
Node A = 2x1 + x2 = 100
Node B = x1 + x2 - x3 - x5 = 0 Node C = x1 - x3 - x5 = 50 Node D = -x2 + x4 + x5 = 120 Node E = x2 + x3 - x4 + x5 = 0 Ax = b
A = [2 1 0 0 0; 1 1 -1 0 -1; -1 0 1 0 1; 0 -1 0 1 1; 0 1 1 -1 1] x = [x1; x2; x3; x4; x5]
b = [100; 0; -50; 120; 0]
Problem 2
Use MATLAB to construct the augmented matrix [A b
] and then perform row reduction using the rref() function. Write out your reduced matrix and identify the free and basic variables of the system
.
Solution:
% Coefficient matrix A
A = [1 -1 0 0 0;
0 1 -1 0 0;
0 0 1 -1 0;
-1 0 0 1 0;
0 0 0 1 -1];
% Constants vector b
b = [0; 0; 0; 100; 0];
% Augmented matrix [Ab]
Ab = [A, b];
% Row reduce
reduced_matrix = rref(Ab);
disp(reduced_matrix);
1
1 0 0 0 -1 0
0 1 0 0 -1 0
0 0 1 0 -1 0
0 0 0 1 -1 0
0 0 0 0 0 1
Problem 3
Use MATLAB to compute the LU decomposition of A
, i.e., find A = LU. For this decomposition, find the transformed set of equations L
y
= b
, where y
= U
x
. Solve the system of equations L
y
= b
for the unknown vector y
.
Solution:
% LU decomposition
[L, U] = lu(A);
% Display L and U
disp(
'L:'
);
L:
disp(L);
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
-1 -1 -1 0 1
0 0 0 1 0
disp(
'U:'
);
U:
disp(U);
1 -1 0 0 0
0 1 -1 0 0
0 0 1 -1 0
0 0 0 1 -1
0 0 0 0 0
Problem 4
Use MATLAB to compute the inverse of U using the inv() function.
Solution:
A = [2 1 0 0 0;1 1 -1 0 -1;-1 0 1 0 1;0 -1 0 1 1;0 1 1 -1 1]
A = 5×5
2 1 0 0 0
1 1 -1 0 -1
-1 0 1 0 1
2
0 -1 0 1 1
0 1 1 -1 1
[L,U] = lu(A);
inv(U)
ans = 5×5
0.5000 0.5000 0 -0.5000 0
0 -1.0000 0 1.0000 0
0 0 1.0000 -0.5000 -1.0000
0 0 0 1.0000 -1.0000
0 0 0 0 1.0000
disp(U_inv);
Inf Inf Inf Inf Inf
0 Inf Inf Inf Inf
0 0 Inf Inf Inf
0 0 0 Inf Inf
0 0 0 0 Inf
Problem 5
Compute the solution to the original system of equations by transforming y into x
, i.e., compute x
= inv(U)
y
.
Solution:
A = [2 1 0 0 0;1 1 -1 0 -1;-1 0 1 0 1;0 -1 0 1 1;0 1 1 -1 1]
A = 5×5
2 1 0 0 0
1 1 -1 0 -1
-1 0 1 0 1
0 -1 0 1 1
0 1 1 -1 1
b = [100 0 50 120 0]'
b = 5×1
100
0
50
120
0
[L,U] = lu(A);
y = inv(L)*b;
x = inv(U)*y
x = 5×1
25
50
30
125
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
45
Problem 6
Check your answer for using Cramer’s Rule.
Use MATLAB to compute the required determinants using the det() function. Solution
% Define the coefficient matrix A and column vector b
A = [1, 2, 3, 4, 5; 6, 7, 8, 9, 10; 11, 12, 13, 14, 15; 16, 17, 18, 19, 20; 21, 22, 23, 24, 25];
b = [1; 2; 3; 4; 5];
% Initialize the matrices for x1, x2, x3, x4, x5
A1 = A;
A2 = A;
A3 = A;
A4 = A;
A5 = A;
% Replace the appropriate columns in A1-A5 with column vectors in b
A1(:,1) = b;
A2(:,2) = b;
A3(:,3) = b;
A4(:,4) = b;
A5(:,5) = b;
% Compute the determinants using det() function
det_A = det(A);
det_A1 = det(A1);
det_A2 = det(A2);
det_A3 = det(A3);
det_A4 = det(A4);
det_A5 = det(A5);
% Find the solutions for x1, x2, x3, x4, x5
x1 = det_A1 / det_A;
x2 = det_A2 / det_A;
x3 = det_A3 / det_A;
x4 = det_A4 / det_A;
x5 = det_A5 / det_A;
% Display the solutions
disp([
'x1 = '
, num2str(x1)]);
x1 = 0
4
disp([
'x2 = '
, num2str(x2)]);
x2 = 0.54516
disp([
'x3 = '
, num2str(x3)]);
x3 = -0.028226
disp([
'x4 = '
, num2str(x4)]);
x4 = -0.38911
disp([
'x5 = '
, num2str(x5)]);
x5 = 0.45161
Problem 7
The Project One Table Template, provided in the Project One Supporting Materials section in Brightspace, shows the recommended throughput capacity of each link in the network. Put your solution for the system of equations in the third column so it can be easily compared to the maximum capacity in the second column. In the fourth column of the table, provide recommendations for how the network should be modified based on your network throughput analysis findings. The modification options can be No Change, Remove Link, or Upgrade Link. In the final column, explain how you arrived at your recommendation.
Solution:
Fill out the table in the original project document and export your table as an image. Then, use the Insert
tab in the MATLAB editor to insert your table as an image.
5