代写CHE3162 Modelling Assignment Semester 2, 2024调试Matlab程序
- 首页 >> Algorithm 算法CHE3162 Modelling Assignment
Semester 2, 2024
Case Study - pH Neutralisation Plant
1 Process Description and Control Narrative
This assignment is based on a conference paper by Hall and Seborg, available in Moodle and also online at https://ieeexplore.ieee.org/document/4790490?arnumber=4790490.
The control of pH is an industrially important problem for applications such as biological reactions and waste treatment. pH control can be very difficult due to inherent nonlinearity. Figure 1 shows the process flow diagram of a pH neutralisation plant.
The neutralisation process consists of two continuous stirred tank reactors (CSTR) interconnected by two streams with flowrates, Q8 and Q10. The inlet streams for each tank consist of a base (NaOH) stream (Q3 or Q6), an acid (HNO3) stream (Q1 or Q4), and a load stream for the buffering (NaHCO3) agent (Q2 or Q5). The four manipulated variables are the acid and the base flowrates. The four controlled variables are the liquid levels for tank 1 and tank 2 (i.e. h1 and h2) and effluent pH values (pH1 for the stream with flowrate Q7 and pH2 for the stream with flowrate Q9). The flowrates of the buffer streams are considered to be unmeasured disturbance variables.
The two neutralisation reactors are connected by streams Q8 and Q10 which provide coupling between the levels and compositions. Therefore, each manipulated variable directly affects the pH and level of the tank that it flows into, and indirectly affects the other tank via streamsQ8 and Q10. The small tanks on the acid lines (tanks 3 & 4) are introduced to provide different dynamics for the acid and base inlet streams. Due to the nonlinearity of the titration process, the pH responses to changes in any of the manipulated variables are very nonlinear.
Figure 1: Process flow diagram of the pH neutralisation plant.
2 Process Model Description and Equations
For control studies, dynamic models of the process are frequently used to mimic the real process such that in silico (computer) simulations can be carried out to test the efficacy of different control strategies. The dynamic model for the pH neutralisation process described above can be developed based on conservation and equilibrium equations for the dissociation constants for water and the weak acid, H2CO3 . The chief modelling assumptions are perfect mixing, constant density, the ions involved are completely soluble, and no substance enters or leaves the system except through the flow streams. The chemical reactions for the neutralisation process are:
To model the neutralisation process, it is common to define the two reaction invariant concentrations for the i-th stream:
The quantities Wai and Wbi are called reaction invariants because they are not affected by the extent of the reactions in Eqs. (1)-(3). Assume that the reactions are fast enough so that the system is at equilibrium, then the equilibrium relations can be used to determine the concentration of hydrogen ion from the reaction invariants, Wa and Wb. The equilibrium constants are:
By combining these expressions, the following equation can be derived:
This equation represents a nonlinear relation between Wa, Wb and hydrogen ion concentration for the system. The hydrogen ion concentration and pH can be determined using this equation if Wa and Wb are known.
The dynamic model for the neutralisation process consists of the following equations:
Mass balances on tank 3 and tank 4 yield the following equations:
where the liquid levels in tank 3 and tank 4 are denoted by h3 and h4, respectively. Exit flowrates, Q11 and Q12 , are assumed to be related to the liquid levels by the flow-head relations:
where Cv11 and Cv12 are constants.
Mass balances on tanks 1 and 2 give:
The relevant head-flow relationships are:
where Z7 is the vertical distance between the bottom of tank 1 and the outlet for Q7 , Z8 is the vertical distance between the bottom of tank 1 and the bottom of tank 2, and Z9 is the vertical distance between the bottom of tank 2 and the outlet for Q9 .
In order to develop a dynamic model for pH in the neutralisation tanks, balances were made on each of the ionic species in the system. Combining these equations in the proper manner yields the following equations for reaction invariants Wa and Wb:
Subscripts T1 and T2 denote the concentration of the solutions in neutralisation tanks 1 and 2. These equations allow reaction invariants in the two neutralisation tanks to be determined as a function of time assuming the initial conditions are known and the flowrates and concentrations of the inlet streams are known. The pH of the solution in each of the tanks can be determined from Eq. (9) and invariants WaTi and WbTi. The nominal values of the key process variables and parameters are shown in Table 1.
Table 1: Key process variables/parameters and mean nominal values
The plant model was coded in the Simulink environment, and available to you as “ph_plant.slx” . The equations necessary to model the entire process was programmed using an s-function with the filename “ neutralisation_sfcn.m” . Make sure that you put both files in the same folder. When you open the main file, i.e. ph_plant.slx, this is what you will see (Figure 2).
Figure 2: Simulink diagram of the neutralisation process.
After you have run the file, the key variables are automatically saved in the workspace, as shown below in Figure 3. If you need to save more variables, you can use the “To Workspace” block under the “Sinks” category of the Simulink Library Browser.
Figure 3: Workspace variables saved from Simulink.
3 Preliminary System Analysis
Some preliminary analysis has been performed. This data is available and can be used to answer some of the tasks. The tanks were initially assumed to be independent, and were modelled with the flowrates Q8 and Q10 set to zero. The steady-state relationships between the input and the output variables were determined using an input range of 14.9 mL/s to 17.9 mL/s for the Tank 1 acid and base streams, Q1 and Q3 . The results are shown in Figure 4.
For Q1-h1 , and Q3-h1 , the relationships are linear throughout the entire operating range but for Q1-pH1 and Q3-pH1 , the relationships are highly nonlinear (a transfer function with constant parameters cannot be used to describe the entire operating range).
Figure 4: Steady state relationship for Q1-h1 , Q3-h1 , Q1-pH1 and Q3-pH1 .
The step responses for each input-output pair were determined by implementing a unit step change of 16.4 mL/s to 17.4 mL/s for the acid stream Q1(s) to obtain the open loop responses h1(s)/Q1(s) and pH1(s)/Q1(s) and a negative unit step change of 16.4 mL/s to 15.4 mL/s for the base stream to obtain the open loop responses for h1(s)/Q3(s) and pH1(s)/Q3(s).
The four responses were modelled using First Order Plus Dead Time (FOPDT). The model parameters are given in Table 2 below.
Table 2: FOPDT parameters for Tank 1 open loop responses
4 Getting Started
You can access MATLAB via MATLAB Online or MOVE, or on your own device.
If you're running MATLAB and Simulink on your own device, make sure the Optimisation Toolbox Add-on is installed in MATLAB.
Save the two model files (pH_plant.xls and neutralization_sfcn.m) in the same folder and make sure that MATLAB is pointing to that working folder.
To run the model, open "pH_plant.xls". This model calls the m-function "neutralization_sfcn.m". The neutralisation function will not run by itself as it requires inputs from the model.
5 Assignment
You are an engineer working in industry at an established facility that involves a pH neutralisation plant. Your manager has given you a physics-based sophisticated model of the process that is currently used in the control system. This model is complex and slow, and the control of the pH system is therefore suboptimal. In order to improve process control your manager asks you to create a transfer-function model of the process, compare it to the sophisticated model, and tell them whether or not and why you would recommend using the transfer-function model as a simple, faster replacement for the complex, slow model they are currently using to control the neutralisation plant.
Present your results as a brief report where everything is clearly laid out and concisely explained. The report should be standalone - that means someone who has never worked on this project should be able to read your report and understand what you have done , why, and the major outcomes. You should include everything that would help readers understand your work, including meaningful screenshots of the Simulink environment that show the necessary connection of blocks. Label all your plots completely and appropriately. Include your answers to all tasks, and all required model responses. Also include a screenshot showing your final Simulink file with all connections. Marks are assigned for content, correctness, conciseness and clarity of your report. Some data and figures can be in the appendix if you think it is too repetitive. The report body should be approximately 10 pages. Please concentrate on presenting your results and answering the questions as clearly and concisely as possible. A table of data or a screenshots, plus a few sentences of description or explanation should be enough to respond to each part of each task.
Note that we need to seethe Simulink response plots for each task to be able to mark this assignment, so that we can see your response for your calculated loop parameters. This means taking screen shots of each stage of the work, including the scope graph output responses with clear labels and the Simulink model showing connections and parameters. You may export data and replot in (e.g.) Excel or MATLAB if you prefer, but this is not necessary as long as the screenshots of the Scope window(s) you include are legible. Consider combining several outputs into a single scope block to save space in your report and make it easier to compare and discuss responses.
Task 1: Develop a FOPDT model and compare it to the sophisticated model
a) Develop a transfer function model of Tank 1 using the FOPDT parameters from Table 2 above and the transfer function matrix given below. Once you have the transfer functions. Create a new, blank model in Simulink and model the pH neutralisation process using your transfer functions.
b) In your TF model, beginning with the nominal operating conditions given in Table 1, introduce a step change in Q1 from 16.4 mL/s to 17.4 mL/s at 20 mins followed by a step change in Q3 from 16.4 mL/s to 17.4 mL/s at 40 mins.
c) Open the sophisticated model provided and disconnect tank 1 and tank 2 by setting the flowrates Q8 and Q10 to zero. Implement the same step changes to the sophisticated model as you did for your FOPDT model in part b). What can you conclude about the FOPDT model?
d) If the step change in Q3 varies from 16.4 mL/s to 15.9 mL/s at 40 mins instead, would the transfer function model still be able to approximate the sophisticated model well? In your opinion, which output is easier to control? Justify your answer.
Task 2: RGA
Using the sophisticated model with the tanks decoupled (Q8 and Q10 set to zero):
a) Use step testing to calculate the steady state Relative Gain Array (RGA) matrix for the input-output pairs of Tank 1
b) Based on the RGA matrix, how would you pair the manipulated and controller variables?
c) What would be the consequence of pairing the variables against the results of the RGA matrix?
Task 3: pH control design
a) An engineer proposes that you use either the PI or PID control in this case. In your opinion, why did he not recommend the P only controller?
b) Use the appropriate Ziegler-Nichols open loop and Internal Model Control (IMC) tuning rules shown in Table 3 to tune a PI or PID controller (choose one) for the pH control loop of tank 1 using the appropriate FOPDT parameters from Table 2.
Table 3: Ziegler-Nichols and IMC tuning formulae.
c) Implement the tuning rules using the sophisticated model. Compare the performance of a controller tuned using the two different tuning rules for a change in pH setpoints: a) from 8.5 to 7.5 at 20 mins, and b) from 8.5 to 9.5 at 20 mins. Justify your choice of controller (PI or PID from part b).
d) Are the results for a), b) and c) expected?
Task 4: Level control design
a) Design a PI controller for the level control loop of tank 1 using the appropriate FOPDT parameters from Table 2 and using the IMC tuning rules so that now you have two controllers, one for controlling pH and another for controlling level.
b) Introduce a step change in pH setpoint from 8.5 to 9.5 at 10 mins, followed by a step change in level setpoint from 14 cm to 13 cm at 30 mins. Discuss the performance of this multi-loop control scheme.
c) Are there strong interactions between the two decentralised control loops?
d) Why is this happening and is this expected from the RGA matrix?
Task 5: Recouple the tanks
Set the flowrates Q10 to the nominal value in Table 1 and Q8 to one to reconnect tank 1 and tank 2. Add the same controllers for the same input-output pairs for tank 2 with the same set of tuning parameters. In other words, you will have four controllers, two for tank 1 and tank 2 respectively.
a) To cater to different phase of the operation, it is desirable to manipulate the pH setpoint of both tanks while making sure that the levels of both tanks stay at the nominal values. Introduce a step change in pH setpoint from 8.5 to 9.5 at 10 mins, followed by step change in pH setpoint from 9.5 to 10.0 at 30 mins for both tanks. Discuss the performance of this multi-loop control scheme.
b) A technical issue occurs at 60 mins which causes the pump flow for Q10 to be reduced from 32.8 mL/s to 30 mL/s. Discuss the performance of the controllers in rejecting this disturbance.
c) What is your recommendation to alleviate the problems encountered in your control scheme?
d) What is your final recommendation to your manager? Include a brief explanation / justification