Answered step by step
Verified Expert Solution
Question
1 Approved Answer
!!!!!! USING MATLAB !!!!!!! !!!!!!!! USING MATLAB !!!!!!!! The mass-balance equations for each tank state that the rate at which a chemical enters the tank
!!!!!! USING MATLAB !!!!!!!
!!!!!!!! USING MATLAB !!!!!!!!
The mass-balance equations for each tank state that the rate at which a chemical enters the tank must equal the rate at which it leaves. The diagram shown illustrates an interconnected system of nine tanks, T_1 - T_9. All tanks except T_5 & T_9 receive inflow from an external source. All tanks receive inflow from at least one other tank. The concentration of chemical inflow into tank T_i is designated c_i and the flow rate from tank T_i to T_j is designated r_ij. Furthermore, the total flow into each tank must equal the flow out, r from tank 9). For this system, the mass-balance equations are: r_01c_01 + r_41c_4 = (r_12 + r_15) c_1 r_02c_02 + r_12c_1 + r_52c_5 = (r_23 + r_26)c_2 r_03c_03 + r_23c_2 = r_36c_3 r_04c_04 + r_74c_7 = (r_41 + r_48 + r_45)c_4 r_15c_1 + r_45c_4 = (r_52 + r_58 + r_59)c_5 r_06c_06 + r_26c_2 + r_36c_3 = r_69c_6 r_07c_07 + r_87c_8 = r_74c_7 r_08c_08 + r_58c_5 + r_48c_4 = (r_87 + r_89)c_8 r_59c_5 + r_69c_6 + r_89c_8 = rc_9 For given flow rates and input concentrations, we can solve for the concentrations in the tanks. Write a MATLAB function named tanksGaussSeidel to solve for these concentrations using Gauss-Seidel, to an accuracy of 5 sig figs. The external flow rates are the input (row array of length 7). The concentrations are the output (row array of length 9). The internal flow rates and input concentrations are given in the Cody template. For example: >> tanksGaussSeidel ([3 3 3 3 2 2 3]) ans = 1.3252 1.4994 1.3121 1.5203 1.0427 1.3329 1.1606 1.3 The mass-balance equations for each tank state that the rate at which a chemical enters the tank must equal the rate at which it leaves. The diagram shown illustrates an interconnected system of nine tanks, T_1 - T_9. All tanks except T_5 & T_9 receive inflow from an external source. All tanks receive inflow from at least one other tank. The concentration of chemical inflow into tank T_i is designated c_i and the flow rate from tank T_i to T_j is designated r_ij. Furthermore, the total flow into each tank must equal the flow out, r from tank 9). For this system, the mass-balance equations are: r_01c_01 + r_41c_4 = (r_12 + r_15) c_1 r_02c_02 + r_12c_1 + r_52c_5 = (r_23 + r_26)c_2 r_03c_03 + r_23c_2 = r_36c_3 r_04c_04 + r_74c_7 = (r_41 + r_48 + r_45)c_4 r_15c_1 + r_45c_4 = (r_52 + r_58 + r_59)c_5 r_06c_06 + r_26c_2 + r_36c_3 = r_69c_6 r_07c_07 + r_87c_8 = r_74c_7 r_08c_08 + r_58c_5 + r_48c_4 = (r_87 + r_89)c_8 r_59c_5 + r_69c_6 + r_89c_8 = rc_9 For given flow rates and input concentrations, we can solve for the concentrations in the tanks. Write a MATLAB function named tanksGaussSeidel to solve for these concentrations using Gauss-Seidel, to an accuracy of 5 sig figs. The external flow rates are the input (row array of length 7). The concentrations are the output (row array of length 9). The internal flow rates and input concentrations are given in the Cody template. For example: >> tanksGaussSeidel ([3 3 3 3 2 2 3]) ans = 1.3252 1.4994 1.3121 1.5203 1.0427 1.3329 1.1606 1.3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started