• Non ci sono risultati.

Integrating a dynamic process simulator with optimization algorithms and advanced control

N/A
N/A
Protected

Academic year: 2021

Condividi "Integrating a dynamic process simulator with optimization algorithms and advanced control"

Copied!
109
0
0

Testo completo

(1)

Universit´

a di Pisa

Dipartimento di Ingegneria Civile e

Industriale

Tesi di Laurea Magistrale in Ingegneria Chimica

Integrating a dynamic process

simulator with optimization

algorithms and advanced

control

Relatore: Candidato:

Prof. Ing. Gabriele Pannocchia Edoardo Tofi

Controrelatore:

Prof. Ing. Claudio Scali

(2)

Abstract

This thesis was carried out in the Chemical Process Control Laboratory (CPCLab) within the Department of Civil and Industrial Engineering and concerns the fields of rigorous process simulation and advanced control. The goal of this thesis is to integrate a simulated process with a model-based advanced controller in order to find the economical optimum.

The process chosen for the simulation is cumene production, in particular the plug flow reactor and the associated separation system, including benzene recirculation. The objective of the control system is to reduce losses of row materials and finite product without excessive energy consumption.

The process is rigorously simulated in UniSim Design, identified as a state-space model and controlled by a model predictive controller in Python with open-source codes recently developed in CPCLab.

In a first phase a steady-state simulation was performed. In this phase only equilibrium points are considered i.e. a condition where the system is stable and all partial derivatives of ODEs are zero. In this mode it is possible to evaluate the optimal condition of the steady-state system.

Performing a dynamic simulation allows to tune the distributed control system, that makes possible to keep the process in a stable condition. The tuning of PID was performed by attempts, following the Honeywell guideline. The development of an advanced control system, able to operate over the distributed control system, is the core of this thesis. The background knowledge was applied to the case study to perform the system control. The process is constrained into boundaries partly dictated by external causes, as the market or the catalyst, partly dictated by knowledge of chemical pro-cesses.

The first case study analyzed turned out as marginally stable. For this kind of process the methods suitable for stable system show a poor perfor-mance. The evidences are shown in the mismatch between the model and the process response and in the final connection between MPC code, and the process simulated in UniSim; the last element, in particular, highlights the worsening of conditions following the implementation of further control.

In the end, a simplified stable process was developed in order to check the correctness of the methods. For this simplified process the procedure already applied to the previous case was repeated, but this time the system performance was in line with expectations.

(3)

Contents

1 Introduction 3 1.1 Context . . . 3 1.2 Objectives . . . 3 1.3 Thesis organization . . . 4 2 Background 6 2.1 Simulation of complex processes . . . 6

2.1.1 Steady state and dynamic process simulation . . . 7

2.1.2 Fluid package . . . 7

2.1.3 Reactions . . . 8

2.2 Optimization . . . 10

2.2.1 Finding a local minimum . . . 11

2.2.2 Constrained optimality condition . . . 11

2.3 Control . . . 12

2.3.1 Models . . . 12

2.3.2 Discrete time . . . 14

2.3.3 Hierarchy of control system . . . 15

2.3.4 PID . . . 16

2.3.5 MPC . . . 18

2.4 Identification . . . 22

2.4.1 Preliminary tests . . . 23

2.4.2 Input/output models . . . 24

2.4.3 Subspace identification algorithms . . . 25

3 Case Study: Steady-state modelling and optimization 27 3.1 Process description . . . 27

3.1.1 Reference processes . . . 27

3.1.2 Historical methods . . . 29

3.1.3 Mobil-Badger cumene process . . . 30

3.1.4 MCM-22 kinetics data . . . 32

(4)

3.2.1 Heat exchange in reactor . . . 34

3.3 Steady-state optimization . . . 37

3.3.1 Economy . . . 37

3.3.2 Constraints . . . 39

3.3.3 UniSim optimizing . . . 40

4 Case Study: Dynamic modelling and basic control system 42 4.1 Transition from steady-state to dynamic . . . 42

4.2 Control strategy . . . 45

4.3 Tuning . . . 46

4.3.1 RGA analysis . . . 51

4.3.2 Stationary dynamic mode . . . 51

5 Case Study: Advanced control strategy 53 5.1 Connecting Python with UNISIM . . . 53

5.1.1 System identification . . . 53

5.2 MPC implementation . . . 55

5.2.1 Boundaries . . . 55

5.2.2 Forming subsystems . . . 56

5.2.3 Identification . . . 59

5.2.4 Global system reconstruction . . . 70

5.3 Tuning . . . 70

6 Case Study: Results 77 6.1 UNISIM results . . . 77

6.2 Simplified model . . . 79

6.2.1 Simplified process results . . . 86

6.2.2 Economic result . . . 94 7 Conclusions 98 7.1 Comments . . . 98 7.2 Achievements . . . 99 7.3 Future work . . . 99 Appendices 103 A Python codes 104

(5)

Chapter 1

Introduction

1.1

Context

Model Predictive Control algorithms were born in industrial environment during the 1970s specifically, in the refining sector, to take into account the changes that the oil market was facing during that period. The first two known MPC algorithms are:

• DMC (Cutler and Ramaker, 1979) • IDCOM (Richalet et al., 1978)

Nowadays, most complex plants, especially in refining and chemical indus-tries, use MPC system for the actual benefits associated with a relatively low cost. In middle of the 1990s, many acquisitions and merges occurred and the situation became quite steady with two main competitors (DMC+ and RMPCT) and other technologies, less diffused then the main two (Connois-seur, SMOC, PFC, etc.). An open source, user friendly code, available to perform simulations for academic purposes, has been recently developed in the CPCLab by Vaccari and Pannocchia (2016). For what concerns the rigor-ous simulation, open source programs are not yet reliable and therefore the

chemical process simulator UniSim Design R, marketed by Honeywell, has

been used. Various codes are also available for identification, particularly

in MATLAB R, but it is preferred to use the codes from Armenise (2018)

developed also within CPCLab as a Master Thesis.

1.2

Objectives

This thesis aims to integrate a rigorous dynamic process simulator with a programming language in order to associate an advanced control code with

(6)

simulated (or experimental) data. This integration is carried out in a case study that had the following characteristics:

1. It is complex enough to require the use of a rigorous simulation in order to be solved.

2. At least a material recirculation is involved due the dynamic effects this entails.

3. The unit operations involved have mostly non-linear dynamics.

These motivations are necessary because they outline a system that is less didactic and, instead, closer to reality. Another goal of this thesis is to test the correct functioning of two open source codes recently developed in Python language within the CPCLab and to possibly modify them to better adapt the code to the needs of the process. Accordingly, the two main objectives of this work are:

• To perform an identification of the process as accurate as possible. • To perform a process control algorithm with a model predictive control

in order to optimize the process condition and maximize the economic gain.

1.3

Thesis organization

The introduction sets out the work performed, and explains the motiva-tions that led to its elaboration.

In the first chapter the background of theoretical knowledge, that is fundamental for the understanding and analysis of the process in exam and for the realization on this thesis, is explained.

The main part of this thesis focuses on the case study that has been carried out; the case study matches the objectives previously illustrated, and has been developed through different stages illustrated in the chapters.

(a) The third chapter illustrates the outline of a Steady-state model and the search for the optimum at stationary (RTO).

(b) The fourth chapter describes the further development of a Dynamic model and of an appropriate basic control system.

(7)

(c) In the fifth chapter there is the addition of an advanced control system, connected to the process, and of its tuning, in order to obtain a good compromise between response speed and system stability. (d) The sixth chapter illustrates with accuracy the results achieved, and

the further improvements that are necessary in order to obtain a system that can be controlled up to the best economic advantage/gain within the boundaries imposed.

(8)

Chapter 2

Background

In this chapter we will recall the basic knowledge necessary for the production and understanding of the results obtained. In particular, the following will be dealt with: simulation, optimization, control and identification of complex systems.

2.1

Simulation of complex processes

A process can be considered complex when many different unit operations are involved and these are highly interconnected and integrated. In order to understand the process each unit operation needs to be understood from a qualitative and quantitative point of view and also the effect of intercon-nections must be taken in account. This can be achieved only by means of modern process simulators; they evaluate the operating conditions of unit operation arranged in a Process Flow Diagram (PFD) and interconnection between material and energy streams. Process simulators are complex com-putational programs that must solve a large numbers of linear and non-linear equations, often relying on iterative methods. In dynamic mode, process sim-ulators usually integrate Ordinary Differential Equations (ODEs). UniSim Design offers a high degree of flexibility and a consistent and logical approach to how these capabilities are delivered, this makes it a versatile process simu-lation tool. The usability of UniSim Design can be attributed to the following four key aspects of its design:

• Event Driven operation: The information is processed as it is sup-plied and calculations are performed automatically (interactive simu-lation) with instantaneous access to information.

(9)

Non-Sequential solution algorithm, the results of any calculations are automatically produced throughout the flowsheet. The modular struc-ture of the operations means they can be calculated in either direction. Process understanding is gained at every steps.

• Multi-flowsheet Architecture: Multi-flowsheet architecture can be used to create any number of flowsheets within a simulation and to easily associate a fluid package with a defined group of unit operations. • Object Oriented Design: The separation of interface elements from the underlying engineering code means the same information appears simultaneously in a variety of locations. Each display is tied to the same process variables, so if the information changes, the executed change is automatically updated in every location. When a variable is specified, then it is shown as a specification in every location.

2.1.1

Steady state and dynamic process simulation

Initially process simulation was used to simulate steady state processes. Steady-state models perform a mass and energy balance of a stationary pro-cess. Dynamic simulation is an extension of steady-state process simulation whereby time-dependence is built into the models via derivative terms i.e. accumulation of mass and energy. Dynamic simulations require increased calculation time and are mathematically more complex than a steady state simulation. The systems are typically described by ordinary differential equa-tions. The numerical simulation is done by stepping through a time interval and calculating the integral of the derivatives by approximating the area under the derivative curves. It is important to note that in the dynam-ics simulations, unlike steady state simulations, the term accumulation is present.

2.1.2

Fluid package

The fluid package is the thermodynamic method it will be used to calculate streams properties. It is important to appropriately select the fluid package for correct simulation results. For oil, gas and petrochemical applications, the Peng-Robinson Equation of State is the recommended property package. This model is ideal for vapor–liquid equilibrium calculations and calculating liquid density for hydrocarbon system. Several enhancements to the original Peng-Robinson model were made to extend its range of applicability and to improve its predictions for some non-ideal system. However, in situations

(10)

where highly non-ideal systems are encountered the use of Activity Models is recommended. In (2.1),(2.2) and (2.3) are shown the equations of state for Peng-Robinson fluid package used in the case study.

   p = R T V − b − a V (V + b) + b (V − b) Z3− (1 − B) Z2+ (A − 2B − 3B2) Z − (A B − B2− B3) = 0 (2.1) Where:                            b =PN i xibi bi = 0.077796 RTci pci a =PN i PN j xixj(aiaj) 0.5 (1 − kij) A = a p (R T )2 B = b p R T H − HIG RT = Z − 1 + 1 21.5b R T  a − T da dt  ln V + (2 0.5+ 1) b V + (20.5+ 1) b  (2.2) S − SIG R = ln (Z − B) − ln p p0 − A 21.5b R T  T a da dt  ln V + (2 0.5+ 1) b V + (20.5+ 1) b  (2.3)

2.1.3

Reactions

The stoichiometry of all the components in the reactions is defined as:

N

X

i=1

νiCi = 0 (2.4)

where ν is negative for reactants and positive for products. The reactions can be modelled according to one of the following criteria, it is up to the operator to find the most suitable model. In the case study, the heterogeneous catalytic reactions model has been used.

Conversion reactions

The conversion of the j-th species is specified by an empirical expression:

(11)

The molar flow for the i-th species is then:

Fi = Fi0−

νi

νj

Fj0Xj (2.6)

if limiting reactants are present, the actual conversion can be less than Xj,

to ensure that Fi ≥ 0 for all species.

Equilibrium reactions

Equilibrium reactions requires the stoichiometry of all the reactions. The terms ln (K) may be calculated using one of several different methods. The conversion is computed in order to satisfy:

K =

N

Y

i=1

[BASE]νiie (2.7)

where [BASE]ie can be the equilibrium concentration, partial pressure, mole

fraction, etc. of the i-th species. ln (K) can be computed from Gibbs free energy: ln (K) = −∆G 0(T ) RT (2.8) or empirically: ln (K) = A + B T + C ln(T ) + D T + E T 2 + F T3 + G T4+ H T5 (2.9) Kinetic reactions

Kinetic reactions requires the stoichiometry of all the component in the re-actions, as well as the activation energy and frequency factor for forward and reverse reactions. The forward and reverse orders of reactions for each component can be specified.

The kinetic expression is reported in (2.10).

r = k f (BASE1, BASE2, ...) − k0f0(BASE1, BASE2, ...) (2.10)

Generalized Arrhenius expression:          k = A exp  − E RT  Tβ k0 = A0 exp  − E 0 RT  Tβ0

• Simple reaction: It is like a kinetic reaction, with elementary kinetics, component orders are derived from the stoichiometric coefficients; only forward and reverse Arrhenius parameters must be specified.

(12)

• Heterogeneous catalytic reaction: It is provided to describe the kinetics of reactions occurring over solid catalysts; the reaction rate has the following general expression:

r = k Q i[BASE] νi i − k 0 Q j[BASE] νj j  1 +P k n Kk Q g[BASE] γk,g g on (2.11)

2.2

Optimization

Numerical optimization is a branch of science which has wide applications in many different fields. The three elements of an optimization problem are:

• Objective function (f : Rn → R): Which represents a quantitative

scalar measure that has to be minimized or maximized.

• Variables or unknowns (x ∈ Rn): Which allow the description of the

system and of the objective function.

• Constraints (c : Rn

→ Rm): Which represent (m) restrictions on the

variables.

The identification of such elements is called modelling and it is non unique due to the subjectivity of this phase.

The optimization problem

The optimization problem is usually posed as a function, generally non-linear,has to be minimized. In case the function has to be maximized it will be sufficient to maximize its opposite. The optimization problem is subject to equality constraints associated to constitutive equation of the unit oper-ation involved. It is also subject to inequality constraints mainly associated to production specifications. min x∈Rnf (x) (2.12) subject to: ( ci(x) = 0 ∀i ∈ E ci(x) ≥ 0 ∀i ∈ I

where E , I are sets of indices of equality and inequality constraints, respec-tively.

(13)

2.2.1

Finding a local minimum

The definition of local minimum is: A point x? ∈ Rn is a local minimum if

there exists a neighbourhood N of x? such that f (x?) ≤ (x) for all x ∈ N .

General strategy

Starting from an initial point x0, optimization algorithms generate a sequence

of iterates {xk}k≥0, and terminate when no further progress is possible or

it seems that the current iterate is a good enough approximation of the

solution. In deciding how to move from xk to xk+1, numerical algorithms use

information about f at the current iterate and often at previous iterates.

2.2.2

Constrained optimality condition

In constrained optimization problems, it is convenient to use the Lagrangian function, which is defined as:

L(x, λ) = f (x) − X

i∈E∪I

λici(x) (2.13)

Where λ are the Lagrange multipliers, and c the constrain that can be of equal or of inequality.

Karush-Kuhn-Tucler optimality conditions

If x? is a local solution to the standard problem, there exists a vector λ? ∈ Rm

such that the conditions shown in equation 2.14 hold.

∇xL(x?, λ?) = ∇f (x?) − ∇c(x?)T λ? = 0 ci(x?) = 0 ∀i ∈ E ci(x?) ≥ 0 ∀i ∈ I λ? ≥ 0 ∀i ∈ I λ?c i(x?) = 0 ∀i ∈ I ∪ E (2.14)

The components of λ? are called Lagrange multipliers. A multiplier has a

value of zero when the corresponding constraint is inactive. For i ∈ E , the

condition λ?c

i(x) = 0 is always satisfied by any feasible x.

Nonlinear programming via SQP algorithms

Nonlinear programming problems can be solved by means of Sequential Quadratic Programming (SQP) algorithms, which are very effective, meaning

(14)

that a global solution can be found only for convex problems. UniSim Design contains a general purpose SQP optimizer. One can use the optimizer to find the operating conditions which minimize (or maximize) an objective function subject to constraints. Sequential Quadratic Programming approach at iter-ation k is shown in equiter-ation 2.15.

minpk 1 2 p T k Wkpk+ ∇f (xk)T pk subject to: ∇c(xk)T pk+ ci(xk) = 0 ∀i ∈ E ∇c(xk)T pk+ ci(xk) ≥ 0 ∀i ∈ I (2.15)

Where Wk is an approximation of the divergence of the gradient of the

Laplace function, and pk is the step, at the iteration k. The fundamental

steps of the iterative procedure are:

1. Given a feasible xk, we evaluate its active set A (xk) made of equality

and inequality constrains which have reached the boundaries. 2. Then the (2.15) is performed.

(a) if ||pk|| ≤ ρ and all λ ≥ 0, stop the iteration.

(b) if a multiplier λi ≤ 0 for i ∈ A (xk) ∩ I removes the i-th constraint

from the active set

(c) if ||pk|| ≥ ρ, define xk+1 = xk+ αkpkwhere αk is the largest scalar

in (0, 1] such no inequality constraint is violated. When a blocking

constraint is found, it is included in the new active set A (xk+1)

where ρ = f (xk) − f (xk+ pk)

mk(0) − mk(pk)

; where m(·) is a model function which ap-proximates f (·)

2.3

Control

2.3.1

Models

Process control problems arise from the fact that processes operate in dy-namic conditions due to presence of perturbations or changes in operating conditions. For this reason the interest in dynamic models is born. They are tools that allow to analyze in a quantitative way the evolution of the process over time: dynamic models. The model is a representation of the process in mathematical terms, i.e. it provides the relationships between the main

(15)

variables involved. In the input-output models the representation is limited to the relationships between variables of input and output; in the models with state variables, in addition to the output variables, they appear also internal process variables and this allows a more complete description of the process.

Transfer function

The generic continuous-time domain model for a SISO input-output linear model is: ar dry dtr+ar−1 dr−1y dtr−1+ s+a1 dy dt+y = bq dqu dtq +bq−1 dq−1u dtq−1 + s+b1 du dt+b0u (2.16)

It can be transformed by the Laplace equation in the transfer function in the domain s. g(s) = y(s) u(s) = bqsq+ bq−1sq−1+ s + b1s + b0 arsr+ ar−1sr−1+ s + a1s + 1 = N (s) D(s) (2.17)

The solutions of D(s) = 0 are called poles, the system is stable if the real parts of all poles are negative, because negative values correspond to decaying terms, and positive parts to growth terms.

Linear time-invariant state-space model

The generic Linear time-invariant state-space model is shown in (2.18).      ˙x(t) = A x(t) + B u(t) y(t) = C x(t) + D u(t) x(0) = x0 (2.18) where:               

x ∈ Rn : States; they give an indication of the state of the system.

y ∈ Rp : Outputs; the major variable we have to control (CV)

u ∈ Rp : Inputs; intended both as manipulated variables (MV) and as disturbances

A ∈ Rn×n, B ∈ Rn×m, C ∈ Rp×n

The feed through matrix D ∈ Rp×m is often zero in physical/chemical systems

We can univocally pass from the representation in state space to the transfer function in the Laplace domain; in order to perform the transformation the steps are as shown in equations 2.19 and 2.20. The final form is reported in equation 2.21.

(16)

( ˙x(s) = A x(s) + B u(s) y(s) = C x(s) ( s x(s) = A x(s) + B u(s) y(s) = C x(s) (2.19) ( (s I − A) x(s) = B u(s) y(s) = C x(s) ( x(s) = (s I − A)−1B u(s) y(s) = C (s I − A)−1B u(s) (2.20) G(s) = C (s I − A)−1B = C adj(s I − A) B det(s I − A) = N (s) D(s) (2.21)

The stability of a control system is often extremely important; in the engineering of a system the study of models is important to achieve this purpose. The stability of a system relates to its response to inputs or dis-turbances. A system can be considered stable when it remains in a constant state, unless affected by an external action, and returns to the same state when the external disturbance is removed; in other words it can be consid-ered stable when every bounded input produces a bounded output. Starting from equation 2.22 we can then arrive at the consideration that the poles are the eigenvalues of A, the stability in the s domain is verified if the equation 2.23 is respected.

D(s) = 0 =⇒ det(s I − A) = 0 (2.22)

λi(A) < 0 (2.23)

2.3.2

Discrete time

To transform the state space model from continuous to discrete time it is necessary to integrate it between two successive sampling times as shown in equation 2.24. ( ˙x = f (x, u) y = h(x, u) ( xk+1 = F (xk, uk) yk= h(xk, uk) ( xk+1 = ˜A xk+ ˜B uk yk= C xk (2.24) where: ( ˜A = exp(A t S) xk ˜ B =RtS 0 exp(A (tS− τ )) B dτ uk

The condition of stability of the system in discrete time is therefore reported in equation 2.25. λi(A) < 0 =⇒ λi( ˜A) < 1 (2.25)

(17)

Supply chain optimization: plan-ning and scheduling (1-7 days)

Real Time Optimization (1-2 hr )

Advanced control systems: MPCs (30-120 s)

Distributed Control System: PID controls (10-100 ms)

Actuators and Sensors (continuous)

Figure 2.1: Hierarchy of control system and frequency of action.

2.3.3

Hierarchy of control system

The control hierarchy can be schematized as shown in the Figure 2.1. In the following the individual elements will be explained, in particular distributed control in section 2.3.4 and advanced control in section 2.3.5.

Supply chain optimization: planning and scheduling

The highest level of the process control hierarchy is concerned with planning and scheduling operations for the entire plant. For continuous processes, the production rates of all products and intermediates must be planned and coordinated on the basis of equipment constraints, storage capacity, sales projections, and the operation of other plants, sometimes on a global scale. Thus, planning and scheduling activities pose difficult optimization problems that concern both engineering considerations and business projections. Real Time Optimization

The optimum operating conditions for a plant are determined as part of the process design. But during plant operations, the optimum conditions can

(18)

change frequently due to changes in equipment availability, environment and economic conditions. Consequently, it can be very profitable to recalculate the optimum operating conditions on a regular basis. The new optimum conditions are then implemented as set points for controlled variables. Advanced control systems: MPCs

Many difficult process control problems have two distinguishing characteris-tics:

• significant interactions occur among key process variables. • constraints exist for manipulated and controlled variables.

The constraints reflect equipment limits and the operating objectives for the process. The ability to operate a process close to a limiting constraint is an important objective for advanced process control. For many industrial cesses, the optimum operating condition occurs at a constraint limit, but pro-cess disturbance could force the controlled variable beyond the limit. Thus, the set points should be set conservatively, based on the ability of the control system to reduce the effects of disturbances.

Distributed Control System: PID controls

In order to perform a successful process operation, a necessary requirement is to operate the key process variables such as flow rates, temperatures and pressures at, or close to, their set points. This activity, which represents regulatory control, is achieved by applying standard feedback control tech-niques.

Actuators and Sensors

Measurement devices and actuation equipment are used to measure process variables and implement the calculated control actions. These devices are interfaced with the control system.

2.3.4

PID

PID is an acronym for proportional, integral, and derivative. The PID con-troller is widely used in feedback control of industrial processes. A PID controller calculates repeatedly an error value e(t) that corresponds to the difference between a desired set-point (SP) and a measured process variable (PV) and applies a correction based on proportional, integral, and derivative

(19)

Figure 2.2: Feedback control system

terms, from which the controller name derives. In applying PID controllers, engineers must design the control system on which they are going to execute the analysis: that is, they must first decide which action mode to choose and then adjust the parameters of the controller so that their control problems are solved appropriately. The PID controller was first placed on the market in 1939 and has remained the most widely used controller in process control until today (Araki, 2009). The basic structure of conventional feedback con-trol systems is shown in Figure 2.2.

The three elements of the PID controller produce outputs with the following nature:

P proportional to the error at the instant t, which is the present error. I proportional to the integral of the error up to the instant t, which can

be interpreted as the accumulation of the past error.

D proportional to the derivative of the error at the instant t, which can be interpreted as the prediction of the future error.

A discrete time representation is equation 2.26.

uk = uk−1+ Kcek+ KcTS τI k X j=0 ej+ KcτD TS (ek− ek−1) (2.26)

where: Kc, τI and τD are respectively the positive tuning parameters of the

proportional, the integral and the derivative element.

The use of only the proportional element would lead to responses affected by offsets that are, instead, eliminated with the introduction of the integra-tive element. The derivaintegra-tive element increases the response speed but can amplify the noise and is therefore not used in some cases.

(20)

2.3.5

MPC

Model Predictive Control (MPC) algorithms were born in industrial envi-ronments (mostly refining companies) just over forty years ago. Their de-velopment was necessary in order to satisfy the more stringent production request. The most common requirements are economic optimization, maxi-mum exploitation of production capacities, minimaxi-mum variability in product qualities or a combination of these. Nowadays, most complex plants espe-cially in refining and chemical industries use MPC systems. The reasons why it is convenient to use an MPC instead of conventional feedback controllers, is because conventional feedback controllers are not able to face:

• Interactions from each manipulated variable to all controlled vari-ables.

• Directionality: Certain combinations of control actions have a much larger effect on the controlled variables than other combinations of the same control actions. Perturbation in the former directions are rejected much more easily than perturbation in the latter directions.

• Constraints on the controlled variables like products qualities. • Optimization of the overall plant.

Structure of MPC algorithms

The structure of MPC algorithms is shown in Figure 2.3. The nominal model is the one based on (2.18) i.e. based only on the model matrices A,B and C. An MPC based on the nominal model does not compensate for plant/-model mismatches and persistent disturbances, therefore one should plant/-model and estimate the disturbance to be rejected for offset-free control, making it necessary to integrate it with a model of the disturbance. The augmented system structure is reported in equations 2.27 and 2.28.

 x d + = A Bd 0 I   x d  + B 0  u +  w Wd  (2.27) y = C Cd  x d  + v (2.28)

The observability of the augmented system requests A Bd

0 I



, C Cd

 

(21)

Dynamic Optimization Process Steady-state Optimization Estimator uk yk dk|k xk|k xs,k us,k Qss, Rss Q, S

(22)

is typical chosen as equal to the output number, so nd = p. Bd and Cd are

choosen to make the augmented system observable.

Furthermore another parameter must be defined, the matrix L = Lx

Ld

 , such equation 2.29 is strictly Hurwitz.

 A Bd 0 I  − A Bd 0 I   Lx Ld   C Cd   (2.29) The augmented estimator takes the structure shown in equation 2.30 .

 ˆ xk|k ˆ dk|k  =  ˆ xk|k−1 ˆ dk|k−1   Lx Ld   yk− C Cd   ˆ xk|k−1 ˆ dk|k−1  (2.30) Disturbance Models

In order to determine this augmented system it is necessary to establish the matrices associated with the disturbance model. The two most used at the industrial level are the following:

• Output disturbance model

Bd= 0 Cd = I Lx = 0 Ld = I

Typical industrial design for stable systems. Any error is assumed to be caused by a step, constant, disturbance acting on the output. In

fact the filtered disturbance estimated is: ˆdk|k = yk− C ˆxk|k−1

• Input disturbance model

Bd= B Cd = 0 Lx = 0 Ld= I

Input disturbances affect the plant outputs in a more complex way as they pass through the plant model dynamics, this makes it adequate also for not too stable systems, but requires m ≤ p.

Steady-state optimization module

the steady-state optimization module solves the linear system shown in (2.31). (

xs= Axs+ Bus+ Bddˆk|k

ys = Cxs+ Cddˆk|k

(23)

The steady-state target (xs, us, ys) may change at each sampling time

be-cause of the disturbance estimated. Controlled and manipulated variables have constraints to meet, the steady-state optimizer must find a solution in the field where constrains are satisfied. Constrains are called hard, if they cannot be violated; soft if they can be violated when necessary, of an epsilon, which must be minimized in the objective function. In the quadratic formu-lation, used in this project, the objective function has the structure shown in equation 2.32 under the condition shown in equation 2.33.

min us,xs,s,ys ||s||2Ws + ||ys− yt|| 2 Qs + ||us− ut|| 2 Rs (2.32)      xs = Axs+ Bus+ Bddˆk|k ymin− s≤ ys≤ ymax+ s umin ≤ uk ≤ umax (2.33)

Where yt are the desired CV set-points, ut the MV set-points and ||x||2Q =

xTQx.

Dynamic optimization module

The dynamic optimization module allows to make a finite horizon prediction of future CVs evolution based on a sequence of MVs, to find the optimal MVs sequence, to minimize a cost function that comprises the deviation of variables from their targets and the rate of change of MVs. Also in the mod-ule there are constraints; always on MVs, possible on CVs. The objective function to be minimized is shown in equation 2.34, under the conditions in equation 2.35. In Figure 2.4, is shown graphically the meaning of sam-pling time, control horizon and prediction horizon. The samsam-pling time is the time between two different iterations, the control horizon in the number of sampling time in which the algorithms evaluated the input to provide to the system, the prediction horizon is the number of sampling time in which the algorithms evaluated the predicted output.

min u, N −1 X j=0 ||ˆyi− ys,k||2Q+ ||ui− us,k||2R+ ||ui− us,k||2S+ ||i||2W+||xN−xs,k||2P (2.34)

(24)

Figure 2.4: Control horizon and prediction horizon                          xi+1= Axi+ Bui+ Bddˆk|k x0 = ˆxk|k ˆ yi = Cxi+ Cddˆk|k ys,k = Cxs,k+ Cddˆk|k umin ≤ ui ≤ umax

−∆umin ≤ ui ≤ ∆umax

ymin − i ≤ ˆyi ≤ ymax+ i

(2.35)

The matrices Q, R S, W and P are weight matrices. Often only one between R and S is used; a smoothed response can be obtained with the S one. Only the first element of the optimal control sequence is injected into the plant, and the successor state is predicted using the estimator model, equation 2.36.

( ˆ xk+1|k = Aˆxk|k+ Buk+ Bddˆk|k ˆ dk+1|k = ˆdk|k (2.36)

2.4

Identification

System identification (Ljung, 1998) is concerned with the determination of a dynamic model of the considered process given experimental data; this means using Identification algorithms to build a mathematical model of dynamical systems from measured data. The loop that needs to be followed in order to achieve a good system identification is shown in Figure 2.5.

(25)

Figure 2.5: The system identification loop

2.4.1

Preliminary tests

Identification data is generally collected during specific campaigns, Perform-ing simulations on the model avoids the need to limit the duration of the tests, and allows us to quickly restart the simulation if the collected data are not informative. The following lists of variables are compiled:

• MV: manipulated variables

• CV: controlled variables (measurable) • DV: disturbance variables (measurable)

Prior knowledge and preliminary test are used to decide the amplitude and duration of each MV variation.

Limitations of step test

Identification signals must have a sufficiently high power spectrum in mid and low frequency range, step signals have limited frequency content and do not excite the plant significantly, so other types of inputs must be built:

1. Generalized Binary Noise (GBN) signals are very effective (Zhu, 2001),

(26)

probability. The signal obeys:

(

P [uk = −uk−1] = psw

P [uk = uk−1] = 1 − psw

2. PseudoRandom Binary Sequence (PRBS) is constructed with an ar-bitrary seed polynomial. This seed polynomial can be any non-zero

polynomial in the Galois Field (2n) where n is the degree of the PRBS

polynomial and n cannot have a value equal to zero. The result is similar to GBN but periodic.

2.4.2

Input/output models

The general formulation of input/output models is shown in equation 2.37.

A(z) yk = F (z)−1B(z) uk+ D(z)−1C(z) ek (2.37)

• FIR: Finite Impulse Response, is the easiest one to implement and has only the B(z) parameters. The FIR relation is shown in 2.38

yk = B(z) uk+ ek (2.38)

• ARX: AutoRegressive eXogenous model, is the second model for sim-plicity and has only the A(z) and B(z) parameters. The ARX relation is shown in 2.39

A(z) yk = B(z) uk+ ek (2.39)

• ARMAX: AutoRegressive Moving Average with eXternal inputs, has also a noise description provided by C(z) parameters. The ARMAX relation is shown in 2.40

A(z) yk = B(z) uk+ C(z) ek (2.40)

• OE: Output-Error, considers that the noise has a similar structure to the output. The OE relation is shown in 2.41

yk= F (z)−1B(z) uk+ ek (2.41)

• BJ: The Box-Jenkins relation is shown in 2.42

(27)

2.4.3

Subspace identification algorithms

Multivariable input/output systems identification requires prior knowledge or trial-and-error to determine the system order. Input/output systems identifi-cation is always MISO, whereas in some cases it would be desirable to directly identify MIMO models. Identification of advanced multivariable models (e.g., ARMAX, OE, etc.) requires solution of large nonconvex nonlinear program-ming problems.

The principal features of this models are:

• The possibility to perform a direct identification of an LTI state-space model.

• It is applicable to both MIMO and MISO approaches.

• The multivariable state-space representation is more compact.

• Very little prior knowledge is required, only an upper bound to the order to avoid unnecessary computation.

• It is based on reliable linear algebra decompositions. Innovation and predictor forms

Innovation form 2.43 and predictor form 2.44 are the ones that are used. ( xk+1 = A xk+ B uk+ K ek yk= C xk+ ek (2.43) ( xk+1 = AK xk+ B uk+ K yk yk = C xk+ ek (2.44) where: AK = A − K C

The main assumptions made are: • (A, B) controllable.

• (A, C) observable.

• AK = A − K C strictly Hurwitz.

• The innovation {ek} is a stationary, zero mean, white noise process.

(28)

Derivation

Y = Γrx + HruU + H

e

r E (2.45)

where Γr is the extended observability matrix; Hru and Hre are block lower

triangular matrices. After the derivation the model must be validated, Ad-vanced Identification methods provide an estimate on the maximum error of the model. If the model is deemed not suitable, typical attempts are:

• Changing model orders in input/output models or the maximum order. • Improving scaling of input and output variables.

If it still does not work it is possible to proceed by collecting new data, choosing different identification signals with better frequency content.

(29)

Chapter 3

Case Study: Steady-state

modelling and optimization

3.1

Process description

3.1.1

Reference processes

The case study development starts with the one reported in the chapter nine by Luyben (2012). He developed the economically optimum design of cumene process considering capital, energy and raw material costs and developed a plantwide control structure capable of effectively handling large disturbances in production rate. The chemistry of the cumene process features the desired reaction of benzene with propylene to form cumene shown in (3.1) and the undesirable reaction of cumene with propylene to form p-diisopropyl benzene (PDIB) shown in (3.2). Both reactions are irreversible.

C6H6+ C3H6 → C9H12 (3.1)

C9H12 + C3H6 → C12H18 (3.2)

Since the second one has a higher activation energy than the first, as shown in paragraph 3.1.4, low reactor temperatures improve selectivity of cumene. However, low reactor temperatures result in a lower conversion rate of propy-lene for a given reactor size. In addition, selectivity can be improved by using an excess of benzene to keep cumene and propylene concentrations low, at the expense of increasing separation costs.

The costs of raw materials and products are much larger than the costs of energy or capital in this process as shown in Figure 3.7. Therefore, the process must be designed so as not to waste feedstocks or lose products.

(30)

Figure 3.1: Turton et al. (2008) design flowsheet

The process is presented in the design book by Turton et al. (2008) and consists of a cooled tubular reactor and two distillation columns shown in fig-ure 3.1. The fresh liquid feeds and the benzene recycle stream are vaporized, preheated, and fed into the vapor-phase reactor, which is cooled by gener-ating steam. Reactor effluent is cooled and fed to the first column, which produces a distillate stream of benzene that is recycled back to the reactor. The second column separates the desired cumene product from the unde-sired p-diisopropyl benzene. The fresh propylene feed stream contains some propane impurity, which is inert in the reactor and must have a place to get out of the process. Since the separation between propylene and propane is difficult, the economics strongly favour designing the reactor for a very high conversion rate of propylene. The propane and any unreacted propylene are flashed off and burned, so they only have fuel value. High propylene conver-sion can be achieved by running at high temperatures but this increases the production of undesirable by-product.

(31)

Table 3.1: Kinetic constants obtained for hypothetical cumene catalysts from Tur-ton et al. (2008)

Catalyst Current New

Reaction rate mol

liter s

Reaction 1 (3.1) r1 = k1cpcb r1 = k1cpcb

Reaction 2 (3.2) r2 = k1cpcc r2 = k2cpcc

Rate constant liter

molar s Reaction 1 (3.1) k1 =3500 exp( −6680 T ) k1 =2.8 · 10 7 exp(−12.530 T ) Reaction 2 (3.2) k2 =290 exp( −6680 T ) k2 =2.32 · 10 9 exp(−17.650 T )

T has the units K, liters refers to liters of reactor.

The kinetic data issue

The kinetic data used in the processes reported so far come from an educa-tional exercise and therefore do not have an experimental basis is shown in Table 3.1. For the development of the process, more realistic and reliable data will be searched.

3.1.2

Historical methods

Before 1992, virtually all cumene was produced by propylene alkylation of benzene using either solid phosphoric acid (SPA) or aluminum chloride as cat-alysts. The SPA process, currently licensed by UOP, was developed in the 1940’s primarily to produce cumene for aviation fuels. More than 40 SPA plants have been licensed worldwide. The SPA catalyst consists of a complex mixture of orthosiliconphosphate, pyrosiliconphosphate, and polyphosphoric acid supported on kieselguhr. To maintain the desired level of activity, small amounts of water are continuously fed into the reactor. The water continually

liberates H3PO4 causing some downstream corrosion. SPA process conditions

include pressures that range from 30 to 41 bar, temperatures that range

from 180 to 230◦C, (benzene/propylene) ratio from 5 to 7, and WHSVs

(M assF low/CatalystM ass) that are between 1 and 10. Approximately 4–5 wt.% of the product consists of di- and tri-isopropylbenzenes. A schematic description of the SPA process was shown in the early 1980s, Monsanto intro-duced an AlCl3 process based on the same chemistry used in the ethylben-zene process. This process can be operated at lower (benethylben-zene/propylene)

(32)

Table 3.2: Commercial zeolite-based cumene units from Degnan Jr. et al. (2001)

Process Year first

announced

No. of com-mercial units

Licensed capacity

( million metric ton per year)

Mobil-Badger 1993 7 3125

UOP Q-Max 1995 4 625

CDTech CDCumene 1995 2 440

Enichem 1995 1 265

Down Chemical 3-DDM 1992 1a 410

a Zeolite catalyst is used in the transalkylation unit only.

ratio than the SPA process because AlCl3 can transalkylate the polyalky-lated benzenes back to cumene. The process also operates at temperatures lower than the SPA process because the more highly acidic anhydrous AlCl3 tends to produce significantly more undesired n-propylbenzene at equivalent temperatures. This technology is currently used in five plants as reported by Degnan Jr. et al. (2001). In more recent years, cumene producers have begun to convert to the more environmentally friendly and more efficient zeolite-based processes. The most common ones are the processes licensed by Dow, CDTech, Mobil–Badger, Enichem and UOP. The zeolite-based processes pro-duce higher cumene yields than the conventional SPA process because most of the diisopropylbenzene (DIPB) byproduct is converted to cumene in sepa-rate transalkylation processes. Operating and maintenance costs are reduced because there is no corrosion associated with the zeolite catalysts. Finally, environmental concerns associated with the disposal of substantial amounts of phosphoric acid load diatomaceous earth or AlCl3 are eliminated by the use of zeolites because they are regenerable and can be safely disposed of through digestion or landfilling. Table 3.2 summarizes the manufacturing volume of each of the licensed zeolite process technologies for cumene man-ufacture.

3.1.3

Mobil-Badger cumene process

First commercialized at Georgia Gulf, Pasadena, TX plant in 1994, the Mo-bil–Badger Cumene process consists of a fixed-bed alkylator, a fixed-bed transalkylator and a separation section shown in Figure 3.2. Fresh and re-cycled benzene are combined with liquid propylene in the alkylation reactor where the propylene is completely reacted. Recycled polyisopropylbenzenes (PIPB) are mixed with benzene and sent to the transalkylation unit to

(33)
(34)

Table 3.3: Product properties from Mobil–Raytheon cumene process provide by Degnan Jr. et al. (2001) Other zeolites MCM-22 Cumene (wt%) 99.90 99.95-99.97 Ethylbenzene (ppm) 200 25 n-Propylbenzene (ppm) 20 15 Bromine index (ppm) 50 <5

duce additional cumene. Trace impurities are removed in the depropanizer column. Byproduct streams consist of LPG (mainly propane contained in the propylene feedstock) and a small residue stream, which can be used as fuel oil. The Mobil–Badger process produces very pure cumene, 99.97 wt.% at 99.7 wt.% yield as report in Table 3.3. The amout of ethylbenzenem propylben-zene and butylbenpropylben-zene produced are significantly lower than those obtained with the SPA catalyzed process. The high cumene purity is primarily at-tributable to the high monoalkylation selectivity of the MCM-22 catalyst. This catalyst is unique in its ability to minimize propylene oligomerization while still exhibiting very high activity for benzene alkylation. Commercially, the catalyst has demonstrated cycle lengths in excess of 2 years. Ultimate catalyst life is in excess of 5 years. The Mobil–Badger process is used for approximately 50% of the worldwide cumene capacity. The selectivity of the MCM-22 catalyst reduces the size requirements for the fractionation section, and also reduces the coke forming reactions, which tend to shorten the cycle length. A key result of the catalyst’s low oligomerization selectivity is the ability to design for low benzene/propylene ratios.

3.1.4

MCM-22 kinetics data

Benzene alkylation with propene has been carried out under liquid-phase reaction conditions over zeolites MCM-22, Beta, and ZSM-5 in the Corma et al. (2000) study. the physical properties of the zeolite catalyst are

re-ported in Table 3.4. MCM-22 seems to be a good catalyst for benzene

alkylation especially with propene, showing high activity and stability and good selectivity. Kinetic experiments show that alkylation with propene fol-lows an Eley–Rideal type mechanism. The kinetics data are developed by

Dimian and Bildea (2008). The examination of patents reveals that the

operative conditions for the alkylation of benzene with propylene are

tem-peratures between 150 and 230 ◦C and pressures between 25 and 35

(35)

Table 3.4: Physical properties of a zeolite catalyst

Surface area (m2/g) 500-800 Particle size Extrudates 1.6-2.4 x 4-10 mm

Particle porosity 0.5 Void fraction 0.35-0.4

Particle density (kg/m3) 1000 Tortuosity 5

(basedonthereactionmixture) at (benzene/propylene) molar ratios ranging from 5 to 8. The source for the kinetic data is a paper published by Corma et al. (2000) dealing with MCM - 22 and beta - zeolites. The alkylation takes place in a down flow liquid phase microreactor charged with catalyst diluted with carborundum.

For the first reaction, alkylation, the kinetic constant is (3.3).

k1 = 6510 exp

 −52564 R T



(3.3) For the second reaction, polialkylation, the kinetic constant is (3.4).

k1 = 450 exp  −55000 R T  (3.4) where R is 8.314 J mol K.

3.2

Steady-state simulation

The basis for the construction of the model is the stady state model proposed by Dimian and Bildea (2008) and show in Figure 3.3. The PFD structure developed in UniSim is show in Figure 3.5. The major differences between this process and the one developed in this thesis are the following:

1. The reactor is equipped with a cooling system into the shell, hence it is not adiabatic. Controlling the reactor temperature, allows to approach the isothermal reactor which guarantees an higher selectivity than the adiabatic reactor as shown in Table 3.5.

2. Inter-coolers are removed; E-2 is not necessary for the different struc-ture of the reactor and the duty of E-3 is carried out by the second condenser

3. The third column works at atmospheric pressure instead of being in vac-uum conditions. It is possible to obtain the separation between cumene and DIPB at atmospheric pressure; work vacuum, though, leads to oth-ers operative problems, which are preferable to avoid.

(36)

Figure 3.3: Alkylation section from Dimian and Bildea (2008).

Table 3.5: Comparison between adiabatic reactor and isothermal reactor through UniSim simulation.

Temperature Conversion Selectivity

Adiabatic Outlet temperature 230 ◦C 100% 96.14%

Isothermal Fixed 161 ◦C 100% 97.83%

4. The recycled benzene is collected and equalized in a storage tank before being reintroduced in the system. Collecting the recycling stream and mixing it with the fresh Benzene feed allows for more homogeneous conditions in the feeding reactor stream.

3.2.1

Heat exchange in reactor

The reactor structure is shown in Figure 3.4. In order to keep the temperature close to the minimum boundary, a cooling system is required. In the tube side, the stream is modelled as a light organic. The space velocity is low, as required from the data kinetic development, but on the other side catalyst particle increase the turbulence. Water in the shell, is near to be stationary. Heat transfer is increased by air and steam bubbled into water surrounding coil. For a system with water in both side, Green and Perry (2008) suggest an

(37)

Figure 3.4: Reactor structure and temperature control system (Turton et al., 2008)

Overall Heat-Transfer Coefficients in the range between 150 and 300 h ftBtu2◦F.

The bundle structure consists of 8000 tube, with an internal diameter of 2, a thickness of 0.3 millimetres and a length of 6 meters, that is 3467 square meters. It is important to have a good exchange in the reactor to allow the refrigerant fluid to control temperature. In the simulation the UA coefficient

(38)

Figure

3.5:

UniSim

Steady-state

(39)

Table 3.6: Market chemical prices in February 2007.

Cumene Benzene Propylene

1102 941 1015 $/ton

Table 3.7: The cost of utilities reported in Capcost.

Condition Cost ($/GJ)

Low Pressure Steam 5 barg, 160◦C 13.28

Medium Pressure Steam 10 barg, 184◦C 14.19

Medium High Pressure Steam 20 barg, 212◦C 15.85

High Pressure Steam 41 barg, 254◦C 17.70

Electricity 110V-440V 16.80

Cooling water 30◦C to 45◦C 0.354

3.3

Steady-state optimization

This section will highlight the sources of reagent and product prices. The general constraints on the process will also be reported. Finally, the opti-mization operation conducted with UniSim will be explained.

3.3.1

Economy

The value of chemicals are taken by www.intratec.us (2017). The historical data are available in the time span from January 2007 to October 2009. The countries where prices are monitored are not completely homogeneous:

• Cumene: Netherlands, United States and Japan.

• Benzene: Netherlands, United States, Brazil, China and Thailand. • Propylene, chemical grade ( 92-96%) : Germany, United States, Brazil

and China.

The reference price chosen comes from the Netherlands and Germany for

their own membership to the EU.They are shown in Figure 3.6. For the

steady state optimization the data used are shown in Table 3.6. Utilities costs are taken by Stoffa (2013) and shown in Table 3.7.

(40)

Figure 3.6: Price history for cumene, benzene and propylene in the period from 01/2007 to 12/2009, expressed in dollars per ton.

(41)

Table 3.8: Constraints on the reactor due to kinetic data.

Minimum Maximum

Temperature 150◦C 230◦C

Pressure 25 bar 35 bar

WHSV 1 h−1 10 h−1

benzene/propylene molar ratios 5 8

3.3.2

Constraints

The reactor range of operability is given by the experimental kinetic bound-aries 3.8. The market boundbound-aries are about the outlet cumene condition. Its purity must be over 99.9% and its flow around 100 kgmol/h, which is the equivalent of 101 Kton/y. It is estimated that about 12,400.4 KT of cumene was consumed globally in 2012 (www.micromarketmonitor.com, 2017) corre-sponding to the 0.81% of the global market.

The separation section conditions have been developed observing the follow-ing criteria:

• The gas residual in liquid flow should not create any problems in the pumping system. The amount of gas present in the outlet section from the first column should not exceed 1 mol%.

• Cumene in the recirculation stream not only increases its flow rate, but also promotes the unwanted reaction. The amount of cumene present in the recycled stream from the second column should not exceed 1 mol%.

• Benzene in the second column bottom flow can exit the system only as impurity on the output cumene flow. Considering the maximum global allowed impurity is the 0.1 mol%, benzene is fixed at 0.05 mol%. The utilities considered are:

1. Low Pressure Steam can heat streams up to 150 ◦C; it is used only in

preheating exchanger.

2. Medium High Pressure Steam can heat streams up to 202◦C; it is used

for the first and third column reboilers.

3. High Pressure Steam can heat streams up to 234◦C; it is used second

(42)

Table 3.9: In this Table are reported the constrains, the start and the final

recom-mended condition due to the optimizer. Where x0= Temperature of gases leaving

the system. x1= Molar fraction of gases in liquid bottom flow of first column. x2=

Molar fraction of cumene in benzene recycled flow. x3= Molar fraction of benzene

in bottom flow of second column. x4= Molar recovery of cumene in third column.

Variables Start point Minimum Maximum Optimum Unit

x0 50 50 80 60.66 ◦C

x1 0.5 0.01 1 1 mol%

x2 0.5 0.01 1 0.088 mol%

x3 0.03 0.01 0.05 0.05 mol%

x4 0.960 0.930 0.999 0.998 mol%

4. All condensers use cooling water.

3.3.3

UniSim optimizing

The function to maximize is the (3.5):

(cumene) ∗ (cumene price) − Σ (reagent) ∗ (reagent price)

−Σ (utility) ∗ (utility price) (3.5)

The conditions moved by the optimizer (QuasiNewton) are reported in table 3.9. The economic gain in the start condition is 87.38 $/h, moved by opti-mizer to 578.94 $/h. The important variations set by the optiopti-mizer are the temperature on the fist condenser, the amount of recycled cumene and most effective recovery of the third column.

In Figure 3.7 the costs that mostly affect the production of cumene are shown. As expected most of the costs are due to the reagents, they are responsible for 94%, and cooling costs are negligible compared to heating costs.

(43)
(44)

Chapter 4

Case Study: Dynamic

modelling and basic control

system

4.1

Transition from steady-state to dynamic

A dynamic simulation does consider the effects of time. It assumes that the plant is in a state of change. The flows in the pipelines are not specified by the user but calculated on the basis of the pressure gradient. A tool offered by UniSim, UniSim Design Dynamic Assistant, assisted us in the transition from the steady-state to the dynamic state. The tool provides the user with six warnings in order to perform an effective transition:

1. Enable stream pressure specification: In order to allow the system to calculate automatically the internal stream pressure.

2. Append new valves and streams: Not only external stream must be specified, but there is also the need to separate it from the internal one by a valve. All valves are set with a pressure flow relation.

3. Enable internal stream flow specification:The reflux flow rates in the columns are made specific, so as to control the condition inside the column by the management of these values.

4. Miscellaneous specification changes: The mixer automatic pressure as-signment is set as ”Equalize all”.

5. Unit operation not supported in dynamics: ”Adjust” components are removed and replaced with PID controller. The ”recycle” component is no longer necessary, since the flow can be connected directly.

(45)

6. Tray section pressure profile need attention: The steady state pressure profile of the second column tray section may not be consistent with the rating data used in dynamic mode, so the tray section previously made with the tool ”Tray Sizing” is replaced with the one recommended for the dynamic mode.

Furthermore the virtual stream of purge in the recycling line is removed; that stream is virtual because its flow is forced to zero by an adjust compo-nent, but its presence allows the convergence of the system. The dynamic PFD is reported in Figure 4.1.

(46)

Figure 4.1: The global system on UniSim after tr ansition from steady-state to dynamic.

(47)

4.2

Control strategy

The control strategy leverages the different characteristic time of the ad-vanced control and distributed control system. The last one has a shorter characteristic time and has the role of keeping the system in stable condi-tions, allowing the advanced control system to move bewteen different sys-tems, without compromising the stability. The control operates on a total of twenty valves in the system which can be splitted in the three groups described below:

1. Base control: there are seven control loops that ensure the stability of the system and there are seven control loops which ensure constant levels in vessels:

(a) FICC3: controls the molar flow rate of the limiting reagent. It is a very important control because a small change in this flow causes significant temperature and composition variations throughout the plant.

(b) FICREA: controls the mass flow rate across the main stream.

(c) TICREA: controls the reactor maximum temperature. At a

lower temperature the conversion rate is unacceptable and it also compromises the stability. The system, in fact, is more stable at higher temperatures, with the downside of an increase in by-product formation. This control is also fundamental to avoid run-away.

(d) TICREAIN: controls the inlet temperature in the reactor, it is very sensitive to the pressure swings in the system, its proper operation affects the whole system considerably.

(e) PICCOL1: controls the first condenser pressure handling the gas purge valve.

(f) PICCOL2: controls the second condenser pressure handling the cooling flux associated.

(g) PICCOL3: controls the third condenser pressure handling the cooling flux associated.

(h) benzene storage: the refill is controlled by the immission of fresh and cold benzene.

(i) Condenser level COL1: the level is controlled by the internal reflux in the column.

(48)

(j) Reboiler level COL3: the amount of the bottom output is so small that it cannot be used to control the liquid level, therefore it is preferable to use the energy stream instead.

(k) Other: All other level controls refer to the delivery valve. The tuning of these valves will be described in the paragraph 4.3. 2. Quality: there are six manipulated variables available for advanced

control:

(a) Reboiler utility COL1 located in the first column, has to re-move gases from the system.

(b) Reboiler utility COL2 located in the second column, has to remove benzene from the third column inlet stream.

(c) FIC-C12 Set point located in the third column, has to remove heavy by-product from the process.

(d) Utility water flow: For an increase of the amount of water that flows in the condenser of the first column, we witness to a decrease of the temperature in the column head, that approaches the temperature of the utility water. More head product is cooled and more steam is required in the bottom reboiler on the other hand sub-cooling the gas output stream is the only way to reduce benzene lost.

(e) Reflux COL2, increases the efficiency of the second distillation column and the utilities consumed.

(f) Reflux COL3, increases the efficiency of the third distillation column and the utilities consumed.

4.3

Tuning

The appropriate values for the proportional and integral mode tuning coef-ficients for a PI controller must reflect the behavior of the process and the desired performance from the control loop. The two main objectives are stability and speed of response. The instructions for a better tuning come from UniSim Design Dynamic Modelling Guide (Honeywell, 2017b). In the

guide, for each class of control minimum and maximum KC and τI are

pro-vided. Various configurations were tested until a well controlled system was

obtained. The results are reported in Table 4.1. The response of the

(49)

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 hours 106 107 108 109 110 111 112 113 114 kgmole/h PV SP (a) FIC-C3 0.2 0.4 0.6 0.8 1.0 1.2 1.4 hours 40800 41000 41200 41400 41600 kg/h PV SP (b) FIC-C6 0 2 4 6 8 10 12 14 hours 164.0 164.5 165.0 165.5 166.0 166.5 167.0 Celsius PV SP (c) TIC-REA 0 2 4 6 8 10 12 14 hours 149.00 149.25 149.50 149.75 150.00 150.25 150.50 150.75 151.00 Celsius PV SP (d) TIC-REA-IN

(50)

1.2 1.4 1.6 1.8 2.0 2.2 2.4 hours 1.925 1.930 1.935 1.940 kgmole/h PV SP (a) FIC-C12 0 10 20 30 40 50 60 hours 10.94 10.96 10.98 11.00 11.02 11.04 11.06 bar PV SP (b) PIC-COL-1 0 20 40 60 80 hours 1.96 1.98 2.00 2.02 2.04 bar PV SP (c) PIC-COL-2 40 50 60 70 80 hours 1.08 1.09 1.10 1.11 1.12 bar PV SP (d) PIC-COL-3

(51)

Table 4.1: Final tuning used to control the system.

Control name KC τI(min) Set Point PV range

FIC-C3 0.4 0.25 110 kgmol/h 150 kgmol/h

FIC-C6 0.4 0.25 41170 kg/h 40000 kg/h

TIC-REA 1 5 165.5 ◦ C 100 ◦ C

TIC-REA-IN 1 12 150 ◦C 100 ◦ C

FIC-C12 0.4 0.25 1.933 kgmol/h 10 kgmol/h

PIC-COL1 1.5 8 11 bar 10 bar

PIC-COL2 0.5 1.5 6.4 bar 6.66 bar

PIC-COL3 6 4 1.1 bar 3.33 bar

LICs-COL3 0.3 50 50% 100%

Other LICs 0.25 100 50% 100%

flow indicators and controllers requires a little time to reach the set points; it is also noted that FIC-C3 and FIC-C6 influence each other. The temperature indicators and controllers requires a longer time than FICs to reach the set points; temperature in the pre-heater and in the reactor is strongly associ-ated to the reagents flows. It can be noticed the more complex dynamic in the reactor than in the pre-heater. The pressure indicators and controllers requires a long time to reach the set points. The pressure of the first column, controlled by the output gas stream has an a aggressive control, to take care of the high influence of reactor condition in this column. The final structure is visible in Figure 4.4.

(52)

Figure 4.4: The global system on UniSim after tun ing the base con trollers.

(53)

Table 4.2: Input and output for RGA analysis.

u0 Actuator position of valve on C3 line y0 C3 flow-rate

u1 Actuator position of valve on C6 line y1 C6 flow-rate

u2 Cold utility to reactor y2 Reactor peak temperature

u3 pre-heater duty y3 Reactor inlet temperature

u4 Actuator position of valve on gas line y4 First column pressure

u5 second condenser duty y5 Second column pressure

u6 third condenser duty y6 Third column pressure

4.3.1

RGA analysis

Relative gain array (RGA) analysis has been widely used in process control to identify promising control structures and to characterize the degree of process interactions between controlled and manipulated variables (Chen and Seborg, 2002). This was done in the last phase as a verification of the correct coupling.

• The system has been identified in open-loop; inputs and outputs are shown in Table 4.2. The identification was carried out with the Ar-menise (2018) code supplying the inputs as PRBS in analogy to what will be explained in paragraph 5.2.3. Identification results are A, B and C which characterize the system.

• The gain of the process was obtained as Gain = C (I − A)−1B.

• The RGA shown in Figure 4.5 is obtained as RGA = Gain⊗(Gain−1)T.

The best match is the one that has the closest value to +1. Since the RGA represents the relation between each element in open-loop versus closed-loop, a value equal to 1 means that the presence of other closed-loops doesn’t change the result; if the value is > 1 it means that due to interactions, we have a reduction in gain, while, when being < 1 and > 0 we have an increase in gain. Last, a value < 0 means that the interactions are so high they alter the sign of the gain. The values on the diagonal comply with this criterion and are therefore used in the control system. It is interesting to note how the two parallel valves located at the input of the mixing have a considerable mutual influence.

4.3.2

Stationary dynamic mode

At first the dynamic state system is instable, therefore there is the need to perform the following steps in order to reach a good stationary point and

(54)

Figure 4.5: Relative gain between input and output, the chosen coupling is the diagonal.

Table 4.3: First tuning used to stabilize the system.

Control name KC τI (min) Set Point PV range

FIC-C3 0.4 6 110 kgmole/h 150 kgmole/h

FIC-C6 0.6 6 41170 kg/h 40000 kg/h

TIC-REA 0.8 8 165.5 ◦C 100 ◦C

TIC-REA-IN 0.8 1.3 150 ◦C 100 ◦C

PIC-COL1 5 6 11 bar 10 bar

PIC-COL2 3 4 2 bar 6.66 bar

PIC-COL3 15 4 1.1 bar 3.33 bar

optimize the dynamic system.

1. Stabilize: The manipulated variables are adjusted until a new time invariant condition is reached.

2. Centering: In order to monitor and control effectively the system all outputs and inputs valves are replaced by ones having an Open Percentage of 50% in the same operative conditions.

3. Optimize: The outputs are moved near to the optimum stationary value, found in Chapter 3.

These three operations are iterated until the system is too hard to be stabi-lized. The controller has PI structure. For the tuning of the controllers, at first we proceeded by attempts. The first values used are available in Table 4.3.

(55)

Chapter 5

Case Study: Advanced control

strategy

5.1

Connecting Python with UNISIM

As already anticipated in the introduction, the process examined is simulated in UniSim Design, and controlled by a model predictive controller in Python with open-source codes recently developed in CPCLab. The codes used to connect UniSim Design and Python are shown in the appendix. The base for the writing of the code was UniSim Design Customization Guide made by Honeywell (2017a). The guide is built to associate a Visual Basic code with UniSim, so the comtypes.client module is used to make them compatible. In order to connect UniSim and Python there are some steps that need to be performed. In particular, the data must be reported in spreadsheet within UniSim, to be then collected by Python. The data are collected by columns, therefore we must pay attention to the construction of spreadsheets within UniSim. The UniSim file must be placed in the same folder as the code. In Figure 5.1 is show the spreadsheet used in UniSim. The Python codes reads and acts on this spreadsheet. All the variables are imported from the UniSim PFD. In column B, from row 2, to row 10 are imported the manipulable variables which can be changed by Python code; in column E, from row 2, to row 10 are imported the controlled variable which can be read by Python code.

5.1.1

System identification

For the system identification the code developed by Armenise (2018) was used. The methods available are input/output models or subspace identifi-cation algorithms. The input/output models need a knowledge a priori of

Riferimenti

Documenti correlati

The estimation accuracy has been eval- uated on both synthetic and real data showing that the simulated images can be used to effectively train the proposed models.For future work

D413 - in the C-linker – and in position R297 – in the intracellular portion of S5 – are cross-linked (Fig.  2 ), mutant channels R297C_D413C channels are locked in the open

provvedono a che, nell’applicare gli strumenti ed esercitare i poteri di risoluzione, tali autorità prendano tutte le misure atte a garantire che l’azione di risoluzione sia avviata

condizionale ?in sia tutt’oggi utilizzato nell’arabo scritto e, se sì, in quale contesto, da che tipo di utente e con quali frequenza e valore. Ciò che presentiamo in questo

[113] Tao, J., Zhu, Y., and Fan, Q., “Improved state space model predictive control design for linear systems with partial actuator failure,” Ind. D., “Fault-Tolerant Economic

To investigate our ef ficacy in distinguishing an afterglow from unrelated X-ray sources (i.e., our ability to assign afterglows rank 1 or 2 ), we performed a simulation of

Several studies ( Bergamin et al., 2003; Romano et al., 2009; Albanese et al., 2010 ) have been carried out to evaluate the type, degree and extent of pollution by heavy

Optical coherence tomography angiography and vessel density map showed a reduction in the superficial capillary plexus (B,D); (G,I), coupled to an increase in the deep capillary