In: Advanced Math
Consider the following system of equations for all
problems.
The following system of equations is designed to determine
concentrations (the c’s in g/m3) in a series of coupled reactors as
a function of the amount of mass input to each reactor (the
right-hand sides in g/day).
8?1 − 4?2 − 2?3 = 2000
−3?1 + 18?2 − 6?3 = 1400
−4?1 − 2?2 + 12?3 = 3000
Calculate and interpret the condition number. Use the row-sum norm. Scale the coefficient matrix (A) so the absolute value of the maximum element in each row is 1 (max magnitude in each row = 1). You may use MATLAB’s inv to find the inverse of the scaled A matrix
%%Matlab code for condition number of a Matrix
clear all
close all
%Matrix A
A=[ 1 -1/2 -1/4; -1/6 1 -1/3; -1/3 -1/6 1];
fprintf('Scaled A matrix=\n')
disp(A)
fprintf('Inverse of Scaled A matrix=\n')
disp(inv(A))
inv_A=inv(A);
C=norm(A)*norm(inv_A);
fprintf('Condition number is %f\n',C)
%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%