Consider the following: x = [2 4 1: 0 2 3: 1 5 2] y [2 2:10: 3 2] and w = 2 By h
ID: 3819172 • Letter: C
Question
Consider the following: x = [2 4 1: 0 2 3: 1 5 2] y [2 2:10: 3 2] and w = 2 By hand, estimate the result for each of the following operations. Check your calculations by entering into Matlab, If the operation is invalid, note why in a comment in your script (for example: Z10 iny(y)-Invalid because yis not a square matrix). Only your published Matlab script will be submitted with the assignment.. Z1 = x * y Z2 = y * x Z3 = w * y Z4 = x + y Z5 = y + w Z6 = x_1 * xZ7 = x, * y Z8 = iny(x) * x Z9 = det(x) Then consider a distillation column that separates a mixture of water and ethanol. The feed to the column is 40% by mass of ethanol and 60% water. The water rich bottoms stream (x kg/hr) is 80% by mass of water. The ethanol rich top stream (y kg/hr) is 70% by mass ethanol. Assume 100 kg/hr of the mixture is fed to the column. Write the mass balance on water and ethanol to get two equations in two unknowns Bottom and Top. Then write Matlab code to determine Bottom and Top flowrates, 100 0.6 0.8 Bot 0.4 Top flowrates. e.g. Water Balance Water in = Water out 100 *0.6 = 0.8*Bot + 0.4*Top Ethanol Balance: Consider that A * X = B where A is a matrix of coefficients, X is a column vector: X = [Bot Top], and B is the value of the equations in a column vector, B = [Water In Ethanol In].Explanation / Answer
x=[2 4 1;0 2 3;1 5 2];
y=[2 2;1 0;3 2];
w=2;
z1=x*y;
%z2=y*x; this is not possible beacuse y=[3*2] and x=[3*3] as 2 not equal to
%3 so matrix dimension don't agree
z3=w*y;
%z4=x+y; %matrix dimension is not agree
z5=y+w;
z6=x.*x;
%z7=x.*y; % matrix dimension problem
z8=inv(x)*x;
z9=det(x);
%100*0.6=0.8*Bot+0.4*Top;
%100*0.4=0.6*Bot+0.7*Top;
%we need to solve AX=B;
A=[0.8 0.4;0.6 0.7];
B=[60;40];
X = AB;