Question

In: Mechanical Engineering

Problem 1: Carry out the first three iterations of the solution of the following set of...

Problem 1:

Carry out the first three iterations of the solution of the following set of equations using the Gauss Seidel iterative method.Provide the solution using a program, you are free to use any language including MATLAB.

8x1+2x2+3x3 = 51

2x1+5x2+x3 = 23

-3x1+x2+6x3 = 20

Solutions

Expert Solution

clc

clear all

close all

clear;clc

format compact

A = [8 2 3;

2 5 1;

-3 1 6];% coefficients matrix

C = [51;23;20];% constants vector

n = length(C);

X = zeros(n,1);

Error_eval = ones(n,1);

for i = 1:n

j = 1:n;

j(i) = [];

B = abs(A(i,j));

Check(i) = abs(A(i,i)) - sum(B); % Is the diagonal value greater than the remaining row values combined?

if Check(i) < 0

fprintf('The matrix is not strictly diagonally dominant at row %2i\n\n',i)

end

end

iteration = 0;

while max(Error_eval) > 0.001

iteration = iteration + 1;

Z = X; % save current values to calculate error later

for i = 1:n

j = 1:n; % define an array of the coefficients' elements

j(i) = []; % eliminate the unknow's coefficient from the remaining coefficients

Xtemp = X; % copy the unknows to a new variable

Xtemp(i) = []; % eliminate the unknown under question from the set of values

X(i) = (C(i) - sum(A(i,j) * Xtemp)) / A(i,i);

end

Xsolution(:,iteration) = X;

Error_eval = sqrt((X - Z).^2);

end

GaussSeidelTable = [1:iteration;Xsolution]'

MaTrIx = [A X C]

Result


Related Solutions

QUESTION: USING MATLAB, Carry out three iterations of the Gauss-Seidel method, starting from the initial vector...
QUESTION: USING MATLAB, Carry out three iterations of the Gauss-Seidel method, starting from the initial vector Use the  ,  and  norm to calculate the residual error after each iteration, until all errors are below 0.0001. [Use 5 decimal place accuracy in you calculations]
compute the first three iterations of the gradient ascent algorithm applied to the function f(x) =...
compute the first three iterations of the gradient ascent algorithm applied to the function f(x) = -0.2 + x + x^2 - 5.5x^3 +4x^4. Assume initial value for x0 = 0.11 and alpha = 0.1.
In order to carry out an anaerobic fermentation, a saturated solution of strontium hydroxide is used...
In order to carry out an anaerobic fermentation, a saturated solution of strontium hydroxide is used in a trap. The strontium hydroxide reacts with the carbon dioxide produced from the fermentation yielding a precipitate of strontium carbonate, while no air is allowed into the system. How many grams of strontium carbonate would you expect to collect from the fermentation of 55.00g of sucrose at 65.0 % efficiency and at 23 C and 1 atm? Assume all CO2 is trapped as...
1. Carry out a full PESTEL analysis for ONE of the following companies: a) British Airways...
1. Carry out a full PESTEL analysis for ONE of the following companies: a) British Airways b) Coca-Cola Provide AT LEAST four relevant points under each category, just as we did in class and explain the reasoning for each point (equal marks are given for each point under this question)
1. There are three sets of assay data obtained from a set of standard solution in...
1. There are three sets of assay data obtained from a set of standard solution in an ELISA experiment (triplicate assay). Use Excel to draw a calibration curve. Then do the following: (a) Calculate the Lower Limit of Detection (LLOD) (b) Calculate the Limit of Quantitation (LOQ) (c) Calculate the Sensitivity of the assay (d) If an unknown sample gives an assay reading of 1.35. Use the calibration curve to determine the concentration of this sample. Concentration (ng/mL) Assay1 Assay2...
Your firm has been appointed for the first time to carry out the audit of Sarooj...
Your firm has been appointed for the first time to carry out the audit of Sarooj Construction, a small construction firm in Muscat, for the year ending December 31, 2019. Sarooj Construction has been in operations for the last five years. It was doing well on the first two years but competition affected the business and they started to struggle from the third year up to this year, their fifth year in operation. As part of knowing the business, you...
Your firm has been appointed for the first time to carry out the audit of Teejan...
Your firm has been appointed for the first time to carry out the audit of Teejan Enterprises for the year ending December 31, 2019. The entity is engaged in trading of office furnitures and operates from 6 branches in various cities. Teejan Enterprises has been in operation for nearly 8 years and was far bigger now than when it first started by its original owners. Teejan was originally owned by two people who became husband and wife. As the years...
Your firm has been appointed for the first time to carry out the audit of ZZZ...
Your firm has been appointed for the first time to carry out the audit of ZZZ Construction, a small construction firm in Muscat, for the year ending December 31, 2019. Sarooj Construction has been in operations for the last five years. It was doing well on the first two years but competition affected the business and they started to struggle from the third year up to this year, their fifth year in operation. As part of knowing the business, you...
Carry out the following calculation with the correct number of sig figs. (24.324)(3.2122) – 9.3210 Carry...
Carry out the following calculation with the correct number of sig figs. (24.324)(3.2122) – 9.3210 Carry out the following calculation with the correct number of sig figs. (431.00791+52.5441) / 45.3200130
Solve the LP problem. If no optimal solution exists because there is no Solution Set, enter...
Solve the LP problem. If no optimal solution exists because there is no Solution Set, enter EMPTY. If no optimal solution exists because the region is unbounded, enter UNBOUNDED. Note that an unbounded region can still have an optimal solution while a bounded region is guaranteed to have optimal solutions. HINT [See Example 1.] Maximize and minimize p = x + 2y subject to x + y ≥ 4 x + y ≤ 10 x − y ≤ 4 x...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT