The figure above depicts an auto service garage it consists of four main areas. Area 1, the large vehicle bay, Area 2, the service department desks, Area 3, a multi-vehicle bay at the front of the garage, Area 4, a multi-vehicle bay at the back of the garage. This problem is aimed at understanding the CO2 concentrations for each area and coming up with a design to better the current ventilation system.
The red arrow depicts the airflow throughout the system. (Areas 2 and 4 have openings for ventilation which have been taken into account as (Qc) and (Qd). Areas 1 and 2 have inflows which are represented as (Qa) and (Qb))
The table below describes the limit at which the ventilation system should work in reducing CO concentration.
By separating the garage into 4 different areas the relationship among them can describe the CO concentrations for each area as c1, c2, c3, and c4. This is done by looking at the components that affect CO concentration in each area. For example, in Area 1 as shown above, the concentration depends on the vehicle load, the inflow of air, the outflow of air, and the mixing of air in-between areas 1 and 3.
The Gauss-Jordan method has an advantage of being computationally efficient. This is because the Gauss-Jordan method eliminates variables in one step. Additionally, the reduced row-echelon form of a matrix can be used to easily read off the solutions to a system of linear equations, whereas the row-reduced echelon form of a matrix only provides information about the solutions, but does not make them immediately apparent.
https://www.emathhelp.net/calculators/linear-algebra/reduced-row-echelon-form-rref-calculator/
Was used to better represent problems row reduction.
The backslash function in Matlab was used to derive the coefficients.
In Matlab the Gauss-Jordan method is more computationally intensive. This is because the Gauss-Jordan method eliminates variables in one step, whereas the backslash operator uses a more efficient algorithm that eliminates variables in multiple steps.
Define the matrix of coefficients
Define column vector for equations
Create a new matrix, augmented matrix from previous matrix and column vector
Set for loop for matrix deifinig columns and rows
Reorgainze matrix so that the first row has highes value
set for loop for rows per column
find factor for row reduction and row reduce
back substitute values to solve for values
set for loop for sum of terms
A sample calculation for calculating error is shown above
The Gauss-Jordan method and backslash solver have very similar results with errors coming from round-off when calculating factors.
The error in the system (Ax = b) can be determined from the matrix defining the relationship to the column vector b and coefficients (c1...c4). By looking at the condition number of the matrix the overall stability of the system can be estimated. If the condition number is too high there will be no solution. Whereas if the condition number is small the system can experience a change in the b vector and still find a solution. In this problem, the condition number of the matrix is around 6 meaning that the solution will converge.
I decided to first change area one from 1400 to 3000 in the column b. The * marked in green represents the concentration at the four areas when b(1,1) is changed. I then reverted area 1 from 3000 to 1400 and changed b(3,1) from 2000 to 3000. These are represented as * marked in red.
Although the change experienced was larger for area one the CO levels changed relatively the same. This means that the larger change in area 1 made less of an impact in the system than the change done in area 3. This can be attributed to the fact that Area 3 is more important in the system. Area 3 is dependent on area 1 and area 4; whereas, area 1 is only dependent in area 3.
A change from 25 to 5 in the coefficient relating to the relationship within areas 2 and 4, an example could be adding a barrier to block airflow. After changing E42, the mixing value from Area 2 and Area 4, the concentration values of c2 and c4 decreased minimally.
The Gauss-Jordan method and the backslash operator in MATLAB are both methods for solving systems of linear equations. The Gauss-Jordan method is a method for solving systems of linear equations by transforming the system into an equivalent system with a triangular shape coefficient matrix allowing for the equations to be solved by back substitution.
Looking at the service desk area where the CO is due to (i) the large vehicle exhaust, (ii) the multi-vehicle exhaust, and (iii) the airflow in the intake vents. The percentage each area contributes to the CO concentration is as follows.
(i). 28.12% for the large vehicle exhaust
(ii). 53.23% for the multi-vehicle exhaust
(iii). 18.65% for the airflow in the intake vents
Since the multi-vehicle exhaust contributes the most to the service desk area CO, the garage should look into implementing a policy of not allowing vehicles to idle for extended periods of time in the garage. This can help prevent the release of excess CO in Areas 3 and 4. (Shown in adjusting parameters) Even if a barrier is added at Area 2 lowering the mixing coefficient the CO levels will stay somewhat the same. (Shown in adjusting parameters cont.)
%%problem 1
a = [225,0,-25,0;0,125,0,-75;-225,0,275,-50;0,25,250,-275];
A = [225,0,-25,0;0,125,0,-75;-225,0,275,-50;0,25,250,-275];
b = [1400, 100, 2000, 0]';
ainv = A^-1;%inverse
Ainv = A^-1;%inverse
cana = a\b;%backslash operator
%% Gauss-Jordan
n = length(A);
% While loop
for k = 1 : n-1 % loop over each column
[maxval,index] = max(abs(A(k:n,k)));
swapindex = index + k - 1;
if swapindex ~= k
A([k,swapindex],:) = A([swapindex,k],:);
b([k,swapindex]) = b([swapindex,k]);
end
for i = k + 1:n % loop over each row the kth row
factor = A(i,k)/A(k,k);
A(i,:) = A(i,:) - factor * A(k,:);
b(i) = b(i) - factor * b(k);
end
end
% back Substitute
x = nan(length(n),1);
x(n) = b(n)/A(n,n);
for i = n-1:-1:1
S = b(i); % initialising a sum of terms
for j = i + 1: n
S = S - A(i,j) * x(j);
end
x(i) = S / A(i,i);
end
%percentage dependent
e1= ainv(1,1)*b(1,1)*1;
e2= ainv(2,2)*b(2,1)*1;
e3= ainv(3,3)*b(3,1)*1;
e4= ainv(4,4)*b(4,1)*1;
Airflow = e1 + e2 + e3 + e4;
ce1 = ainv(1,1) * b(1,1);
ce2 = ainv(1,2) * b(1,1);
ce3 = ainv(1,3) * b(1,1);
ce4 = ainv(1,4) * b(1,1);
c1 = ce1 + ce2 + ce3 + ce4;
cee1 = ainv(3,1) * b(3,1);
cee2 = ainv(3,2) * b(3,1);
cee3 = ainv(3,3) * b(3,1);
cee4 = ainv(3,4) * b(3,1);
c3 = cee1 + cee2 + cee3 + cee4;
f = cond(a);
faft = cond(A);