USING MATLAB/SCILAB: Given the following set of linear equations, solve using LU DECOMPOSITION x1 + 2x2 - x3 + x4 = 5 -x1 - 2x2 - 3x3 + 2x4 = 7 2x1 + x2 - x3 - 5x4 = -1 x1 + x2 + x3 + x4 = 10 Please show me pictures of the matlab/scilab compiler or copy-paste code and output
A = [
1 2 -1 1;
-1 -2 -3 2;
2 1 -1 -5;
1 1 1 1
];
r = [5;7;-1;10];
n = 4;
D=A;d=r;
s=0;
for j=1:n-1
if A(j,j)==0
k=j;
for k=k+1:n
if A(k,j)==0
continue
end
break
end
B=A(j,:); C=r(j);
A(j,:)=A(k,:); r(j)=r(k);
A(k,:)=B; r(k)=C;
end
for i=1+s:n-1
L=A(i+1,j)/A(j,j);
A(i+1,:)=A(i+1,:)-L*A(j,:);
r(i+1)=r(i+1)-L*r(j);
end
s=s+1;
end
%-----------------------------------------------------------------
%Solution of equations
x(n)=r(n)/A(n,n);
for i=n-1:-1:1
sum=0;
for j=i+1:n
sum=sum+A(i,j)*x(j);
end
x(i)=(1/A(i,i))*(r(i)-sum);
end
%------------------------------
%Output
disp('@----------------------------------------------------------@')
disp('Output [A][x]=[b]')
disp('Upper riangular Matrix [B] =');disp(A)
disp('Matrix [b] =');disp(r)
disp('solution of linear equations :');disp(x')
Sample run
Output [A][x]=[b] Upper riangular Matrix [B] = 1.00000 2.00000 -1.00000 1.00000 0.00000 -3.00000 1.00000 -7.00000 0.00000 0.00000 -4.00000 3.00000 0.00000 0.00000 0.00000 3.58333 Matrix [b] = 5.0000 -11.0000 12.0000 13.6667 solution of linear equations : 11.60465 -5.27907 -0.13953 3.81395
USING MATLAB/SCILAB: Given the following set of linear equations, solve using LU DECOMPOSITION x1 + 2x2...
Solve using Gauss Jordan 3) Given the following set of linear equations x, +2x2-x3 +x4=5 -xi-2x2-3x3 + 2x4 = 7 x, +x2 + x3+x4=10
Q.1 Using the method of Triangular Decomposition solve the set of equations. Xı - 2x2 + 3x3 - X4 = -3 3x1 + x2-3x3 +2x4 = 14 5xi +3x2+2x3 + 3x4 = 21 2x1 - 4x2 – 2x3 + 4x4 = -10 If Ax = 2x, determine the eigenvalues and corresponding eigenvectors of -3 0 6 4 10 - 8 A 4 5 3 B= 1 2 1 1 2 1 -1 2 3 Q.2
Use the Gaussian elimination method to solve each of the following systems of linear equations. In each case, indicate whether the system is consistent or inconsistent. Give the complete solution set, and if the solution set is infinite, specify three particular solutions. 1-5x1 – 2x2 + 2x3 = 14 *(a) 3x1 + x2 – x3 = -8 2x1 + 2x2 – x3 = -3 3x1 – 3x2 – 2x3 = (b) -6x1 + 4x2 + 3x3 = -38 1-2x1 +...
Solve the given system of equations using either Gaussian or Gauss-Jordan elimination x1 + 2x2-3x3 = 19 2x1 -X2+ X3 - 4X1- x2 + x3= 8
Use a software program or a graphing utility to solve the system of linear equation solve for X1, X2, X3, and x4 in terms of t.) x1 - x2 + 2x3 + 2x4 + 6x5 = 13 3x1 - 2x2 + 4x3 + 4x4 + 12x5 = 27 X2 - X3 - X4 - 3x5 = -7 2x1 - 2x2 + 4x3 + 5x4 + 15x5 = 28 2x1 - 2x2 + 4x3 + 4x4 + 13x5 = 28 (X1,...
Use an algorithm that you would systematically follow to apply the technique and solve each set of systems of linear equations. For example, you may select the technique of finding the inverse of the coefficient matrix A, and then applying Theorem 1.6.2: x = A^-1 b. There are several ways that we have learned to find A^-1. Pick one of those ways to code or write as an algorithm. Or another example, you may select Cramer’s rule. Within Cramer’s rule,...
Solving Systems of Linear Equations Using Linear Transformations In problems 1-5 find a basis for the solution set of the homogeneous linear systems. 2. X1 + x2 + x3 = 0 X1 – X2 – X3 = 0 3. x1 + 3x2 + x3 + x4 = 0 2xı – 2x2 + x3 + 2x4 = 0 x1 – 5x2 + x4 = 0 X1 + 2x2 – 2x3 + x4 = 0 X1 – 2x2 + 2x3 + x4...
Solve the following system of equations using LU decomposition with partial pivoting:2x1−6x2–x3=−38,−3x1–x2+6x3=−34,−Solve the following system of equations using LU decomposition with partial pivoting:2x1−6x2–x3=−38,−3x1–x2+6x3=−34,−8x1+x2−2x3=−40
Please answer using MATHLAB. I need the code and the answer. Thanks, Use MATLAB or Scilab to perform the following matrix operations 1) Find the determinant of ſi 7 -2 31 5 -1 9 13 2 51 31 4 6 18 -4 21 2) Find the inverse (A-2) of ſi 7 -2 3] 5 -1 9 13 2 51 314 6 18 -4 2' 3) Given the following set of linear equations X, + 2 x, – x3 + xy...
1 ąuestion 1 Solve the following linear equations for , 2 and rs using LU decomposition ri + 2x2 +4x3--6, 2n+2x2 + 3x3 =-1. ·Write the matrix A associated with eq. (1.1). Write out the steps in the LU decomposition of A. . Display the final matrix in LU form . Also write down the final value of the array of the swap indices. (swap array) ·Also write down the total number of swaps performed . Calculate the determinant of...