Question: The Problem: In an industrial process there are 3 storage tanks as shown in Figure 1. There are valves controlling the flow rates into and


The Problem: In an industrial process there are 3 storage tanks as shown in Figure 1. There are valves controlling the flow rates into and out of the system q1in and q3,out as well as the flow rates between tanks q1,2 and q2,3. You are tasked with making an analysis of the steady- state (no change with time) condition of the tank system under 4 scenarios representing 4 different settings for the valves. .The steady-state system is defined by the following mass conservation rules: ,in 11,2 1,22,3 (2,3 93,out The flow rate into the system is controlled by a valve (represented by u) and is a . The flow rate between tanks 1 and 2 is controlled by a valve (represented by a1,2) and The flow rate between tanks 2 and 3 is controlled by a valve (represented by a2,3) and The flow rate out of the system is controlled by a valve (represented by a3out) as well constant: q1in also the difference between levels in tanks 1 and 2: q1,2a1,2(x1 -x2) also the difference between levels in tanks 2 and 3: q2,3a23(x2 - X3) as the level of tank 3: q3out- a3.out X3 These relationships combine to form the linear system in row-format Ax-b. The values of u, a1.2, a2.3 and a3 out are given and x is a column vector of the unknowns x1,x2 and x3. 1,2 0 0 2,3 3,out i,in 3,out 1,2 42,3 Figure 1: Schematic of the industrial tank system operating in the steady-state EAS 230 Spring 2019 Lab05 Page2 Part 1: Loading Data from Files (9 points) Open a new script file and save it as L05.m (4 pts) Prompt the user to enter the 4 quantities u, a1,2, a2.3 and a3,out 2. 1. (5 pts) Create the matrix A and the right-hand-side b Part 2: Solving a System of Equations Under Different Conditions (15 points) Below your code for Part 1, create a branch structure (if-elseif) to perform the following: 1. If there is no inflow (u then the tanks will be empty. Setx - [0; 0; 0] and print the following message to screen: 0) but all other valves are open (a1.2-a2.3 and a3,0ut 0), There is only the trivial solution: tanks are empty. For example, the conditional expression for this part will be 2. If there is nonzero inflow (u + 0) but any one of the other three valves are closed (a1.2, a2,3 or a3,out are zero), there is no solution and the valve settings are not compatible with the system. Set x = [NaN; NaN; NaNI (Hint: Do not put NaN in quotes) and print the following message to screen: There is no solution: open all valves. 3. If there is zero inflow (u -0) but any one of the other three valves are closed (one or more of a1.2, a2,3 or a3,out is zero), then one (or more) of the tanks will be empty but the other(s) may have an arbitrary depth. There are an infinite number of solutions, depending on how much fluid is in the system initially and its initial distribution between the 3 tanks. Set the solution x [0; 0; 0] and print the following message to screen: There are an infinity of solutions: open all valves. 4. If the inflow is non-zero (u 0) and all valves are open (a12,a2,3 and a3,out are also non-zero), then the system has a unique, non-trivial equilibrium solution. Find the solution x using left-divide and print the following message to screen: The fluid depths are: Tank 1 = XX.XX Tank 2 = XX.XX Tank 3 XX.XX Part 3: (4 points) Test your code for the following 4 parameter sets: EAS 230 - Spring 2019 - Lab05 Page 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
