(Use MATLAB) Use Gaussian elimination with backward substitution to solve the following linear system. For this problem you will have to do scaled partial pivoting. The matrix A and the vector b are in the Matlab code shown below
A=[3 -13 9 3;-6 4 1 -18;6 -2 2 4;12 -8 6 10];
display(A);
b=[-19;-34;16;26];
display(b);
Please find the required MATLAB script as the following:
%==================================================
clear all;
clc;
% Given data
A=[3 -13 9 3;-6 4 1 -18;6 -2 2 4;12 -8 6 10];
display(A);
b=[-19;-34;16;26];
display(b);
% Preliminary calculation
n=length(A(:,1));
A=[A,b];
x=zeros(n,1);
flag=0;
NROW=1:n;
for i=1:n-1
if flag==0
M=max(abs(A(NROW(i:n),i)));
if M==0
flag=1;
else
I=find(abs(A(NROW(i:n),i))==M);
p=I(1)+i-1;
if p>i
NCOPY=NROW(i);
NROW(i)=NROW(p);
NROW(p)=NCOPY;
end
end
if flag==0
for j=i+1:n
m=A(NROW(j),i)/A(NROW(i),i);
A(NROW(j),i:n+1)=A(NROW(j),i:n+1)-m*A(NROW(i),i:n+1);
clear m;
end
end
end
end
if flag==0
if A(NROW(n),n)==0
flag=1;
end
end
if flag==0
x(n,1)=A(NROW(n),n+1)/A(NROW(n),n);
for i=n-1:-1:1
x(i,1)=(A(NROW(i),n+1)-sum(x(i+1:n,1)'.*A(NROW(i),i+1:n)))/A(NROW(i),i);
end
else
x='no unique solution may exist';
end
display('The solution is: ');
display(x);
%==================================================
output:
(Use MATLAB) Use Gaussian elimination with backward substitution to solve the following linear sy...
Problem 3. Consider the following the linear system . Solve the above linear system by using Gaussian elimination with partial pivoting strategy. . Solve the above linear system by using Gaussian elimination with scaled partial pivoting strategy. Problem 3. Consider the following the linear system . Solve the above linear system by using Gaussian elimination with partial pivoting strategy. . Solve the above linear system by using Gaussian elimination with scaled partial pivoting strategy.
Please show work for all steps to receive rating. 13 1. Solve the following linear system of equations using 13 1 2][X1] 6 2 9||X2| = |17 15 3 2] [X3] L a. Naïve Gaussian Elimination and b. Gaussian Elimination with partial pivoting
2,3, 6, 7 1. Without matrices, solve the following system using the Gaussian elimination method + 1 + HP 6x - Sy- -2 2. Consider the following linear system of equation 3x 2 Sy- (a) Write the augmented matrix for this linear system (b) Use row operations to transform the augmented matrix into row.echelon form (label all steps) (c) Use back substitution to solve the linear system. (find x and y) x + 2y 2x = 5 3. Consider the...
write a program that performs gaussian elimination on a linear system and use it to solve a matrix with 10 equations and 10 variables. any language is okay to use
Using MATLAB please. Recall the formula for backward substitution to solve the upper triangular system ain 011 0 012 022 bi b. alan ... 0 0 ann be which is bi - Ej=i+1 Qi; I; i= 1,...n Write a MATLAB function backward_substitution that solves an upper triangular system. Test your code using the example T 6 A 2 0 0 1 1 0 2 3 b 9 1 15
Total(25 marks) 3. Given the system of equation as 3x + 7y - 2z=2 x - 5y + z = 13 2x + 3y - 102=-23 (a) Write a Matlab/C++ computer program to solve the system of linear equations based of the partial/scaled pivoting technique in Q3b below/ You can use any programming language] CR(10) An(9) AP(3) An(3) (b)Solve the system of equation using Gauss-Jordan Elimination method Hence Find the ii) Determinant of the matrix A, the coefficient Matrix of...
3 Linear systems 18. Solve the linear system of equations using the Naive Gauss elimination method x,+x: + x) = 1 +2x, +4x1 x 19. Solve the linear system of equations using the Gauss elimination method with partial pivoting 12x1 +10x2-7x3=15 6x, + 5x2 + 3x3 =14 24x,-x2 + 5x, = 28 20. Find the LU decomposition for the following system of linear equations 6x, +2x, +2, 2 21. Find an approximate solution for the following linear system of equations...
Given the system of linear equations 5?1 + 2?2 + ?3 = 45 −2?1 + ?2 − 3?3 = −4 4?1 − ?2 + 8?3 = 2 a. Write the augmented matrix b. Solve the system by Gaussian elimination & backward substitution method.
Write a function that solves the matrix equation Ax = b using Gaussian Elimination. Your function should accept as input a n-by-n matrix A and an n-by-1 vector b, and it should produce a n-by-1 vector x that satisfies Ax = b. Gaussian Elimination has two parts: forwards elimination and backwards substitution. You'll need to use both to solve the problem. It's okay to rigidly follow the pseudocode in the book. Using C++ Don't just use a library call, even...
1. Solve the following system of equations using Gaussian Elimination with Back Substitution or Gauss-Jordan Elimination. 2x - y +9z = -8 -X - 3y + 4z = -15 5x + 2y - z = 17