<<

Modeling and Intelligent Control of a Column

Joao˜ Rodrigo Camelo Barroso

Dissertac¸ao˜ para obtenc¸ao˜ do Grau de Mestre em Engenharia Mecanicaˆ

J ´uri Presidente: Prof. Joao˜ Rogerio´ Caldas Pinto Orientador: Prof. Jose´ Alberto de Jesus Borges Co-Orientador: Profa Carla Isabel Costa Pinheiro Vogal: Prof. Joao˜ Miguel Alves da Silva

Outubro - 2009

Este trabalho reflecte as ideias dos seus autores que, eventualmente, poderao˜ nao˜ coincidir com as do Instituto Superior Tecnico.´

Abstract

The aim of the present work is to develop models and design controllers for an experimental pilot- scale process. Distillation columns are highly complex systems characterized by nonlinear dynamics, multiple equi- librium points and operational modes, therefore require suitable modeling techniques.These models are used to design controllers that are suitable for reference tracking, Fault Detection and Isolation and Fault Tolerant Control. The objective of such controllers is to enhance productivity throughout the distillation process. Two main types of black box models are derived: Linear State-Space Models and Nonlinear Models, namely Fuzzy Models, Composite Local Linear Models and Artificial Neural Networks. All these models will be estimated and compared using both experimental and simulated data, with the last being provided by a First Principles Model. The resulting models can be used to predict system outputs, therefore are suitable for integration into optimal control schemes, such as Model Based Predictive Control. The optimization problem in the nonlinear controller case is addressed using either Branch and Bound and a composition of multiple local linear optimal solutions. These controllers are then compared with respect to tracking error and computational load. The integration of fault tolerant control allows reducing the impact of abrupt faults in the control vari- ables. The system is normally operating in nominal conditions and if a known fault occurs the controller is modified in order to accommodate this new state.

Keywords: Continuous Distillation Process, Nonlinear Modeling, Nonlinear Model Based Predictive Control, Fault Detection and Isolation, Fault Tolerant Control

v vi Resumo

O objectivo deste trabalho e´ desenvolver modelos e projectar controladores para um processo cont´ınuo de destilac¸ao˜ a` escala piloto. As colunas de destilac¸ao˜ sao˜ sistemas altamente complexos caracterizados por dinamicasˆ nao-˜ lineares, multiplos´ pontos de equil´ıbrio e modos operacionais, exigindo assim tecnicas´ de modelac¸ao˜ adequadas. Estes modelos sao˜ utilizados para projectar controladores para o seguimento de re- ferenciasˆ e detecc¸ao,˜ isolamento e controlo tolerante a falhas. O objectivo e´ aumentar a produtividade no processo de destilac¸ao.˜ Sao˜ desenvolvidos dois tipos de modelos: modelos lineares em espac¸o de estados e modelos nao-˜ lineares, nomeadamente Modelos Fuzzy, Composic¸ao˜ de Modelos Locais Lineares e Redes Neuronais Artificiais. Todos estes modelos sao˜ estimados e comparados com dados experimentais e de simulac¸ao,˜ sendo estes ultimos´ obtidos a partir de um modelo de primeiros princ´ıpios. Os modelos resultantes podem ser usados para prever as sa´ıdas futuras do sistema, logo sao˜ adequados para integrac¸ao˜ em esquemas de controlo optimo,´ nomeadamente Controlo Preditivo. As abordagens para a resoluc¸ao˜ do problema de optimizac¸ao˜ nos casos em que se utilizam modelos nao-˜ lineares sao:˜ Branch and Bound e composic¸ao˜ de soluc¸oes˜ lineares locais optimas.´ Estes controladores sao˜ comparados utilizando o erro de seguimento e o esforc¸o computacional. A integrac¸ao˜ do controlo tolerante a falhas permite reduzir o impacto destas nas variaveis´ de controlo e deste modo aumentar a produtividade no processo de destilac¸ao.˜ O processo funciona normalmente em condic¸oes˜ nominais e quando uma falha conhecida ocorrer o controlador e´ alterado de forma a lidar com este novo estado.

Palavras chave: Processo de Destilac¸ao˜ Cont´ınuo, Modelac¸ao˜ Nao-Linear˜ , Controlador Preditivo Baseado em Modelo Nao-Linear,˜ Detecc¸ao˜ e Isolamento de Falhas, Controlo Tolerante a Falhas

vii viii Acknowledgments

My first words of appreciation are undoubtedly to my supervisors Professor Jose´ Borges and Pro- fessor Carla Pinheiro. I would like to thank them for their invaluable support and patience, and for the advice and orientation provided throughout this work. I also want to thank Prof. Joao˜ Miguel Silva, Prof. Ana Pires and Taniaˆ Pinto for their help regarding the distillation column and its experimental tests. My colleagues also deserve a special acknowledgment due to all the advice, support and information they provided, through all the course and specially in these last intensive months. I’d also like to thank my family for being there in the hardest times, when I needed them most. Finally, I would like to thank the financial support granted by the project POCI/EME/59522/2004 Fault-Tolerant control based on multi-agents systems from Fundac¸ao˜ para a Cienciaˆ e Tecnologia.

ix x Contents

Abstract v

Resumo vii

Contents xi

List of Figures xv

List of Tables xix

Notation xxi

1 Introduction 1 1.1 Distillationanditsbackground...... 1 1.2 Motivation...... 2 1.3 Stateoftheart ...... 3 1.3.1 Black-BoxModels ...... 3 1.3.2 Control ...... 4 1.4 Contributionofthiswork ...... 4 1.5 Outlineofthiswork...... 5

2 Description of the computer aided tools 7 2.1 Introduction to Nonlinear Systems ...... 7 2.2 FuzzySystems...... 8 2.2.1 Fuzzy Inference Systems ...... 8 2.2.2 DynamicFuzzySystems ...... 10 2.2.3 FuzzyClustering ...... 11 2.3 Composite Local Linear Models ...... 11 2.4 ArtificialNeuralNetworks ...... 12 2.4.1 ArtificialNeuron ...... 12 2.4.2 Neural Network Architecture ...... 13 2.4.3 Learning ...... 13 2.5 ModelPredictiveControl...... 14

xi 2.6 NonlinearPredictiveControl...... 15 2.6.1 Branch-and-Bound...... 16 2.7 FaultTolerantControl ...... 17 2.7.1 Disturbances ...... 17 2.7.2 Classificationoffaults ...... 17 2.8 PerformanceCriteria...... 18

3 Distillation Columns 19 3.1 Introduction...... 19 3.2 Columnsinternals ...... 19 3.3 Vapor-Liquid-Equilibrium (VLE) ...... 20 3.4 ColumnDesign...... 21 3.4.1 McCabe-ThieleMethod ...... 22 3.4.2 FenskeEquation ...... 23 3.5 Properties of the experimental distillation column ...... 23

4 Distillation Column Modeling 25 4.1 FirstPrinciplesModel ...... 25 4.2 Input/Output data preprocessing ...... 27 4.2.1 Persistencyofexcitation ...... 27 4.2.2 Normalizationofvariables ...... 28 4.3 Linearmodels...... 29 4.3.1 Linear models based in simulated data ...... 30 4.3.2 Linear models based in real data ...... 31 4.4 Nonlinear models based in simulated data ...... 32 4.4.1 FuzzyModels...... 32 4.4.2 Composite Local Linear Models ...... 35 4.4.3 ArtificialNeuralNetworks ...... 39 4.5 Nonlinear Models based in real data ...... 41 4.5.1 FuzzyModels...... 41 4.5.2 Composite Local Linear Models ...... 43 4.6 Discussionofresults ...... 45

5 Model Based Control 51 5.1 Problem description and assumptions ...... 51 5.2 MPCbasedinlinearmodel ...... 53 5.3 NMPCwithB&B ...... 55 5.3.1 B&BusingFMmodels...... 56 5.3.2 B&BusingCLLMmodels ...... 58 5.3.3 Time comparison between models used by B&B ...... 60

xii 5.4 NMPC with a composition of MPC’s ...... 60 5.5 Discussionofresults ...... 64 5.5.1 Computationaltime ...... 66

6 Fault Tolerant Control 69 6.1 Problemdescription ...... 69 6.1.1 FaultDetection ...... 70 6.1.2 FaultIdentification ...... 70 6.1.3 Control Reconfiguration Mechanism ...... 71 6.2 Results ...... 72

6.2.1 Tuning of Model Based Controller in case of Tebul ...... 73

6.2.2 Tuning of Model Based Controller in case of Tvap ...... 74

7 Conclusions 75 7.1 Modeling ...... 75 7.2 Control ...... 75 7.3 Fault Identification and Control ...... 76 7.4 Futurework...... 76

Bibliography 77

Appendix 81

A Fuzzy models Properties 83 A.1 Modelbasedinsimulations ...... 83 A.2 Modelbasedinrealdata...... 85

B Modifications implemented to the Branch and Bound MPC scheme 87 B.1 IntegrationinSimulink ...... 87

xiii xiv List of Figures

1.1 used to distillate beverages ...... 1

2.1 Fuzzy Inference System block diagram ...... 9 2.2 ArtificialNeuralNetwork ...... 12 2.3 ArtificialNeuron ...... 13 2.4 RecurrentNeuralNetwork...... 14 2.5 BasicschemeforaMPC...... 14 2.6 Theoretical response of a MPC to a step in the reference ...... 15 2.7 Discretizationofcontrolinputs ...... 16 2.8 SupervisionloopofFTC...... 17 2.9 Graphical representation of Settling Time ...... 18

3.1 Typical simple distillation column ...... 20 3.2 Schematic of a typical sieve tray of a distillation column ...... 20 3.3 Equilibrium curves for various binary mixtures ...... 21 3.4 Equilibrium curves for different relative volatilities...... 22 3.5 McCabe-Thielediagram ...... 22 3.6 Pilot scale distillation column at ISEL ...... 24

4.1 Schematic diagram of the pilot scale distillation column ...... 27 4.2 Variables with different time samples for the inputs ...... 28 4.3 Estimated outputs of the linear model based in simulated data, for noise Ite. 3 ...... 31 4.4 Estimated outputs of the linear model based in real data, for exp. of March 24th ...... 32 4.5 Estimated outputs of the FM model based in simulated data, for a simul. of Mar. 31th . . 34 4.6 Estimated outputs of the FM model to a step in Fv ...... 34 4.7 Estimated outputs of the FM model based in simulated data, for exp.of March 24th . . . . 35 4.8 Estimated outputs of the FM model based in simulated data, for exp.of March 31th . . . . 35 4.9 Boundaries of divided reflux range ...... 36 4.10 Radial basis function of CLLM model based in simulated data...... 37 4.11 Poles placements in the complex plane for the CLLM model based in simulated data . . . 37 4.12 Estimated outputs of the CLLM model based in simulated data, to a step in Fv ...... 38 4.13 Estimated outputs of the FM model to Mar. 24 experiment ...... 38

xv 4.14 Different NARX architectures ...... 39 4.15 Estimated outputs from the ANN model to simulations ...... 41 4.16 Estimated outputs of the FM model based in real data, for noiseofIte.3 ...... 42 4.17 Estimated outputs of the FM model based in real data, for exp. of March 31th ...... 43 4.18 Estimated outputs of the CLLM model based in real data to the simulation of March 17th . 44 4.19 Estimated outputs of the CLLM model based in real data to March 24th experiment . . . . 44 4.20 Comparison between VAF values for models applied to simulations...... 45 4.21 Comparison between MSE values for models applied to simulations ...... 45 4.22 Comparison between VAF values for models applied to real experiments ...... 46 4.23 Comparison between MSE values for models applied to real experiments ...... 46 4.24 Overlayed estimated outputs from the simulation based models to simulations ...... 47 4.25 Overlayed estimated outputs from the simulation based models to real experiments . . . . 49 4.26 Simulation of the effect of the change in the feed composition in both temperatures . . . . 49 4.27 Overlayed estimated outputs from the real data based models to real experiments . . . . 50

5.1 Reference used to test the controllers ...... 52 5.2 Control by MPC without restricted control actions ...... 53 5.3 Control by MPC with restricted control actions ...... 54 5.4 Control by MPC with restricted control actions and different horizons ...... 55 5.5 Control by B&B with FM model and unrestricted control actions...... 56 5.6 Number of branches opened by B&B when using FM models with restricted control actions 57 5.7 Control by B&B with FM model and restricted control actions ...... 57 5.8 Number of branches opened by B&B when using FM models with restricted control actions 58 5.9 Control by B&B with CLLM model and unrestricted control actions ...... 59 5.10 Control by B&B with CLLM model and restricted control actions...... 59 5.11 Number of branches opened by B&B when using CLLM models ...... 59 5.12 Control loop for MPC based in CLLM theory ...... 61 5.13 Control by a composition of MPC’s with unrestricted controlactions...... 61 5.14 Scheduling vector for unrestricted CMPC ...... 62 5.15 Control by a composition of MPC’s and restricted controlactions ...... 62 5.16 Scheduling vector for restricted CMPC ...... 63 5.17 Control by CMPC with restricted control actions and different horizons ...... 63 5.18 VAF values for the constrained controllers ...... 65 5.19 MSE values for the constrained controllers ...... 65 st 5.20 1 TS5% fortheconstrainedcontrollers ...... 65 nd 5.21 2 TS5% fortheconstrainedcontrollers ...... 66 5.22 Details in the comparison of controllers ...... 66 5.23 Computational time for the constrained controllers ...... 66

6.1 Reference and response of the system without any failure ...... 69

xvi 6.2 Error between the model and the system outputs ...... 70 6.3 Changesincontrolloop ...... 71 6.4 Control action of Fv inthecaseofafaultlesssystem...... 72 6.5 Failurecasewithafaultycontroller ...... 72 6.6 Response of the system to a faulty controller ...... 72

6.7 Fault control focused in Tebul ...... 74

6.8 Fault control focused in Tebul ...... 74

A.1 Membership functions of FM model based in simulations for Tebul ...... 84

A.2 Membership functions of FM model based in simulations for Tvap ...... 84

A.3 Membership functions of FM model based in real data for Tebul ...... 86

A.4 Membership functions of FM model based in real data for Tvap ...... 86

B.1 Schematic representation of the original program ...... 88 B.2 Schematic representation of a discrete Level-1 M-file S-Function ...... 88 B.3 Schematic representation of the computing of the block output ...... 89

xvii xviii List of Tables

1.1 Inputs in a 5 5 distillationcolumn ...... 3 ×

3.1 Main characteristics of the real column ...... 24

4.1 Processvariables...... 27 4.2 Samples times for each input in the simulated distillationcolumn...... 28 4.3 Limitsofinputsvariables...... 28 4.4 Properties of the best linear model model based in simulateddata ...... 30 4.5 MSE values for the linear model based in simulated data ...... 30 4.6 VAF values for the linear model based in simulated data ...... 30 4.7 Properties of the best linear model model based in real data...... 31 4.8 MSE values for the linear model based in simulated data ...... 31 4.9 VAF values for the linear model based in simulated data ...... 32 4.10 Properties of the best FM model based in simulated data ...... 33 4.11 MSE values for the FM model based in simulated data ...... 33 4.12 VAF values for the FM model based in simulated data ...... 33 4.13 Properties of the best CLLM model ...... 36 4.14 MSE values for the CLLM model based in simulated data ...... 37 4.15 VAF values for the CLLM model based in simulated data ...... 38 4.16 Characteristics of the training for the best ANN model ...... 40 4.17 MSE values for the ANN model based in simulated data ...... 40 4.18 VAF values for the ANN model based in simulated data ...... 40 4.19 Properties of the best FM model ...... 41 4.20 MSE values for the FM model based in real data ...... 42 4.21 VAF values for the FM model based in real data ...... 42 4.22 Properties of the best CLLM model ...... 43 4.23 MSE values for the CLLM model based in real data ...... 43 4.24 VAF values for the CLLM model based in real data ...... 44

5.1 Parameters chosen for MPC/NMPC ...... 52 5.2 Characteristics of the PC used in all control schemes ...... 53 5.3 Alternative control and predictive horizons ...... 54

xix 5.4 Performance values for linear MPC ...... 55 5.5 Performance values for B&B with FM model ...... 58 5.6 Performance values for B&B with CLLM model ...... 60 5.7 Performance values for CMPC ...... 64 5.8 Profile summary for B&B with FM and CLLM models ...... 67

6.1 LimitsusedinAlgorithm6.1...... 73 6.2 WeightsinNMPCcostfunction ...... 73

A.1 Tebul consequent parameters of equation 2.6 for FM model based in simulation ...... 83

A.2 Tvap consequent parameters of equation 2.6 for FM model based in simulation ...... 83

A.3 Tebul consequent parameters of equation 2.6 for FM model based in real data ...... 85

A.4 Tvap consequent parameters of equation 2.6 for FM model based in real data ...... 85

xx Notation

The following notation is used throughout this work.

Acronyms

ANN Artificial Neural Networks B&B Branch and Bound CLLM Composite Local Linear Models CMPC Composition of single linear MPC FDI Fault Detection and Isolation FIS Fuzzy Inference System FM Fuzzy Model FTC Fault Tolerant Control MF Membership Function MIMO Multi Output Multi Input MPC Model Predictive Controller MSE Mean Squared Error NARX Nonlinear AutoRegressive network with eXogenous inputs NARX-SP NARX network with Series-Parallel architecture NMPC Nonlinear Model Predictive Controller PI Proportional-Integral controller PID Proportional-Integrative-Derivative controller RBF Radial basis Function SISO Single Input Single Output VAF Variance Accounted For VLE Vapor-Liquid-Equilibrium

xxi List of Symbols

α Weight of error between the reference and the predicted system output in MPC cost function T ebul α Weight of error between the reference and the predicted Tebul in MPC cost function T vap α Weight of error between the reference and the predicted Tvap in MPC cost function β Weight of variation of the control actions in MPC cost function η Plate efficiency ∆e Energy loss ∆u Variation of the control actions B Bottoms flow rate D Distillate flow rate F Feed Rate fR Fraction of maximum power for reboiler’s heaters fReflux Reflux rate Fv Volumetric feed flow rate

Hc Control Horizon

Hp Predictive Horizon J Cost Function of MPC L Reflux flow M Hold up in the plate r Reference

Tebul Liquid temperature in reboiler

TS Settling Time

Tvap Vapor temperature in reboiler u Control Action V Vapor flow x Liquid composition

xB Bottoms Composition

xD Top composition

xF Feed’s composition yˆ Estimated output

yV Vapor composition

Subscripts

F Feed i Tray number i

Nfeed Number of tray were the feed enters the column

Ntotal Final tray r Reflux tray

xxii Chapter 1

Introduction

This chapter introduces the control problem addressed along this work. It begins with an historical overview of distillation, followed by the motivation for such work and the state of the art. Finally, the contributions of the work and its outline are also presented.

1.1 Distillation and its background

Distillation is the most common unit operation in chemical engineering used to separate two or more components from a homogeneous fluid mixture [1, 12, 29], being widely used in chemical and petroleum industries. Since ancient times, man used distillation essentially for enhancing the alcohol content of beverages [10]. The first traces of distillation come from Mesopotamia but it were the Greeks that brought it to Europe. Nevertheless many, more or less primitive, forms of distillation were reported to be used by tribes, in many of the explorations throughout Africa and America [10].

Figure 1.1: Alembic used to distillate beverages

However the first columnar continuous distillation appeared only in the early 19th century by Cellier- Blumenthal in France, with improvements such as reflux and internals, like packing and bubble-cap trays, being added later by others [14]. At the end of the century the first book on fundamentals of

1 distillation was introduced. These developments led to the expansion of distillation to other areas, where the petroleum industry made an important contribution to its development. The basic principle behind this technique relies on the different boiling temperatures for the various components of the mixture, allowing the separation between the vapor from the most volatile component and the liquid of other(s) component(s). In the case of a mixture of alcohol and water, since the boiling point of alcohol is lower than water, the vapor of the first component can be extracted on the top of the column, being later cooled and turned into alcohol, while at the bottom the remaining water can be extracted. The compositions of each final element depend on the characteristics of the column itself, such as its height or type and length of internals, but can also be changed while operating by changing for example the reflux rate or the heat given to the column.

1.2 Motivation

The quality of the products is essential to keep a distillation process profitable, thereby it is important to maintain the compositions in overhead or bottoms at the desired level. This can be achieved by monitoring the response of the column, reading the actual compositions or the temperatures that can be converted in compositions if properly located [31], and acting over the inputs that serve as degrees of freedom. These degrees of freedom are dependent of the assumptions made while operating the column, Lundstrom¨ and Skogestad [16] presents an example of an one-feed two-product distillation column viewed as a 5 5 dynamic system, which means that we can have five measured outputs and five × controllable inputs in the column. Each steady state is optimized using a nonlinear steady-state plant model to minimize a cost function [31]. Usually the minimum operating cost is achieved when the products are controlled at minimum acceptable purities [7]. An effective control of the products composition can improve the energy consumption, increase ca- pacity and responsiveness while improving also the process safety [1, 23]. However distillation columns have many components and a unit operation free of problems does not exist. In Kister [13] it is reported that about 18 percent of columns malfunctioning is due to instrumental and control problems. It is therefore important to resolve such problems by identifying them and adapting the control cycle to face a new problematic situation. This work is intended to develop models that describe the dynamics of a distillation column for sep- aration of a binary mixture of ethanol and water, in order to use them in the project of a controller. The intention of this controller is to drive the column to a given state in order to meet the requirements of the desired compositions. With this model it will also be possible to detect a failure in the system, by monitoring the responses of the model and the real system to a given input. After this detection, the failure can be identified and the controller reconfigured, in order to accommodate this new situation.

2 1.3 State of the art

As said before, distillation process for a binary mixture is seen as a 5 5 problem with five degrees × of freedom. The inputs may vary as can be seen in Table 1.1. However the control with such degrees of freedom is not very common and in fact there is a lack of publications dedicated to this problem [29]. The most common control strategy is a 2 2 control scheme, two-point control, where the compositions, × or some other composition indicator such as temperatures, are monitored. At steady-state it is assumed that pressure is constant and there is a perfect level control in the condenser and reboiler.

Table 1.1: Inputs in a 5 × 5 distillation column

Mahoney and Fruehauf [19]a Skogestad [30]b Lundstrom¨ and Skogestad [16] Feed Reflux Reflux Reflux Boilup Distillate Distillate Distillate Bottoms Heatinput Bottoms Heatdutyinreboiler Bottoms Overheadvapor Heatdutyincondenser

aSince steady state calculations do not take into account the variables for condensate level, bottoms level and pressure, the system will only have two degrees of freedom. bFeed flow is not usually considered as control degree of freedom, not only because it is considered a continuous variable but in a steady-state F = D + B.

1.3.1 Black-Box Models

A survey of empirical models used in the modeling of distillation columns is presented by Abdullah et al. [1]. In some works the use of a Hammerstein-Wiener model is presented. Hammerstein-Wiener models use a combination of a linear system corrected by static nonlinear elements in the inputs and outputs, allowing a flexible parameterization for nonlinear models. These models showed an improvement when compared to the Linear Models but, as pointed out by Zhu [39], due to the fact that nonlinear elements can only model static nonlinearity, much of the nonlinearities of the column are not well estimated. Models based in Artificial Neural Networks have also been tested. A majority of the researchers used a Feed-Forward network, which is more intended to classification problems. However some results were considered satisfactory, as in the cases of Brizuela et al. [6], Singh et al. [27, 28], even though these models showed some difficulties in their validation. A Recurrent Neural Network was presented by Shaw and Doyle [26]. This network had only two dynamic neurons, since it was consider that the number of neurons is an indicator of the order of the system. The results of this network were also not very accurate, but a higher number of neurons in the network was not tested, since the purpose of the network was achieved. A Takagi-Sugeno Fuzzy model is proposed by Mahfouf et al. [18]. This paper shows the improvement

3 in modeling accuracy that a Fuzzy Model delivers when compared to a linear model, when representing the process dynamics over a wide operating range

1.3.2 Control

Several Model Predictive Control approaches for continuous distillation columns were proposed by different authors. Turner et al. [36] showed a MPC based in an ANN and compared with a linear MPC and PI controllers. The results showed that the nonlinear controller approach offered better results when compared to the others, reducing in 50% the standard deviation of the linear controller and 25% off a high gain PI, relatively to the setpoint. Mahfouf et al. [18] also presented a comparison between a linear MPC and a MPC based in a Takagi- Sugeno fuzzy model. This comparison showed the advantages of the MPC based in the fuzzy model when dealing with reference tracking in both SISO and MIMO models.

1.4 Contribution of this work

In this work three different types of nonlinear empirical models for a distillation column are developed:

Fuzzy Models (FM) • Composite Local Linear Models (CLLM) • Artificial Neural Networks (ANN) • The development of such models is based in data obtained from the first principles model derived from the experimental column and from experimental data collected from the plant. The objective is to provide a comparison between the different models in order to validate these approaches, and see if the use of such models is an advantage compared to linear models. Since these models can be used to predict the column’s outputs, a Non-linear Model Based Predictive Control (NMPC) is designed, with Branch and Bound (B&B) methodology to deal with the optimization of such controller. In the case of CLLM, another controller based in a composition of multiple local linear optimal solutions is developed. These controllers are also compared to a linear approach based in the linear model. Finally a Fault Detection and Identification (FDI) and a Fault Tolerant Controller (FTC) is proposed to cope with an actuator failure. These methodologies will detect that one of the inputs does not respond as expected, so use the other inputs as corrective actions.

4 1.5 Outline of this work

The rest of this work is structured as follows: In Chapter 2 an overview of the methodologies used in this work is presented. It begins by explaining the need for nonlinear models and then introduces the three types of black box models used in this work. The next section of the chapter is dedicated to the controller used in this work and it finishes with an introduction to FTC and FDI. Chapter 3 introduces the properties and design of distillation columns and finalizes with a description of the experimental pilot-scale facility used in this work. Chapter 4 presents the development of the model for the case study distillation column. It begins by introducing the first principles model previously developed, used to run several simulations and the preprocessing tasks necessary to get the data sets to be used by the modeling algorithms. In the end, it is presented a discussion of the results obtained for each model in particular, and a general discussion for all models. Chapter 5 illustrates the performance of a linear MPC, which will be compared with various forms of nonlinear NMPC. First a NMPC using B&B to find the best control action using both FM and CLLM models, and then a composition of a single linear MPC (CMPC) for each of the local linear model present in CLLM. The chapter ends with the comparison of these controllers in terms of tracking error and computational load. Chapter 6 starts by defining the fault simulated and how it is going to be detected, identified and handled, by reconfiguring the controller. The results of these steps are presented in the final section. Chapter 7 presents the conclusions and recommendations for future work. In Appendix A the properties of the FM models developed in Chapter 4 are presented. In Appendix B the modifications made in the B&B toolbox are presented.

5 6 Chapter 2

Description of the computer aided tools

This chapter presents a review of the tools used in this work, as well as the improvements proposed in this thesis. It begins by explaining the need for nonlinear models and then introduces the three types of black box models used in this work: FM, ANN and CLLM. The following section of the chapter is concerned to the controller used in this work. The chapter finalizes with an introduction to FTC and FDI.

2.1 Introduction to Nonlinear Systems

Linear systems have been widely used in engineering for modeling and control of dynamical systems. Even in the presence of systems with constraints, which lead to nonlinear behavior, this type of model cab be used locally in a neighborhood of an equilibrium point. A common representation for this type of model is the state-space form:

x(k + 1) = Ax(k) + Bu(k) (2.1)

y(k) = Cx(k) + Du(k) (2.2) where: x(k) Rn is the state vector, ∈ y(k) Rq is the output vector, ∈ u(t) Rp is the input (or control) vector, ∈ dim[A( )] = n n is the state matrix, · × dim[B( )] = n p is the input matrix, · × dim[C( )] = q n is the output matrix · × and dim[D( )] = q p is the feedthrough matrix. · ×

7 The state space formulation is very common, specially in the case of MIMO systems (Multi Input, Multi Output). Another important feature of this formulation is the ability to characterize the system state follow the evolution of system vector x(k+1). The state can be known from the formulation of the system dynamics, but they can also be estimated using a state observer. Nonlinear models came to meet the requirements of this complex behaviors. The combination of multiple local models using a suitable scheduler provides an effective approach to model nonlinear systems [21]. This approach consists of dividing the global nonlinear complex dynamics into a set of small operating regimes for which the dynamics are assumed to be locally linear. The result is a set of multiple models that can be handled using tools adapted from linear systems theory, which are normally based on well known theory that has been applied to several real-life systems. The multiple model approach needs a supervisor, or scheduler, that coordinates the local actions of the model to give the global description. Although multiple model approaches present appealing fea- tures, they also present challenges: the decomposition of the system full range into operating regimes, the selection of a model structure, the estimation of parameters for each local model, the determination of a scheduler for the combination of all local models into a single global model. Fuzzy Models and Composite Local Linear Models are examples of identification frameworks that fit into the multiple model paradigm. Other technique of nonlinear modeling is Neural Networks. They are derived from Soft Computing and simulate human like expertise, therefore adapting themselves to the required situation, this way there is a model-free learning, i.e. a model structure is not necessary.

2.2 Fuzzy Systems

The basic principle of fuzzy theory are Membership Functions (MF) representing linguistic labels. An object can belong to several sets, representing linguistic propositions, with a certain degree. It’s impor- tant to notice that a MF is not a probability density function, and there’s no connection with probability. The MF only quantifies a sentence “degree of truth” and does not quantify a random behavior like in a stochastic process. The most used range of values for a membership function is the interval [0,1], and it’s represented by the characteristic function µ (x) : X 0, 1 : A → { } 1, if x is member of A µA(x) =  0, if x is not member of A  The MF’s can have various forms but they must be convex. Other properties and rules for membership functions can be found in [11].

2.2.1 Fuzzy Inference Systems

Fuzzy Inference System (FIS) is the process of formulating the output of a problem to a given input, using fuzzy logic. The structure of a fuzzy inference system consists of three components: Membership

8 Figure 2.1: Fuzzy Inference System block diagram [11]

Functions, Logical Operations and If-Then Rules. Together these components will generate a reason- able output or conclusion to the problem in hand, using prototype situations as knowledge base. Even if the whole process is developed using fuzzy logic, both inputs and outputs can be either fuzzy or crisp. However in case of a crisp output there is a need to apply a defuzzifier.

IF-THEN rules

Fuzzy If-Then rules are used to relate the systems’ variables. With these rules we can create a controller and a model, using different types of consequents - if the consequent have an action, e.g. reduce, brake, etc., we are in presence of a controller. Generally the rules have the following form:

IF antecedent THEN consequent

Both antecedents and consequents vary with the FIS model used.

Linguistic Models

Linguistic models have fuzzy propositions for both antecedent and consequent:

IF x is Ai THEN y is Bi

If we have in mind that a real number is a singleton type of fuzzy set, the values for the linguist variable x can be a real number, the same applying to y. The linguistic terms Ai are always fuzzy sets with N linguistic terms X = A , A ,...,A defined in the domain of the given numerical variable x. L { 1 2 N } This terms can be seen as qualitative values used to describe a relationship by linguistic rules [2]. The inference in this model is done by interpreting the rule as a fuzzy implication or a conjunction operator (R = cextY (A) cextX (B)): T µR = I(µA(x), µB(x))

The defuzzification in these models is usually done by Center of area or Mean of maxima.

9 Fuzzy Relational Model

This type of model1 is a generalization of linguistic model, allowing several different consequences prepositions for a single antecedent. Each if-then rule is represented by a fuzzy set with a single MF, having only one crisp value as consequent [2]. The aggregation of each rule’s output is done by a weighted average, avoiding a more time-consuming process of defuzzification.

Takagi-Sugeno (TS) Fuzzy Model

In this FIS model the consequent is a crisp function of the antecedent variables (also crisp variables) instead of a fuzzy proposition [2], providing a systematic approach to generate fuzzy rules from a given input-output data set [11].

: IF x is A THEN y = f (x), i = 1, 2,...,K (2.3) Ri i i K

In an affine linear mode we have:

: IF x is A THEN y = (a )T x + b , i = 1, 2,...,K (2.4) Ri i i i i

Like in the previous model, the output for TS is a weighted fuzzy mean:

k i=1 βiyi y = k (2.5) P i=1 βi P 2.2.2 Dynamic Fuzzy Systems

When dealing with dynamic systems, it is usually necessary to deal with system’s state, like linear systems of Equations 2.1 and 2.2. Fuzzy models can be used to simulate the state-transition function, but, as said before, the system’s states are difficult to measure, and so a input-output modeling is often applied [2]. A dynamic TS model is given by:

: IF y(k) is A AND . . . AND y(k p + 1) is A AND Ri i,1 − i,p u(k) is B AND . . . AND u(k m + 1) is B THEN i,1 − i,m y(k + 1) = f(y(k),u(k))

with

f(y(k),u(k)) := Σp a y(k j + 1) + Σm b u(k j + 1) + c , i = 1,...,K (2.6) j=1 i − j=1 i − i

1In some bibliography this model is also known as Tsukamoto Fuzzy Model [11] or Singleton Fuzzy Model [33].

10 2.2.3 Fuzzy Clustering

Fuzzy clustering is applied to discover fuzzy regions in the data space in which the system can be approximated locally by a linear submode [37]. Given a basic structure of clusters for a dynamic model, the Gustafson-Kessel algorithm is used to adapt the clusters to the shape and location of data. The solution will came with one rule per cluster. The number of clusters necessary in the model is not known at the beginning, so such property can be given either by comparison of the performance of various models with various numbers of clusters, or by start with a large number of cluster and successively reduce this number by merging clusters [37]. The Gustafson-Kessel algorithm can be consulted in many works, such as [2, 37] and the rules to reduce the numbers of cluster are presented in [22].

2.3 Composite Local Linear Models

Sometimes the use of nonlinear models may not be the best solution to the job in hand. Sometimes the complexity of such framework might be problematic to technological resources, or we can have a situation where the models obtained will only be appropriate for the problem in hand, even if this type of models are better for a wider system operating range. To overcome this problem we can use a composition of multiple linear models. This type of approach divides the global problem into a set of subproblems, which are valid for a restricted neighborhood of the system operating range and for which the linearity assumption is valid [5]. Several linear model tools can now be used at the same time in the problem, which leads to the necessity of using a supervisor in order to coordinate the models in use. The so called composite local linear model is a structure where the nonlinear system is divided into smaller regimes, that can be approximated by linear models. The formulation for CLLM is:

s x(k + 1) = p (φ(k))(A x(k) + B u(k) + ) (2.7) i i i Oi i=1 X y(k) = Cx(k) + v(k) (2.8)

The similarity to Equations 2.1 and 2.2 is obvious except for which represents the offset for each Oi local model, v(k) a white-noise sequence, and pi(φ(k)), a weighted vector based on the radial basis function:

r (φ(k); c , w ) = exp (φ(k) c )T diag(w )2(φ(k) c ) (2.9) i i i − − i i − i  where φ(k) is the scheduling vector, ci and wi are, respectively, the center and width of the i-th radial basis function. The scheduling vector corresponds to the operating point of the system at each instant. Typically it can be a function of the input and/or the state. In the present work the input is used as scheduling vector, i.e. φ(k) = u(k), since a large number of systems have nonlinear dynamics that is dependent on the input values [4].

11 For the weighting value the function used is a normalization for the values of equation 2.9:

ri(φ(k); ci, wi) pi(φ(k)) = s (2.10) j=1 rj(φ(k); cj , wj ) ensuring a interpretability of the linear models usedP in each step, since we always verify:

s pj(φ(k)) = 1, j=1 X 0 p (φ(k)) 1 ≤ i ≤

The goal of the identification problem is the estimation of matrices A , B , , C, for each local i i Oi model, as well as the centers ci and widths wi for each radial basis functions. It is assumed that the orders for the local models are equal and known in advance, which is also the case for the number of local models.

2.4 Artificial Neural Networks

Artificial Neural Networks, usually just called Neural Network, are adaptive systems designed to simulate how human neuron are connected. These simple processing elements [38] are connected to each other through weighted directional links, in order to pass information and take decisions. A simple schema of an Artificial Neural Network is presented in Figure 2.2, where is represented the neurons, identified by xi, hi and yi, respectively a first layer, a hidden layer and a final layer neurons, and the links between neurons.

h1

x1

h2 y1

x2 Inputs Outputs h3 y2

x3

h4

Figure 2.2: Artificial Neural Network

Unlike Fuzzy System, Neural Networks do not have the system explicitly relations, which give them the ability to learn complex functional relations from examples, very useful in black box modeling ap- proach.

2.4.1 Artificial Neuron

A mathematical model of a neuron, represented in Figure 2.3, is composed by weighted inputs (xi) and an output (y), whose value is given by the activation function σ(z). The weight sum of the inputs

12 x1 w1

x1 w2 z y Σ σ(z)

x1 wn

Figure 2.3: Artificial Neuron can be a simple sum of these, Equation 2.11, or can have an added bias, b in Equation 2.12, regarded as an extra weight from a constant input.

p T z = wixi = w x (2.11) i=1 X

p x T z = wixi + b = w b (2.12)   i=1 1 X h i  

The activation function σ(z) is dependent of the sum of the entries and are often limited in the intervals [0,1] or [-1,1]. The functions can have various forms but the most used are threshold, sigmoidal and tangent hyperbolic functions [2].

2.4.2 Neural Network Architecture

The neurons in the Neural Network are usually displayed in layers. The number of layers can go from a single-layer network to a multi-layer network, where there is an input layer, an output layer and so called hidden layers between them. The complexity of the network increases with the number of layers and the number of neurons in each layer. The networks can also be classified by how the neurons are connected within and among the layers:

Feedforward networks The information flows only in one direction: from the input to the output layer, as in Figure 2.2. These networks are actually a static mapping between the inputs and outputs, which can be a simple linear relation or a highly nonlinear.

Recurrent networks There is a feedback between a neuron and the ones in the same layer or even in preceding layers, Figure 2.4, acquiring memory that can be trained to learn sequential or time- varying patterns.

2.4.3 Learning

The learning process for an artificial neural network can be done by two methods:

13 Figure 2.4: Recurrent Neural Network

Supervised learning Where it is supplied both input and output values. The network tries to mini- mize the error between its output and the desired output, by adjusting the weights of the connec- tions. This adjustment can be done with various functions of backpropagation, like the Levenberg- Marquardt optimization.

Unsupervised networks Only the input values are given. The weights are adjusted based only in inputs and outputs of the network similar to clustering approach.

2.5 Model Predictive Control

Predictive control is a control technique where the controller action is calculated from optimization of a cost function, defined in a finite horizon, based on the prediction of the system behavior. Due to this features MPC is considered a combination between open-loop control, prediction part, and feedback, constant optimization through time.

Control Algorithm

Objective Model Function

r Reference w u y Optmitizer Process Generator

Figure 2.5: Basic scheme for a MPC

The classical cost function used in MPC is given by [17]:

Hp Hu−1 J(k) = yˆ(k + i k) r(k + i k) 2 α(i) + ∆ˆu(k + i k) 2 β(i) (2.13) k | − | k k | k i=0 i=XHw X where: u(k) is the (control) input vector at time k, ∆u(k) := u(k) u(k 1), − − yˆ(k + i k) is a prediction of y(k + i) made at time k, | r(k) is the desired reference for y(k),

14 α(i) and β(i) are weighting matrices,

Hp is an integer defined as the limit of the prediction estimation,

Hu is an integer which defines the limit of the control action i.e. it is assumed that control action remains the same beyond this instant, and

Hw an integer used if is not necessary to start penalizing the deviations of the system immediately.

The horizons as well as the weighting matrices, represent real performance objectives, ultimately being tuning parameters for the controller, according to the requirements of the system. The optimal control action results from a commitment between the output error and the variation of control action, resulting in anticipation of a change in the reference. A typical response of this controller is shown in Figure 2.6

Hp

Hc

system response

reference

control action

k-1 k+1 ... k+Hc k+Hp

Figure 2.6: Theoretical response of a MPC to a step in the reference

This anticipation from the actuators to control the system results in a better management of the actuators capacities, since their restrictions can be included in the cost function [17]. This controller offers advantages over other methods, like [8]:

capacity to control a great variety of processes, from a relatively simple dynamic system to an • unstable

intrinsically compensates dead times •

useful when the references is set a priori • but they have also some drawbacks, such as a more complex derivation of the control action, when compared with a classical PID controller.

2.6 Nonlinear Predictive Control

The introduction of nonlinear models in MPC increases the problem complexity as it turns into a non-convex problem [9]. This problem can be overcome with successive linearization of the nonlinear

15 model every sampling instant. This linearization can be done in various ways like single-step, multi-step or with feedback. For more information consult [2]. Another technique for NMPC is discrete searching, using dynamic programming (DP), branch-and- bound (B&B), genetic algorithms, etc. The main idea for this solutions is discretize the space of control inputs forming a tree of several hypotheses (represented in Figure 2.7), and search for the best using a smart search algorithm.

y(k+1) y(k+2) y(k+Hc) y(k+Hp)

ω 1 ω x(k) 2 ω 3

k k+1 k+2 k+Hc k+Hp

Figure 2.7: Discretization of control inputs

2.6.1 Branch-and-Bound

Branch-and-Bound is one of the simplest search algorithm to implement and offers good results. The basic operations applied recursively are:

Branching Defines how to divide a problem into subproblems;

Bounding Establishes bounds in the optimal solution of a subproblem allowing the elimination of sub- problems that do not contain an optimal solution;

This algorithm is presented in [32] and offers advantages like:

The optimal solution, within the possible solutions, is always found; •

Is not influenced by a weak initialization; •

The more restrictions the better since they will eliminate more subproblems, thus accelerating the • process. but it has also some disadvantages:

The computation effort increases with the number of discretizations; •

The solution may not be the most adequate since the control action is discretized. • 16 2.7 Fault Tolerant Control

A system by itself can be fault-tolerant if in the presence of a fault it remains satisfying its designated goal, meaning that the fault is not “visible” to the system. However not all systems have this luck, depending also on the type of fault and its magnitude. In order to make a system fault tolerant it is necessary to:

Diagnose the fault • Re-design the control • However instead of a feedback controller to perform this steps it is used a supervision system that prescribes the control structure and selects the algorithm and parameters of the feedback controller [3].

f

Controller Diagnosis re-design Supervision level f d Execution level yref u y Controller Plant

Figure 2.8: Supervision loop of FTC

To diagnose the fault it is assumed that every fault can be detected by a measurable signal that indicates the existence of the fault by, for example, the violation of a threshold.

2.7.1 Disturbances

Disturbances are a major concern in this type of processes since they can change the plant behavior the same way as faults. They are usually represented by unknown input signals added to the system outputs. Since the processes have disturbances, it is essential that FDI can make a distinction between them and the failures. In fact there are techniques to deal with such problems, like filtering or robust design to attenuate these disturbances. That is in fact other aspect that differs from faults, since the effects of the last ones cannot be suppressed by a fixed controller.

2.7.2 Classification of faults

There are three main groups considered in the classification of faults:

Plant faults such faults change the dynamical I/O properties of the system

17 Sensor faults the plant properties are not affected, but the sensor readings have substantial errors

Actuator faults the plant properties are not affected, but the influence of the controller on the plants is interrupted or modified.

In the current work an actuator fault will be simulated.

2.8 Performance Criteria

To find the different types of models and the best model parameters, the performance indices used will be the Variance Accounted For (VAF) and the Mean Squared Error (MSE), which are defined by:

var (z zˆ ) VAF = 100% 1 i − i (2.14) × − var (z )  i 

N (z zˆ )2 MSE = i=1 i − i (2.15) N P where zi represents the real output, zi the estimated output, and N the total number of samples. The optimal values are respectively 100 and 0.

In the control chapter an additional parameter will be used, the Settling Time (TS), which will be defined within 5% of the final reference value. This performance criteria gives the time required by the response of the system to reach and remain within 5% of the total amplitude of the step, as shown in Figure 2.9.

Figure 2.9: Graphical representation of Settling Time

18 Chapter 3

Distillation Columns

An introduction concerning the properties and design of distillation columns is addressed in this chapter. It finalizes with a description of the experimental case study used in this work: a continuous distillation column used to separate a binary mixture of ethanol and water.

3.1 Introduction

A basic distillation column is composed by a reboiler in the bottom, responsible for heating the mix- ture, a condenser on top used to cool and condense the vapor of the most volatile component and an inlet, normally placed in the middle of the column, to let the initial mixture enter the column. The less volatile element exits the column through the base in liquid form. As the vapor rises in the column in contact with the dropping fluid it cools. When the vapor temper- ature is identical to a substance boiling point, that substance condenses, forming a liquid whose purity increases with the height in the column where that temperature is reached. Even if inside the columns the vapor temperature and pressure decreases from top to bottom, the liquid is allowed to drop against the positive pressure gradient because it is denser than vapor phase [7]. As it can be seen in Figure 3.1, on the top of the column some of the distillate product is returned to the column. This happens to achieve a more complete separation of products since the liquid flowing downwards helps to condensate the vapor. The reflux rate can be adjusted while operating the column to meet the specifications required.

3.2 Columns internals

To help the heat transfer between the liquid and vapor phases, thus increasing the products purity, we can add barriers inside the column. In these barriers, thanks to their geometry, both liquid and vapor flows are conditioned by each other, providing a higher level of contact between the liquid and the vapor. Since the flows are not in equilibrium, a mass transfer occurs turning some liquid of the lightest component in vapor and some vapor of the heaviest into liquid.

19 VT PC M D LC p

L D,xD

F,zF

V MB LC

B,xB

Figure 3.1: Typical simple distillation column [30]

Depending on the type of barrier we can consider two types of columns:

Tray Columns - Their internals consist simply in trays with various formats. The most simple design can be a plate with small holes, known as sieve trays, where vapor flows up through the holes and the liquid passes over a weir before dropping to the next tray. But we can have more complex designs like valve trays, which are opened by the vapor flow.

Packing Columns - Their internals are filled with devices known as packings, which are designed to improve contact between the two phases. These packings can be pipes filled with small objects like rings or even other small pipes. For the same column length, Packing Columns have more efficiency since it has more inter-facial area for contact between the two phases.

tray liquid vapor

weir

vapor

Figure 3.2: Schematic of a typical sieve tray of a distillation column [7]

3.3 Vapor-Liquid-Equilibrium (VLE)

Given a simple binary mixture the equilibrium between liquid and vapor can be represented by [25]:

yV i = Kixi (3.1)

With yV i and xi representing the equilibrium compositions of vapor and liquid respectively on the column’s stage i, and Ki being the liquid-vapor phase equilibrium coefficient.

20 When K = 1 the mixture is considered to be an azeotropic mixture, i.e., vapor and liquid have the same composition, being impossible to separate them by conventional distillation [25, 35]. Figure 3.3a represents an equilibrium curve for an ideal mixture, relatively easy to separate. In other hand mixtures represented by Figures 3.3b–c are non-ideal mixtures as the inflection on the curve suggests. For more complex mixtures with one or various azeotropic points there is the need to use some techniques to get through these points. For these purpose we can use , a process where the pressure above liquid is lesser than the thus shifting the mixture azeotropic point, or we can add a component to shift the azeotropic point to a more “favorable” position [35]. In a case of an heterogeneous azeotrope we can separate it into two distillation columns, since the repulsion between the two-liquid phases is very strong.

1 1 1 Equilibrium curve 0.8 0.8 0.8

0.6 0.6 0.6

vapour 0.4 vapour 0.4 vapour 0.4

0.2 0.2 0.2

0 0 0 0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 0.2 0.4 0.6 0.8 1 liquid liquid liquid

(a) Ideal mixture (b) Non-ideal mixture (c) Heterogeneous azeotrope mixture

Figure 3.3: Equilibrium curves for various binary mixtures

3.4 Column Design

When designing a column for the separation of a binary mixture some approximations can be done. One of them is the a constant relative (α), valid for separation of similar products, for example ethanol:

y /x y /(1 y ) αx α = V L L α = V − V y = (3.2) y /x ⇒ x/(1 x) ⇒ V 1 + (α 1)x V L H − − This value also can tell how difficult the separation in distillation will be. Values close to 1 mean that the separation will be very difficult, requiring a larger number of trays in the column. Recalling the equilibrium curves, a curve with α = 1 is a straight line with a 45 ◦ angle while bigger volatilities have “fatter” lines as it can be seen in Figure 3.4. Other approximation used is to consider the system as ideal. A system is considered ideal if it obeys Raoult’s Law:

yV iPT = xiPi (3.3) where PT represents the total system pressure.

21 1

0.8

0.6

vapour 0.4

0.2

0 0.2 0.4 0.6 0.8 1 liquid

Figure 3.4: Equilibrium curves for different relative volatilities

The of a mixture cab be calculated by [30]:

∆Hvap ∆T ln α B (3.4) ≈ RTB TB with ∆T = T T being the difference between the boiling points of the light (L) and heavy (H) B BH − BL vap components, TB = √TBLTBH the geometric average boiling point and ∆H the heat of vaporization, vap assumed constant. The factor ∆H /RTB is typically around 13.

3.4.1 McCabe-Thiele Method

To calculate the minimum number of trays in a column we can use the method presented in 1925 by McCabe and Thiele, that uses the equilibrium curves as those presented in Figures 3.3 and 3.4 to create the diagram of Figure 3.5 following the steps of algorithm 3.1.

Figure 3.5: McCabe-Thiele diagram

22 Algorithm 3.1 McCabe-Thiele Method

1: Mark the composition for the top product (xD) in xi axis; 2: Trace a vertical line until it intercepts the line for α = 1;

3: Trace a line with a downward slope of L/(D + L);

4: The same procedure to the bottom product with composition xB and an upward slope of LS/VS,

where LS and VS are the liquid rate down and the vapor rate up the stripping section of the column, respectively;

5: A new area bounded by the two lines drawn above and the equilibrium line is obtained;

6: Considering constant molar flows between the trays, i.e. Li = Li+1 and Vi = Vi+1, draw vertical and

horizontal lines inside the new area linking the point marked in the α = 1 line for xB with the point

for xD. 7: The number of new areas shaped similarly to a triangle is the number of stages the column should have. The number of trays should be - 1.

8: The effective number of trays should consider the tray efficiency, and thus is defined by:

number of theoretical trays tray efficiency

3.4.2 Fenske Equation

Another way to calculate the number of trays is using the Fenske equation, derived in 1932 by Merrel Fenske:

log[ xDL/xDH ] xBL/xBH Nmin = (3.5) log αLH

As said before αLH is the relative volatility of the mixture that remains constant in the column. This equation also gives us an important feature of the column, the separation factor, defined by:

x /x S = DL DH (3.6) xBL/xBH

3.5 Properties of the experimental distillation column

The case study used in this work is a distillation column built as a pilot-scale facility in Instituto Superior de Engenharia de Lisboa (ISEL), used to separate a liquid binary mixture of water and ethanol (10-20%) into a distillate product with ethanol (75-88%) and bottom product with (92-98%) water (mole fractions). The column is composed by several glass sections supported by an external steel framework. In order to guarantee minimal heat loss to the surroundings the glass sections are enfolded with proper isolation material. The column internals used for distillation are two structured packing sections which are equivalent to a number of 60 equilibrium theoretical stages. The liquid feed mixture is pre-heated using a 1200 W ON/OFF electrical heater element, which is actuated by an automatic controller. Ethanol evaporates along the distillation column, going upwards

23 throughout the column section above the feeding point. A fraction of the condensed distillate ethanol, leaving the top section, is fed back into the column at a rate determined by the actuation of a solenoid reflux valve. The liquid mixture travels downwards through the section below the feed into the reboiler. Here, part of the mixture changes phase from liquid to vapor upon the action of two 2000 W electrical ON/OFF heater elements, which are controlled by an automatic controller. The mixture rich in water leaves the bottom section of the col- umn through a condenser before being stored in the product tank. The column measurement instrumentation consists of two types of sensors: temperature thermopars type K, and pressure sensors. These sensors gather the online information about tem- perature and pressures at different points in the column. The measured signals are fed into the digital controller in real time using the National Instruments FieldPoint 2000 system. All the signal conditioning operations and the network communica- tions are carried on using this modular distributed I/O system. The actuators consist of: heater elements, valves and peristaltic pumps. These devices are operated by an automatic digital control system, which interfaces with the actuators through the FieldPoint I/O bus. This system handles the network communications and the device actuation in the control process. The digital controllers were designed and run over LabView software. An automatic Figure 3.6: Pilot scale distillation level control system was implemented at the reboiler. column at ISEL The distillate and bottom products compositions are inferred from density measurements. These measurements are carried on offline, at the laboratory, upon col- lecting samples from the feed, the distillate and the residue products.

Table 3.1: Main characteristics of the real column

material : glass enfolded with proper isolation material to guarantee minimal heat loss into the surroundings Internal diameter : 43 mm Internals : A3-1900 from Montz with a total of 2 m height, equivalent of 60 trays ◦ Allowed temperatures : above 200 C Allowed Pressure : until 1013 mbar

24 Chapter 4

Distillation Column Modeling

This chapter presents the models developed for the distillation column. It begins by introducing the first principles model previously developed by other authors [23, 24], used to run several simulations and the preprocessing tasks necessary to get the data sets used by the modeling algorithms. After explaining the methodology that leads to the best models the results obtained for each model in particular are discussed, and a general discussion for all models is also presented.

4.1 First Principles Model

The First principles dynamic model of the pilot-scale distillation process was developed for the simu- lation of the dynamic behavior. This model was implemented within Simulink R environment [23, 24] and includes mass and energy balances for the individual systems such as the distillation column sections, the condenser, the heated reboiler, the feed pre-heater, the reflux valve, the bottom product control valve and the PID regulatory level controller. This parts are presented in Figure 4.1. The model includes the following equations:

Vapor flow trough the column • V = V (1 ∆e)i−1 (4.1) i s −

Vapor flow trough the upper part of the column • V = V + (1 q)F (1 ∆e)i−(Nfeed−1) (4.2) i i − −

Liquid flow • L0i + Mi M0i Li = − (4.3) τl

LNtotal = Lr (4.4)

Efficiency of each plate • λ 1 ηi = 1 (4.5) − Li + 1 Vi !

25 Efficiency of the (perfect) reboiler •

η1 = 1 (4.6)

Vapor-Liquid equilibrium in the plates and reboiler • y = 0.00267 + 1.445x0.5 + 1.28x 6.755x1.5 + 6.885x2 1.859x2.5 (4.7) V i − i i − i i − i y = η y + (1 η ) x (4.8) V i i V i − i i Global mass balance for the most volatile component • dMi = L L + V − V (4.9) dt i+1 − i i 1 − i dMixi = L x L x + V − y − V y (4.10) dt i+1 i+1 − i i i 1 V i 1 − i V i Correction for the mass balance in the feed input • dMN dMN feed = feed + F (4.11) dt dt dMN xN dMN xN feed feed = feed feed + Fx ; (4.12) dt dt F Mass balance in reboiler • dM 1 = L V B (4.13) dt 2 − 1 − dM x 1 1 = L x V y Bx (4.14) dt 2 2 − 1 1 − 1 Mass balance in condenser •

dMNtotal = V − L D (4.15) dt Ntotal 1 − r −

dMNtotal xNtotal = V − y − L x Dx (4.16) dt Ntotal 1 Ntotal 1 − r Ntotal − Ntotal Compute of the molar fraction • dMixi dMi dx xi i = dt − dt (4.17) dt Mi This model parameters were estimated from experimental data collected from the plant under normal operating conditions, both in the absence and in the presence of faults. The input and output variables considered are presented in Table 4.1. The input variables chosen were those that could have a large range of variation during real experi- ments, without safety problems. The variables chosen were the volumetric feed flow rate, Fv, the fraction of maximum power for reboiler’s heaters, fR, and the reflux ratio, fReflux. The outputs were chosen by taking into account the measurable outputs in the experimental distillation column, and since the com- positions could not be measured online, the temperatures in the reboiler, Tvap and Tebul, were chosen. It is important to notice that both temperatures are related to the compositions by Equations 4.18 and 4.19, which are based on experimental fitting correlations between temperatures and compositions.

T = 25.059x + 103.047 (4.18) vap − D T = 35.798x + 87.108 (4.19) ebul − R

26 Table 4.1: Process variables

Inputs Symbol Outputs Symbol

Volumetric feed flow rate F v Vapor temperature in reboiler Tvap

Feed’s mole fraction of ethanol xF Liquid temperature in reboiler Tebul

Fraction of maximum power for reboiler’s heaters fR Top composition xD

Reflux rate fReflux Bottom composition xR

Liquid fraction in feed’s composition q Condenser holdup MD

Feed’s Temperature Tfeed Reboiler holdup MR

Composition in each tray xi

Figure 4.1: Schematic diagram of the pilot scale distillation column: 1- condenser; 2- heated reboiler; 3- feed pre-heater; 4- reflux valve; 5- bottom product valve

4.2 Input/Output data preprocessing

4.2.1 Persistency of excitation

In order to create models that describe the system with high accuracy, the data must be informative enough, i.e. it is required that the signals describe the system dynamics in the operating region of interest, meaning they have to be persistently exciting [15]. Usually a white noise signal is used to excite the system, since white noise excites all the frequencies of the system. However this is a slow chemical system, so the input signal could not be a high frequency noise because the system would stay at approximately the same state. Also, since the model has three inputs, it was important that the modeling algorithms would differentiate the effect that each input had in

27 the column. Taking this in consideration the option was to use a step-wise white noise signal, which was different in the case of the real and the simulated distillation column. This happened because in the real system some safety precautions must be taken into account, and also, the time of a experiment could be very long. Since there was no risk a more rich signal was used for the simulation part. The signal properties are indicated in Tables 4.2 and 4.3.

Table 4.2: Samples times for each input in the simulated distillation column.

Input Fv fR fReflux Time Sample [m] 20 30 50

Table 4.3: Limits of inputs variables

Fv fR fReflux Min 1 0.25 0.3 Max 1.5 0.28 0.5

Figure 4.2 shows the inputs and the outputs for a iteration with different time samples in each input. Five different iterations were made with different seed values to generate the white noise signal.

86 1.5 Flow

ebul 85

1 T 0 200 400 600 800 1000 minutes 84 0.3 0 200 400 600 800 1000 minutes

Power 0.25 84 0 200 400 600 800 1000 minutes 83

0.6 vap T 82 0.4 0.2 81 0 200 400 600 800 1000 0 200 400 600 800 1000 minutes minutes

(a) Inputs (b) Outputs

Figure 4.2: Variables with different time samples for the inputs

The handling of noise in the temperature signals was not implemented, either with hardware or software. The only signals that suffer attenuation were the pressures, which were treated by software with a moving average filter.

4.2.2 Normalization of variables

Several methods of normalization were tested, with different efficiency between algorithms. The first method used was subtracting the mean value from all values of each variable and then divide them by

28 their standard deviation. This way each variable entered the model with the same weight, ensuring their variation was felt by the model. This normalization provided good results with fuzzy models, but not with CLLM, which led to withdrawing this method.

zj z¯ (zj)N = − (4.20) σz where:

(zj)N is the normalized value of variable z (input or output) for instant j, zj is the original value of variable z, 1 N z¯ := N i=1 zj, and P σ := 1 N z z¯. z N i=1 j − Anotherq P method consists of normalizing using the absolute maximum, i.e. the difference between the value and the mean. The results were identical therefore the method was not used. z z¯ (z ) = j − (4.21) j N max( z ) | | The last normalization method was taking into account the nominal value of each variable, by con- sidering that the nominal values of the input variables lead to the nominal values in the output variables. For the Simulink R first principles model this was no problem since in every trial the temperature values were the same, but in the real column this was not true, since some environment conditions changed for each experiment. The most obvious factors were the different ambient temperature along the year, which would have impact in the heat loss from the distillation column, as well as the cooling liquid rate of the top condenser that was not controllable during an experiment. To overcome this problem it was set that the nominal value of each temperature for each experiment should be the value measured when the column reaches a stabilized behavior for nominal inputs.

(z ) = z z (4.22) j N j − nominal The main problem with this method was that it could not take into account the main advantage of the first, each variable entered the model with the same weight, ensuring the property of persistently excitation mentioned before. With this normalization that did not happened, meaning that the model could not ensure that variables with small absolute values in their variation would be taken in account. But since the steps were given with different time samples in the case of the simulation and at different times in the real distillation column, the modeling algorithm could take into account each input. Taking this to account this last method was selected for this work.

4.3 Linear models

The first types of models created were linear state-space models (Equations 2.1 and 2.2) using the MATLAB R System Identification ToolboxTM V7.0. The function used was n4sid, which uses the method described in [15, Section 10.6].

29 The best model was found by a script that changes the order for the model, choosing the model that had the best performance parameters.

4.3.1 Linear models based in simulated data

The best model obtained using data provided by the simulation, when excited by white noise, has the properties indicated in Table 4.4. The data used to compare the models outputs were obtained from simulations of real experiments in Simulink R first principles model, the responses of the several iterations with white noise (with the time step of the data used to build the model) and the responses of the system to a step on each input variable. The performance values are presented in Tables 4.5 and 4.6. The values for the simulated experi- ments are represented by the month and day (e.g. Feb.26), the same way for the real experiments but with a [R] (e.g. Feb.26[R]), the step responses are represented by the name of the input (e.g. Fv) and the white noise iterations by Ite.

Table 4.4: Properties of the best linear model model based in simulated data

OrderofModels 3 Iteration 2

Table 4.5: MSE values for the linear model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.0006 0.0106 0.0078 0.0200 1.6772 0.4812 0.5150 1.2331

Tvap 0.0074 0.0047 0.0049 0.0045 0.2530 0.0623 0.1405 0.2798 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.0002 0.0005 0.0346 0.0017 0.0009 0.0023 0.0024 0.0018

Tvap 0.0081 0.0012 0.0028 0.0040 0.0021 0.0038 0.0034 0.0035

Table 4.6: VAF values for the linear model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 99.31 95.08 95.93 97.30 46.13 68.64 59.29 41.60

Tvap 98.35 99.45 99.32 99.78 44.05 89.85 87.40 76.42 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 99.66 98.66 93.56 95.87 96.95 95.20 91.14 95.54

Tvap 0 16.19 99.82 98.42 99.07 98.58 98.59 98.80

The model has values of VAF above 90 compared to some of the simulations of real experiments, but for the noise data set some of the peaks are too long, especially in Tebul (e.g. Figure 4.3). When

30 compared with real experiments, it shows a similar dynamic behavior, especially for Tvap in some cases like the experiments in March 17th and March 24th , but also shows an offset.

Output 85.5 Linear [ºC] 85 ebul T 84.5

0 200 400 600 800 1000 minutes

83.5 Output Linear 83 [ºC] 82.5 vap T 82

0 200 400 600 800 1000 minutes

Figure 4.3: Estimated outputs (dashed line) of the linear model based in simulated data, for noise Ite. 3

4.3.2 Linear models based in real data

The best model derived from data provided by the experimental distillation column was obtained in the same way as the model based in simulated data, but this time using data from each of the experiments and creating a model for each one. The best model has the properties indicated in Table 4.7 and the performance values of Tables 4.8 and 4.9.

Table 4.7: Properties of the best linear model model based in real data

OrderofModels 5 Day March24th

Table 4.8: MSE values for the linear model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.2650 1.2345 0.9248 2.0518 1.3064 1.9212 0.0130 1.7528

Tvap 0.2607 0.3238 0.2352 0.4978 0.0452 0.3765 0.0184 0.2669 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.7186 0.0020 3.0637 0.6990 0.5189 0.6296 0.5951 0.8823

Tvap 0.0072 0.0570 0.8326 0.5632 0.4387 0.5236 0.5036 0.6075

The comparison with real experiments gives acceptable results, but the result achieved with the data set used in its training does not reflect the same way in others sets. Also some behaviors of the model are not seen in the original data.

31 Table 4.9: VAF values for the linear model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0 0 0 0 46.69 12.91 97.71 55.95

Tvap 52.83 67.16 71.60 58.07 90.39 50.54 97.69 71.18 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 069.14 0 0 0 0 0 0

Tvap 0 0 49.20 61.30 61.55 67.14 65.33 58.26

86 Output Linear[Real]

[ºC] 85 ebul

T 84

0 50 100 150 minutes

84 Output Linear[Real]

[ºC] 83 vap

T 82

0 50 100 150 minutes

Figure 4.4: Estimated outputs (dashed line) of the linear model based in real data, for exp. of March 24th

4.4 Nonlinear models based in simulated data

4.4.1 Fuzzy Models

Fuzzy models can be obtained from data using the toolbox developed by Babuskaˇ [2], which extracts Takagi-Sugeno models from measured input/output data. This data, as said before, was normalized by subtracting the nominal conditions, since if the real value was used the results would not be as good. A script was developed to change and select the parameters for the best model. This script built a model and compared it to other data, giving the values of the performance indices VAF and MSE. The model which has the best mean values for both indices would be the chosen one, but eventually there were one for VAF and one for MSE and so the chosen would be the one that had a better approximation when compared graphically to the original data. For the same parameters, 10 models were made using different seeds, since the program modified them with the computer’s time. The model with best MSE was considered as the best for that group of parameters because the best models for VAF often had a higher offset. The best overall results were obtained also with the model chosen by comparison of MSE, which has the properties from table 4.10. The properties changing in the script are highlighted. The membership functions and the rules are presented in Section A.1, were it can be seen that for this range the model presents an approximately linear trend.

32 Table 4.10: Properties of the best FM model based in simulated data

Number of Clusters 2 Fuzziness Parameter 2 Termination Criterion 0.01 Type of Fuzzy Model Projected Membership Functions Denominator Order 1 Numerator Order 3 Transport Delays 1 Number of Iteration 4

Results for FM model based in simulated data

The graphical comparison between the model and all types of outputs, used to find the best model, can be seen in Section 4.6. The MSE values are given in Table 4.11 and the VAF values in Table 4.12.

Table 4.11: MSE values for the FM model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.0043 0.0006 0.0007 0.0215 1.6800 0.5319 0.4641 1.2680

Tvap 0.0079 0.0038 0.0045 0.0027 0.2915 0.1009 0.1233 0.2702 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.0006 0.0049 0.0005 0.0007 0.0008 0.0006 0.0004 0.0006

Tvap 0.0061 0.0001 0.0013 0.0017 0.0019 0.0034 0.0017 0.0023

Table 4.12: VAF values for the FM model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 96.48 99.48 99.43 97.79 44.4 0 70.53 62.65 38.27

Tvap 97.99 99.26 99.07 99.50 33.05 85.00 86.90 76.01 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 98.79 93.89 99.45 98.20 97.35 98.69 98.56 98.66

Tvap 0 62.70 99.76 99.31 99.21 98.73 99.30 99.17

The model handles well the outputs generated by noise, but have some difficulties when compared to simulations, mainly for the data set referring to March 31th (Figure 4.5), and when compared to some of the steps, being the step in Fv the most obvious (Figure 4.5). The problem with the simulations is latter described in Section 4.6. Regarding the response to steps is important to see the range of the temperatures which is very low, specially the responses of Tvap to steps in Fv and the responses of both temperatures to a step in fR. This means that this input variables do not have a great influence in these outputs, or at least, as much as fReflux. When comparing with real data it is important to remember that the normalization is not a fixed value but a value that can change in each experiment since the conditions changed in each day. As in

33

85.8 Output 85.6 FM

[ºC] 85.4

ebul 85.2 T 85 84.8 0 50 100 150 200 minutes

83.5 Output FM 83 [ºC] 82.5 vap T 82

0 50 100 150 200 minutes

Figure 4.5: Estimated outputs (dashed line) of the FM model based in simulated data, for a simul. of Mar. 31th

85.8 Output 85.6 FM

[ºC] 85.4 ebul

T 85.2

85 0 100 200 300 400 minutes

83.8 Output FM

[ºC] 83.7 vap

T 83.6

0 100 200 300 400 minutes

Figure 4.6: Estimated outputs (dashed line) of the FM model based in simulated data, to a step in F v simulations some results can be considered satisfactory, specially for the data set referring to March 17th and 24th (shown in Figure 4.7), where the dynamic behavior is reasonably captured by the model output, although changed by an offset. However there are others were the model proves to be inadequate, particularly March 31th , which had the output shown in Figure 4.8.

34

86 Output FM

[ºC] 85 ebul T 84

0 50 100 150 minutes

84 Output FM

[ºC] 83 vap T 82

0 50 100 150 minutes

Figure 4.7: Estimated outputs (dashed line) of the FM model based in simulated data, for exp.of March 24th

91 Output FM 90 [ºC] 89 ebul T 88

0 50 100 150 minutes

Output 85 FM

[ºC] 84 vap T 83

0 50 100 150 minutes

Figure 4.8: Estimated outputs (dashed line) of the FM model based in simulated data, for exp.of March 31th

4.4.2 Composite Local Linear Models

Since this type of modeling is a composition of local linear models, which are estimated for a given region in the variables range (see Section 2.3), the procedure for this modeling algorithm was different from the others: the variables range was divided into small intervals and a state-space model was calculate for each one. Then, using a signal varying in all range, the radial basis functions of the weighting vector were calibrated. Each region had a noise signal that covered its range and interacted with the next region, providing models that crossed the complete input variable range. In Figure 4.9 it’s represented an example for the variable fReflux with the range divided in three regions, with each region represented by its center, its radius of action and the respective input signal. These models were estimated using the toolbox developed by Borges [4], with the modifications

35 Figure 4.9: Boundaries of divided reflux range mentioned above, and similarly to the case of Fuzzy Models, the best parameters were found using a script that changed them. For this type of modeling the parameters that could be changed were the number of state-space models and their order. It is important to notice that this order was equal for all local models. The minimum value for the cost function could be also changed but, a fixed value of 2.6 10−6 was × used instead, with the concern of having good results without overfitting the training data. The decision for choosing the best model made like in fuzzy models, the best models were chosen by the best mean values for both for VAF and MSE, with the one that had a better approximation when compared graphically beeing the final model. Eventually, the best model came with the best MSE with the properties of Table 4.13.

Table 4.13: Properties of the best CLLM model

NumberofModels 3 OrderofModels 2 Number of Iteration 2

The radial basis functions of this model are represented in Figure 4.10 and the poles placement in the complex plane in Figure 4.11. From the RBFs it’s possible to see that fR does not have a great effect on the outputs, a conjecture already made in FM models, since the RBFs are quite similar. This means that the algorithm could not identify different behaviors in that range. Also the location of the poles suggests a similarity between the local linear models.

Results for CLLM model based in simulated data

The performance results for the model chosen can be seen in Tables 4.14 and 4.15. A comparison between the model and all real outputs is presented in Section 4.6.

36 1

0.5

0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

1

0.8

0.6

0.4

0.2 −0.01 −0.005 0 0.005 0.01 0.015 0.02

1

0.5

0 −0.3 −0.25 −0.2 −0.15 −0.1 −0.05 0 0.05 0.1

Figure 4.10: Radial basis function of CLLM model based in simulated data

Pole−Zero Map

0.02

0.015

0.01

0.005

0 Imaginary Axis

−0.005

−0.01

−0.015

−0.02 0.97 0.975 0.98 0.985 0.99 0.995 1 1.005 1.01 Real Axis

Figure 4.11: Poles placements in the complex plane for the CLLM model based in simulated data

Table 4.14: MSE values for the CLLM model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.0027 0.0010 0.0010 0.0350 1.6753 0.5548 0.4594 1.2936

Tvap 0.0074 0.0045 0.0053 0.0019 0.2808 0.0811 0.1324 0.2682 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.0010 0.0008 0.0017 0.0006 0.0004 0.0007 0.0006 0.0005

Tvap 0.0007 0.0001 0.0012 0.0018 0.0012 0.0021 0.0021 0.0020

The performance values indicate that this model has a good behavior, when compared to simulations of real experiments and in the various iterations of white noise. The response to steps fails in the output

Tvap, were fR and specially Fv do not have the expected dynamic behavior.

37 Table 4.15: VAF values for the CLLM model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 97.60 99.14 99.03 98.36 42.21 69.60 60.77 38.46

Tvap 98.24 99.12 98.88 99.68 37.80 86.87 87.34 76.52 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 98.51 96.91 99.17 98.35 98.73 98.63 97.73 98.75

Tvap 0 71.49 99.78 99.28 99.51 99.22 99.29 99.25

85.8 Output 85.6 CLLM

[ºC] 85.4 ebul

T 85.2

85 0 100 200 300 400 minutes

83.75 Output 83.7 CLLM

[ºC] 83.65

vap 83.6 T 83.55

0 100 200 300 400 minutes

Figure 4.12: Estimated outputs (dashed line) of the CLLM model based in simulated data, to a step in F v

When compared to real data this model gives a acceptable prediction, but again, has some problems in some of them. Experiments from March 17th and 24th (shown in Figure 4.13) result in an accept- able approximation in terms of dynamic behavior, with an observed offset, but the estimated output for experiments from February 26th and March 31th does not offer a satisfying behavior.

86 Output CLLM

[ºC] 85 ebul T 84

0 50 100 150 minutes

84 Output CLLM

[ºC] 83 vap T 82

0 50 100 150 minutes

Figure 4.13: Estimated outputs (dashed line) of the FM model to Mar. 24 experiment

38 4.4.3 Artificial Neural Networks

These models were developed in MATLAB R Neural Network ToolboxTM Version 5.0.2.. The first option available is to separate the data in training, validating and testing data, in order to avoid overfitting from the modeling algorithm. The supervised training function itself can be changed. The function uses the Levenberg-Marquardt algorithm to update the weight and bias values of the network. However the function used was based in the Bayesian Regularization which minimizes a linear combination of squared errors and weights within the Levenberg-Marquardt algorithm. This change was made simply because the preliminary results were better. The architecture of neural network is a Nonlinear Auto-Regressive with Exogenous Input (NARX), which is a recursive network were the outputs are fed back to the input of a feedfoward network. However there can be two types of NARX networks depending of the output used as an input:

Parallel Architecture : The estimated output is fed back

Series-Parallel Architecture : The real output is fed back

Since we had the real output during the training we could use the NARX-SP architecture. This would provide more accurate input in the feedfoward architecture and, since it’s transformed in a purely feedfoward network, a static backpropagation could be used for training, making this one faster.

u(t) Feed y(t) u(t) Foward Feed y(t) Network y(t) Foward Network

(a) Parallel Architecture (b) Series-Parallel Architecture

Figure 4.14: Different NARX architectures

Since the results from other type of modeling were already known, the complexity of the network could be estimated to not being very high. Thus 3 hidden layers were chosen, and the number of neurons in each one was to be chose using a script to change them between 2 and 20. All networks were trained for five different data samples and each data was separated in 60% for training, 20% for validating and 20% for testing. As in fuzzy models this too had a different seed, so there were made various iterations of the same model with the same parameters, but in this case only four because there were more models, and the training took more time than clustering in fuzzy models. Also the noise used to train this models was not the same used in CLLM and FM because by the time when the problems referred in Section 4.2.1 were find it was too late to restart the script, since this took many days to complete. The characteristics of the best model are presented in Table 4.16.

39 Table 4.16: Characteristics of the training for the best ANN model

Number of neurons in the hidden layers 2 - 8 - 18 Training function Bayesian Regularization Maximumnumberofepochstotrain 1000 Maximum validation failures 100

The number of neurons in the hidden layers did not correspond to the assumption of a low complexity network. The number of neurons increases in each layer, giving the idea that more hidden layers should be added with an increasing number of neurons.

Results for the ANN model based in simulated data

The results for the best Artificial Neural Network are presented in Tables 4.17 and 4.18.

Table 4.17: MSE values for the ANN model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.0112 0.0217 0.0193 0.4789 4.5425 0.2770 1.7790 1.6002

Tvap 0.0818 0.1541 0.1710 2.2290 0.9684 0.1094 1.8895 0.3254 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.0590 0.0057 0.0872 0.2877 0.4422 0.0486 0.0147 0.6062

Tvap 0.0002 0.0018 0.0260 0.7732 0.5046 0.1949 0.2359 1.0035

Table 4.18: VAF values for the ANN model based in simulated data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 88.78 93.60 94.00 0.01 0 2.80 0.25 44.24

Tvap 89.17 82.84 82.16 0 0 91.97 0.93 64.97 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 1.08 0.82 77.45 0 1.11 0 47.31 2.07

Tvap 0 0 95.68 0 2.96 46.21 40.28 9.49

The results were not as good as the results of other models, since some of the dynamics were mapped but with a large error, with emphasis in data sets of the iterations of white noise which had all VAF values below 50%. The best results came with the simulations of real experiments, presented in Figure 4.15. In order to reach better results the maximum number of epochs to train and maximum validation fail- ures could be increased. Also the number of hidden layers could also be increased, therefore increasing the network complexity, but as said before, these models took too much time to train. Considering that good results were already obtained with the previous types of models, this type of model was discarded.

40

85.8 Output 85.8 Output 85.6 NN 85.6 NN 85.4 85.4 [ºC] [ºC] 85.2 85.2 ebul 85 ebul T T 85 84.8 84.8 0 50 100 150 200 0 50 100 150 200 minutes minutes

83.5 Output 83.5 Output NN NN 83 83 [ºC] [ºC] 82.5 vap vap

T 82.5 T 82

82 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) February 26th (b) March 17th

Figure 4.15: Estimated outputs (dashed line) from the ANN model to simulations

4.5 Nonlinear Models based in real data

Only FM and CLLM models were selected to be developed using real data. ANN models proved not to be a good solution in terms of simplicity vs. results so it was expected that with real data, with real noise from the devices, the results would be even worse.

4.5.1 Fuzzy Models

The best parameters were found the same way as in the model in Section 4.4.1. The chosen model has the parameters in Table 4.19.

Table 4.19: Properties of the best FM model

Number of Cluster 3 Fuzziness Parameter 2 Termination Criterion 0.01 Type of Fuzzy Model Projected Membership Functions Denominator Order 2 Numerator Order 2 Transport Delays 3 Day March31th

The membership functions and rules of the selected model are displayed in Section A.2 as well as the outputs for each input signal in Section 4.6. The performance values of the model applied to data from both simulation and real column are presented in Tables 4.20 and 4.21. The outputs of the model compared to simulation data did not show a good approximation. Even when Tvap seems to have a similar dynamic behavior it reveals a considerable offset. An example of this behavior is shown in Figure 4.16. When comparing to real data, only the training set for the model shows performance values near

41 Table 4.20: MSE values for the FM model based in real data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.583 0.7623 0.7538 0.6928 2.6181 0.5002 1.4348 0.0215

Tvap 1.081 0.1869 0.195 0.1907 0.1765 0.2644 0.0982 0.0133 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.6683 6.816 0.67 0.5364 0.6125 0.772 0.447 0.5094

Tvap 1.5358 0.3257 0.1378 0.473 0.3758 0.3957 0.5415 0.5063

Table 4.21: VAF values for the FM model based in real data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0 0 0 0 83.11 0 33.20 98.61

Tvap 0 62.67 59.95 64.11 60.75 53.69 87.21 98.56 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 00 0 00000

Tvap 0 0 98.57 49.55 52.45 42.16 40.38 47.38

87 Output FM[Real] 86 [ºC] 85 ebul

T 84

83 0 200 400 600 800 1000 minutes

Output 83 FM[Real]

[ºC] 82 vap T 81

0 200 400 600 800 1000 minutes

Figure 4.16: Estimated outputs (dashed line) of the FM model based in real data, for noise of Ite. 3 their optimal, as shown in Figure 4.17.

42

91 Output FM[Real] 90 [ºC] 89 ebul T 88

0 50 100 150 minutes

Output 85 FM[Real]

[ºC] 84 vap T 83

0 50 100 150 minutes

Figure 4.17: Estimated outputs (dashed line) of the FM model based in real data, for exp. of March 31th

4.5.2 Composite Local Linear Models

Due to operational security reasons it was not possible to excite the experimental distillation column using the same type of signals used for the simulation, instead it was used data varying in all range. Despite that, the initial center and width of each RBF was the same as in Section 4.4.2. The model with best results had the properties of Table 4.22.

Table 4.22: Properties of the best CLLM model

Number of Models 4 OrderofModels 2 Day March17th

The performance values obtained by the best model estimated are presented in Tables 4.23 and 4.24.

Table 4.23: MSE values for the CLLM model based in real data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0.2061 0.4546 0.4711 0.2753 2.0015 0.0063 1.626 0.6187

Tvap 0.4382 0.1148 0.0942 0.0604 0.0161 0.0031 0.25 0.3437 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 0.1664 2.7104 0.3998 0.452 0.4938 0.6357 0.482 0.3751

Tvap 0.5744 0.2355 0.3455 0.1039 0.1317 0.071 0.1112 0.0877

The responses compared to the first principles model only show an acceptable behavior in simula- tions of real experiments, and only in output Tvap (Figure 4.18). Comparing to real data, and discarding the set of original data of the model, the experiments of February 26th and March 24th show good results, even if March 24th has the recurrent problem of the

43 Table 4.24: VAF values for the CLLM model based in real data

Feb.26 Mar.17 Mar.24 Mar.31 Feb.26[R] Mar.17[R] Mar.24[R] Mar.31[R]

Tebul 0 42.35 47.87 0 79.17 97.53 72.52 60.37

Tvap 20.73 91.38 91.47 98.51 95.84 99.04 83.44 78.78 Fv fR fReflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

Tebul 00 50.51 0 0 0 0 0

Tvap 0 0 92.28 60.72 47.09 74.56 53.84 66.80

offset.

Output 86.5 CLLM[Real]

[ºC] 86

ebul 85.5 T 85

0 50 100 150 200 minutes

Output 83.5 CLLM[Real] 83 [ºC] 82.5 vap T 82

0 50 100 150 200 minutes

Figure 4.18: Estimated outputs (dashed line) of the CLLM model based in real data to the simulation of March 17th

87 Output CLLM[Real] 86 [ºC] 85 ebul T 84

0 50 100 150 minutes

84 Output CLLM[Real]

[ºC] 83 vap T 82

0 50 100 150 minutes

Figure 4.19: Estimated outputs (dashed line) of the CLLM model based in real data to March 24th experiment

44 4.6 Discussion of results

Comparing the results obtained for all types of models in an overall view, the best results were obtained with the models based on simulated data. The FM, CLLM and linear models offered acceptable results for various simulations and also in the case of some specific real experiments. The comparison of the performance values for these models compared to simulated data sets is represented in Figures 4.20 and 4.21.

FM CLLM Linear

100

98

96

94

92

90 Feb.26 Mar.17 Mar.24 Mar.31 flow power reflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

(a) Tebul

FM CLLM Linear

100

98

96

94

92

90 Feb.26 Mar.17 Mar.24 Mar.31 flow power reflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

(b) Tvap

Figure 4.20: Comparison between VAF values for models applied to simulations

FM CLLM Linear

0.05

0.04

0.03

0.02

0.01

0 Feb.26 Mar.17 Mar.24 Mar.31 flow power reflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

(a) Tebul

FM CLLM Linear

0.05

0.04

0.03

0.02

0.01

0 Feb.26 Mar.17 Mar.24 Mar.31 flow power reflux Ite.1 Ite.2 Ite.3 Ite.4 Ite.5

(b) Tvap

Figure 4.21: Comparison between MSE values for models applied to simulations

45 The models obtained from real experiments often provided an acceptable performance when com- pared to real data, especially for the original data set used in training, however when compared to simulated data sets the results were not satisfying. The performance values, for this models and for the models built with simulated data, when compared with real experiments, are presented in Figures 4.22 and 4.23.

FM CLLM Linear FM [Real] CLLM [Real] Linear [Real]

100

80

60

40

20

0 Feb.26 [Real] Mar.17 [Real] Mar.24 [Real] Mar.31 [Real]

(a) Tebul

FM CLLM Linear FM [Real] CLLM [Real] Linear [Real]

100

80

60

40

20

0 Feb.26 [Real] Mar.17 [Real] Mar.24 [Real] Mar.31 [Real]

(b) Tvap

Figure 4.22: Comparison between VAF values for models applied to real experiments

FM CLLM Linear FM [Real] CLLM [Real] Linear [Real]

2

1.5

1

0.5

0 Feb.26 [Real] Mar.17 [Real] Mar.24 [Real] Mar.31 [Real]

(a) Tebul

FM CLLM Linear FM [Real] CLLM [Real] Linear [Real]

1

0.8

0.6

0.4

0.2

0 Feb.26 [Real] Mar.17 [Real] Mar.24 [Real] Mar.31 [Real]

(b) Tvap

Figure 4.23: Comparison between MSE values for models applied to real experiments

46 For simulated data the model obtained by a linear approach often has results similar to the nonlinear models, specially the values for Tvap in the case of simulations of real experiments (Figures 4.24a through 4.24d), where it has the best values for VAF.

85.8 Ouput 85.8 Ouput 85.6 FM 85.6 FM 85.4 CLLM 85.4 CLLM [ºC] Linear [ºC] Linear 85.2 85.2 ebul 85 ebul T T 85 84.8 84.8 84.6 0 50 100 150 200 0 50 100 150 200 minutes minutes

Ouput 83.5 Ouput 83.5 FM FM CLLM 83 CLLM [ºC] 83 Linear [ºC] Linear 82.5 vap 82.5 vap T T 82

82 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) February 26th (b) March 17th

85.8 Ouput 85.8 Ouput 85.6 FM 85.6 FM 85.4 CLLM CLLM [ºC] [ºC] Linear 85.4 Linear 85.2 85.2 ebul ebul T T 85 85 84.8 84.8 0 50 100 150 200 0 50 100 150 200 minutes minutes

83.5 Ouput 83.5 Ouput FM FM 83 CLLM 83 CLLM [ºC] Linear [ºC] Linear 82.5 82.5 vap vap T 82 T 82

0 50 100 150 200 0 50 100 150 200 minutes minutes

(c) March 24th (d) March 31th

85.8 Ouput 85.8 Ouput FM FM 85.6 CLLM CLLM [ºC] 85.4 Linear [ºC] 85.6 Linear ebul ebul

T 85.2 T 85.4 85 0 100 200 300 400 0 100 200 300 400 minutes minutes 83.8 83.8 Ouput Ouput FM FM CLLM 83.7 CLLM

[ºC] 83.7 Linear [ºC] Linear vap vap

T 83.6 T 83.6

0 100 200 300 400 0 100 200 300 400 minutes minutes

(e) flow (f) power

Figure 4.24: Overlayed estimated outputs from the simulation based models to simulations

However, when facing the various iterations of white noise (Figures 4.24g through 4.24l), the results tend to get worse. In particular, Tebul in Figure 4.24k is the best example of how nonlinear models work better than the linear in the presence of abrupt changes of the output variables.

47

85.8 Ouput Ouput 85.6 FM 85.5 FM CLLM CLLM

[ºC] 85.4 Linear [ºC] Linear 85.2 85 ebul ebul T 85 T 84.5 84.8 0 100 200 300 400 0 200 400 600 800 1000 minutes minutes

83.5 Ouput Ouput FM 83.5 FM 83 CLLM 83 CLLM [ºC] Linear [ºC] Linear 82.5 82.5 vap vap T 82 T 82 81.5 0 100 200 300 400 0 200 400 600 800 1000 minutes minutes

(g) reflux (h) 1st noise iteration

Ouput Ouput 85.5 FM 85.5 FM CLLM CLLM [ºC] Linear [ºC] Linear 85 85 ebul ebul T T 84.5 84.5

0 200 400 600 800 1000 0 200 400 600 800 1000 minutes minutes

83.5 Ouput 83.5 Ouput FM FM 83 CLLM 83 CLLM [ºC] Linear [ºC] Linear 82.5 vap 82.5 vap T T 82 82

0 200 400 600 800 1000 0 200 400 600 800 1000 minutes minutes

(i) 2nd noise iteration (j) 3rd noise iteration

85.8 Ouput Ouput 85.6 FM 85.5 FM 85.4 CLLM CLLM [ºC] [ºC] 85.2 Linear Linear 85 ebul ebul 85 T T 84.8

84.6 84.5 0 200 400 600 800 1000 0 200 400 600 800 1000 minutes minutes

83.5 Ouput 83.5 Ouput FM FM 83 CLLM 83 CLLM

[ºC] Linear [ºC] Linear 82.5 82.5 vap vap T 82 T 82

0 200 400 600 800 1000 0 200 400 600 800 1000 minutes minutes

(k) 4th noise iteration (l) 5th noise iteration

Figure 4.24: Overlayed estimated outputs from the simulation based models to simulations (cont.)

These models applied to real experiments have similar results: similar dynamic behavior, but also an offset. This condition occurred because the feed composition (xF ) was not constant between and during experiments, and this was not taken into account during the modeling process. The effect that a variation in this variable would have in the process was not completely known, but as can be seen in the Figure 4.26 it creates an offset in temperatures, specially Tebul. Since the models th th were built using xF closer to the values used in March 17 and March 24 it is normal that results for these days present are better.

48

86 Ouput 87 Ouput FM FM CLLM CLLM

[ºC] 84 Linear [ºC] 86 Linear ebul ebul T T 82 85

0 50 100 150 0 50 100 150 minutes minutes

Ouput Ouput 83.5 FM 83.5 FM CLLM 83 CLLM [ºC] 83 Linear [ºC] Linear 82.5 vap 82.5 vap T T 82

82 0 50 100 150 0 50 100 150 minutes minutes

(a) February 26th (b) March 17th

88 Ouput Ouput 85.5 FM FM 87 CLLM CLLM 85 [ºC] Linear [ºC] Linear 84.5 86 ebul ebul T T 84 85

83.5 0 50 100 150 0 50 100 150 minutes minutes

Ouput 84 Ouput 83.5 FM FM 83 CLLM CLLM [ºC] [ºC] 82.5 Linear 83 Linear vap vap

82 T T 82 81.5

0 50 100 150 0 50 100 150 minutes minutes

(c) March 24th (d) March 31th

Figure 4.25: Overlayed estimated outputs from the simulation based models to real experiments

85.8 83.625 Original used Original used Feb. 26th [xf=0.098] Feb. 26th [xf=0.098] 85.7 83.62 Mar. 17th [xf=0.0911] Mar. 17th [xf=0.0911] th th Mar. 24 [xf=0.0911] 83.615 Mar. 24 [xf=0.0911] 85.6 Mar. 31st [xf=0.10314] Mar. 31st [xf=0.10314] 83.61

ebul 85.5 ebul T T 83.605 85.4 83.6

85.3 83.595

85.2 83.59 0 20 40 60 80 100 0 20 40 60 80 100 minutes minutes

(a) Tebul (b) Tvap

Figure 4.26: Simulation of the effect of the change in the feed composition in both temperatures

It is possible to say that for slow variations in the input variables a linear model is capable of predicting the system dynamics. The nonlinear models show their advantage in the case of quick variations, where not even a higher order in the linear system is capable of simulate the complete system dynamic behavior. In the case of models derived from real data compared to real experiments, as already said, the models have good results for their original data set but often lose their extrapolation capabilities, which

49 can be seen from the offset that appears when comparing to other data sets. This tendency is shown by the FM model in Figure 4.27d, the CCLM model in Figure 4.27b and the linear model in Figure 4.27c.

Ouput 88 Ouput FM [Real] FM [Real] 90 CLLM [Real] CLLM [Real] [ºC] Linear [Real] [ºC] Linear [Real] 88 86 ebul ebul T T 86 84 0 50 100 150 0 50 100 150 minutes minutes

84 Ouput Ouput FM [Real] 83 FM [Real] 83 CLLM [Real] CLLM [Real]

[ºC] Linear [Real] [ºC] Linear [Real] 82 vap vap

T 82 T 81

0 50 100 150 0 50 100 150 minutes minutes

(a) February 26th (b) March 17th

88 Ouput 91 Ouput FM [Real] 90 FM [Real] CLLM [Real] CLLM [Real]

[ºC] 86 Linear [Real] [ºC] 89 Linear [Real]

ebul ebul 88 T T 84 87

0 50 100 150 0 50 100 150 minutes minutes

Ouput 85 Ouput 84 FM [Real] FM [Real] CLLM [Real] 84 CLLM [Real] [ºC] 83 Linear [Real] [ºC] Linear [Real] vap vap T T 83 82

82 0 50 100 150 0 50 100 150 minutes minutes

(c) March 24th (d) March 31th

Figure 4.27: Overlayed estimated outputs from the real data based models to real experiments

Nevertheless, in an overall view, the CLLM model offer the best results in terms of VAF , with empha- sis in the case of Tebul (Figure 4.27).

50 Chapter 5

Model Based Control

This chapter presents the control techniques used in this work. It starts by presenting a linear MPC which is compared with various forms of nonlinear NMPC. First a NMPC using B&B is developed to find the best control action using both FM and CLLM models, and then a composition of a single linear MPC for each of the local linear model present in CLLM. Each controller is tested with and without restricted control actions in order to compare an ideal behavior of the column to a more realistic performance.

5.1 Problem description and assumptions

The first considerations taken into account were the bounds of the control actions. In order to main- tain the system in a feasible range the bounds chosen were the same used in the modeling section, presented in Table 4.3. The cost function provided in all controllers was based in Equation 2.13, which was modified into Equation 5.1. The values for the weights α(i) and β(i) are presented in Table 5.1 and were defined as constants over Hc and Hp, respectively the control and predictive horizons.

Hp Hc J(u) = α(r(k + i k) yˆ(k + i k))2 + β(∆u(k + i 1 k))2 (5.1) | − | − | i=1 i=1 X X Several values were tested, including equal weights, but the values chosen provided the best results in the relation control vs. computational effort. The weight α was the same for every output errors and the same occurred with β for variations of control actions, to ensure that the controller had focus on reference tracking in both temperatures. The values for both horizons considered that B&B is very time consuming: the number of possible branches to be opened increased exponentially with Hc and a high Hp increased the cost function, forcing more branches to be opened. The values chosen are shown in Table 5.1. These values were used in all tested controllers. The control action discretization in B&B also has implications in the number of branches opened, therefore it was set to 3.

51 Table 5.1: Parameters chosen for MPC/NMPC

Property Symbol Value Output error weight α 100 Variation in control action weight β 1

Control Horizon Hc 2

Prediction Horizon Hc 4

Maximum Variation of Control Action ∆umax ∞ or 0.01× (umax − umin) Control Action Discretization 3

With the objective of testing the controllers and both maintaining the column at a given state as well as moving between states, a reference trajectory with two steps in both temperatures was made. The first step had a downward direction with an amplitude of 1 ◦C in both temperatures. The second step had the same amplitude but in an upward direction, in order to see the different behavior between increasing and decreasing temperatures. This reference is presented in Figure 5.1. It is important to notice that the reference provided to the controller uses the nominal values, which means, passing from 0 to 1. − The performance was determined using VAF (eq. 2.14), MSE (eq. 2.15), Settling Time with a 4% criteria (TS5%) and computational effort. This effort was determined from the highest computational time for the functions used while in simulation.

86

85.5 [ºC]

ebul 85 T

84.5 0 50 100 150 200 minutes 84

83.5 [ºC]

vap 83 T

82.5 0 50 100 150 200 minutes

Figure 5.1: Reference used to test the controllers

Table 5.2 presents both hardware and software used to deploy the controller. The software version used was MATLAB R R2007a with Simulink R version 6.6. The models based in ANN were not used in this part of the work, since the modeling results were not satisfactory. Also the original ANN Predictive Controller from MATLAB R could not be used because, the current version is limited to a network with only one output and one hidden layer.

52 Table 5.2: Characteristics of the PC used in all control schemes

Operating System Windows XP Professional (5.1, Build 2600) Service Pack 3 System Manufacturer NEC Computers International BIOS BIOS Date & 01/25/06 18 &25 &19 Ver & 0.54 Processor Intel(R) Pentium(R) D CPU 3.00GHz (2 CPUs) Memory 2040MB RAM Page File 445MB used, 3485MB available

5.2 MPC based in linear model

The application of the linear model in a controller was implemented using the MPC block available in Simulink R from the Model Predictive Control ToolboxTM V2.2.4. The controller was tested using the parameters expressed in Table 5.1.

Unrestricted control actions

The first implementation of the controller did not have restrictions in control actions (∆u = ), ∞ besides their range. This means that whatever the control action chosen by the controller, it was directly implemented to the column.

The control actions for the controller in this configuration are displayed in Figure 5.2a, while the outputs of the system for these inputs are shown in Figure 5.2b.

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.2: Control by MPC without restricted control actions

The figures show that Tvap is much quicker to reach the desired temperature, but has also an over- shoot. Since Tvap reaches the desired reference, the controller is able to continue reducing Tebul while maintaining Tvap. The performance values for this case are given in Table 5.4.

53 Restricted control actions

Since we are leading with a chemical system, which is constituted by liquid and vapor flows, valves, etc, it is impossible to have fast dynamics of the control actions as it is for the case of the steps shown in Figure 5.2a. To overcome this problem, and therefore simulate a more realistic response of the real system, it was implemented a restriction in the output of the controller that limited the control action relatively to the previous instant. This limit was imposed as one hundredth of the range of each input, 0.01 (u u ), and was × max − min implemented outside of the controller, thus simulating the actual computational time and slower response of the system. The controller responses and systems outputs are illustrated in Figure 5.3. It is possible to see a slower response of the temperatures, due to less aggressive control actions, with the previous steps being replaced by ramps. This leads to a lower VAF and a higher MSE for both temperatures. The overshoot mentioned in the previous case is now greater.

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.3: Control by MPC with restricted control actions

In Table 5.4 it is presented the performance values for the MPC with restricted control actions.

Restricted control actions with different horizons

Since this controller had a fast computational time, other horizons were tested in order to see if there were a better response from the system. The new horizons are expressed in Table 5.3, and the control action and responses in Figure 5.4.

Table 5.3: Alternative control and predictive horizons

Property Symbol Value

Control Horizon Hc 5

Prediction Horizon Hp 10

54 1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.4: Control by MPC with restricted control actions and different horizons

It can be seen that the responses from the system are very similar to the case with the smaller horizons. From the performance values of Table 5.4 it is possible to calculate that an increase of 0.3 seconds (0.1 (5-2)) in the control horizon and 0.6 in the predictive horizon will reflect a maximum decrease of × 1.8 seconds in the settling time for the first step of Tebul. However it also increased the settling time of

Tvap in the same step, because it took more time to eliminate the offset after the overshoot.

The settling time for the second step were both decreased by 0.6 second, exactly the same as Hp.

Table 5.4: Performance values for linear MPC

without restrictions with restrictions HC = 5 & HP = 10 w. restrict.

Tebul 60.92 35.29 39.54 VAF Tvap 83.55 64.19 67.86

Tebul 0.0681 0.1109 0.1039 MSE Tvap 0.0358 0.0726 0.0658

Tebul 39.49 47.50 44.47 TS 5% for first step [s] Tvap 20.37 30.29 30.79

Tebul 124.98 129.14 128.48 TS 5% for second step [s] Tvap 107.88 109.61 109.00 Computational time [s] 160 167 166

5.3 NMPC with B&B

The B&B algorithm uses a simulation of the system output to find the best control action. Having this in mind, it is essential to have a model with good predictive and simulation response, which is the case for both FM and CLLM models. The negative aspect is the simulation speed, which could be very slow, being a very important issue in a possible implementation of this controller in the experimental plant.

55 Another problem when dealing with B&B is the number of branches opened. Since for each branch opened a simulation is made, the number of opened branches contributes for the computational effort (and time) of the controller. The toolbox used for these controllers was originally design by Mendonc¸a et al. [20] but it had to be modified in order to cope with the use of CLLM models and the implementation within Simulink R environment. This modifications are presented in Section B

5.3.1 B&B using FM models

The simulation of the FM model inside B&B was the first to be tested, being used the model chosen in Section 4.4.1. This model had a maximum delay of 3 steps (ny = 1, nu = 3 and nd = 1) so the controller had to store the previous 3 inputs and outputs.

Unrestricted control actions

The response of the system is given in Figure 5.5b and the control actions in Figure 5.5a. The performance values are given in Table 5.5.

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.5: Control by B&B with FM model and unrestricted control actions

Similarly to the case of linear MPC, this case is purely hypothetical and considers using a perfect control action. However it is possible to see that the overshoot in the first step for Tvap is not present here, which was the case with linear MPC. This leads to a lower settling time, even lower than half of the value in linear MPC. Notice that computational time was very high, even if it is similar to the reference time. If we take in account that simulations in Simulink R are based in seconds and for some instants the computational time is very low (e.g. in the beginning of the simulation) it is clear that, in some moments, the time to get the response of the controller is bigger that the sample time (compared in minutes) of the model, which does not allow to use this controller in the experimental plant as expected. The computational effort increases with the number of branches opened, which can be seen in Figure 5.6. It is clear that much of the effort is done in both steps, where all the possible branches are opened,

56 27 in the first instant and 729 in the second.

800 Instant 1 Instant 2 600

400

200 N. of branchs opened 0 0 50 100 150 200 minutes

Figure 5.6: Number of branches opened by B&B when using FM models with restricted control actions

Restricted control actions

In this case the limitation was not present in the B&B algorithm since it would decrease the gap between the cost of each branch, thus increasing the number of branches opened during all simulation leading to an even greater computational time. Instead the restriction was installed after the controller functioning as a rate limiter. Even if the restriction was applied after the decision of the B&B, the actual control action given to the plant was feeded back to B&B in order to calculate the cost function properly. The system was tested with the same maximum variation amplitude of one hundredth of the range and the output can be seen in Figure 5.7b, the control action in Figure 5.7a and the performance values in Table 5.5.

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.7: Control by B&B with FM model and restricted control actions

In Figure 5.7b it is possible to see a slower response of the system, due to the more slower variation from each input (Figure 5.7a), leading to a lower VAF and a higher MSE. However the behavior in each level has become more stable, even if there is an overshoot in the first step of Tvap. The computational time also increased, because there was an increase in the time interval where the number of branches opened reached its maximum, as shown in Figure 5.8.

57 800 Instant 1 Instant 2 600

400

200 N. of branchs opened 0 0 50 100 150 200 minutes

Figure 5.8: Number of branches opened by B&B when using FM models with restricted control actions

Table 5.5: Performance values for B&B with FM model

without restrictions with restrictions

Tebul 60.93 35.59 VAF Tvap 82.95 64.08

Tebul 0.0688 0.1121 MSE Tvap 0.0367 0.0706

Tebul 39.99 47.83 TS 5% for first step [s] Tvap 18.70 28.79

Tebul 126.96 131.34 TS 5% for second step [s] Tvap 107.53 109.29 Computational time [s] 14060 15726

5.3.2 B&B using CLLM models

The same control strategy was applied using the CLLM model chosen in Section 4.4.2. Since the main objective is to compare the performance of these model based controllers, the same characteristics presented in Tables 5.1 will be used in this case. Both possibilities, with or without restrictions in actuator variations, were tested, to see if, as in FM models, there were substantial differences.

Unrestricted control actions

In the case of unrestricted control actions, the procedure was the same as in the previous section, the outputs selected by the B&B algorithm were feeded directly to the distillation column without the concern of experimental feasibility due to such action. The responses and control actions can be seen in Figures 5.9b and 5.9a, the number of branches opened in Figure 5.11a and the performance parameters in Table 5.6 Contrary to the controller based in FM models, this one already have a overshoot, however it is lower than the overshoot from the linear MPC, which lead to a settling time more closer to the one reached by B&B with FM.

58 1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.9: Control by B&B with CLLM model and unrestricted control actions

Restricted control actions

To ensure the controller performance, while in case of slower response for the control valves, i.e. the experimental case, it was tested a control loop with the same restriction conditions described before. The results for this control strategy are presented in Figures 5.10 and 5.6, and in Table 5.6

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.10: Control by B&B with CLLM model and restricted control actions

800 800 Instant 1 Instant 1 Instant 2 Instant 2 600 600

400 400

200 200 N. of branchs opened N. of branchs opened 0 0 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Unrestricted control actions (b) Restricted control actions

Figure 5.11: Number of branches opened by B&B when using CLLM models

59 The effect of the restrictions had the same effect as in the previous controllers, but in this case the overshoot was bigger compared to the FM model.

Table 5.6: Performance values for B&B with CLLM model

without restrictions with restrictions

Tebul 60.53 34.88 VAF Tvap 83.16 63.61

Tebul 0.0690 0.1118 MSE Tvap 0.0370 0.0731

Tebul 40.33 47.12 TS 5% for first step [s] Tvap 21.63 30.52

Tebul 125.80 130.41 TS 5% for second step [s] Tvap 107.78 110.29 Computational time [s] 2182 2387

5.3.3 Time comparison between models used by B&B

The controller responses in each case were very similar. The most main difference was the compu- tational time. As in FM models, the controller using CLLM increased the number of branches opened from the case without restrictions to the case with restrictions in control actions. However, both simulations with the controller based in CLLM models were much quicker than the ones using the FM model, about 16% of its total time.

5.4 NMPC with a composition of MPC’s

In order to find a smaller computational time for a nonlinear controller the next control structure that was tested consisted in using a composition of MPC’s. Since the MPC structure of MATLAB R is optimized, the use of this controllers should provide the desired outcome. The control action given to the column was based in the theory of CLLM, where a linear MPC is responsible for each local model. The overall control action resulted from a weighted combination using a scheduling vector, based in the previous control action. The control loop of this controller is represented in Figure 5.12. This controller could not be compared to B&B in a fairly way, because the last one is not a compiled code. However the comparison with the linear MPC can be done in even terms.

Unrestricted control actions

Similarly to the other controllers, the first situation tested was to calculate the control action and giving it directly to the column, without any restriction, therefore giving the opportunity to compare them

60 ref u MPC1 u1 y (sys1) ref ref MPC2 u u y u 2 Scheduling System y (sys2)

ref u MPC3 u3 y (sys3)

Figure 5.12: Control loop for MPC based in CLLM theory in terms of performance, computational time and smoothness of control action. The response is given in Figure 5.13b, the control action in Figure 5.13a and the performance values in Table 5.7. The contribution of each model along the simulation is given in Figure 5.14

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.13: Control by a composition of MPC’s with unrestricted control actions

It is possible to see a smother control action in some time ranges, but also abrupt changes due to steps in the reference. It is also possible to observe, that in the beginning of the simulation there is a substantial variation in fR, which was caused by the variation in the weights of models 2 and 3, as shown in Figure 5.14.

61 1 Model 1 Model 2 Model 3 0.8

0.6

weight 0.4

0.2

0 0 50 100 150 200 minutes

Figure 5.14: Scheduling vector for unrestricted CMPC

Restricted control actions

The application of the restriction in this case was made after the scheduling vector. This means that, as in B&B, each controller chose a value from the full range, with the restriction being applied in form of rate limiter in the output of the global controller. This configuration induced the controller in mistake, since each MPC was feeded back with their own control action instead of the one given to the column, however the scheduling vector is maintained updated since it knew the real control action of the previous moment. The response of the system to the restricted outputs is presented in Figure 5.15b, the control actions in Figure 5.15a, the weight of each MPC is given in Figure 5.16 and the performance values in Table 5.7

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.15: Control by a composition of MPC’s and restricted control actions

The output of the system was slower than before, like in the previous controllers, with an overshoot lower than the one obtained by B&B with CLLM. The performance of the controller is similar to the performance of B&B controllers.

62 1 Model 1 Model 2 Model 3 0.8

0.6

weight 0.4

0.2

0 0 50 100 150 200 minutes

Figure 5.16: Scheduling vector for restricted CMPC

The variation in fR in the beginning of the simulation is now slower, but the rest of the control actions are similar (except the steps replaced by a ramps).

Restricted control actions with different horizons

Since this controller is much quicker than others based in B&B, about 6% of the time required by B&B with CLLM and only 1% of B&B with FM, different control and predictive horizons could be tested without increasing to much the computational time. The alternative horizons from Table 5.3 applied in this controller gave the control actions and outputs from Figure 5.17 and the performance values expressed in Table 5.7.

1.5

v 85.5 F 1 [ºC]

0 50 100 150 200 ebul 85 minutes T 0.3 84.5 0 50 100 150 200 minutes fR 0.25 0 50 100 150 200 minutes 83.5

0.6 [ºC] 83 vap

0.4 T

fReflux 82.5 0.2 0 50 100 150 200 0 50 100 150 200 minutes minutes

(a) Control actions (b) Response of the system

Figure 5.17: Control by CMPC with restricted control actions and different horizons

The control actions were similar to the ones given by smaller horizons, which lead to similar outputs, but in this case there is a comprehensive lower Settling Time, about 0.6 minutes. The exception appear in the case of the first step of in Tvap, where it is more difficult to compensate the overshoot. This

63 phenomenon already happens in the case of one MPC.

The computational time did not increased, but in fact decreased, which means that increasing Hc and Hp will not have a great impact in terms of how fast the controller can perform.

Table 5.7: Performance values for CMPC

without restrictions with restrictions Hc = 5 and Hp = 10 with restrictions

Tebul 61.33 35.72 39.25 VAF Tvap 83.91 64.74 67.72

Tebul 0.0675 0.1102 0.1042 MSE Tvap 0.0353 0.0717 0.0658

Tebul 36.29 45.43 43.44 TS 5% for first step (s) Tvap 79.74 29.58 41.11

Tebul 125.02 129.15 128.56 TS 5% for second step (s) Tvap 108.05 109.77 109.25 Comp.time(s) 138 164 157

5.5 Discussion of results

Comparing the results for the case of restricted control actions in all controllers, which is intended to simulate the actual behavior from the control variables, it is possible to see that performances are quite similar. In terms of VAF (displayed in Figure 5.18) it is possible to see that CMPC model has the best results for both temperatures. Between the B&B controllers, the FM based has the best result, probably due to the higher overshoot of the CLLM based controller. The linear model has similar results to B&B with FM, which means that during the entire simulation this controller compensates the overshoot, exactly what B&B with CLLM does not do even if both have similar overshoot. It is important to notice that VAF has low values, compared with those achieved by the models, because this is a control problem, where the system response is slow. If the reference was longer these values would increase because the settling time would be inferior relatively to the reference length.

In the case of MSE, B&B with FM has the best result in Tvap due to the already referred overshoot, however in the case of Tebul it has the worse performance because, in the second step, this controller was the only one where the output went above the reference.

Considering both settling times for Tebul there is a tendency for the controllers with B&B to take longer to reach the desired reference. This happens because the control actions, instants before the step, put the temperature a little above the reference (Figure 5.22a), which means that at the start of the step the temperature is not at the same level as in the other two controllers, which have more precise control actions.

In the case of Tvap, the offset in Tebul is now an advantage for B&B with FM, which has the best

64 40 70

35 65 B&B FM restricted B&B CLLM restricted 30 60

VAF VAF CMPC restricted MPC restricted 25 55

20 50 T_ebul T_vap

Figure 5.18: VAF values for the constrained controllers (more is better)

0.13 0.1

0.125 0.09 0.12 0.08 B&B FM restricted B&B CLLM restricted 0.115

MSE MSE CMPC restricted 0.07 MPC restricted 0.11

0.105 0.06

0.1 0.05 T_ebul T_vap

Figure 5.19: MSE values for the constrained controllers (less is better)

50 25

45 20 B&B FM restricted B&B CLLM restricted 40 15 CMPC restricted

Seconds Seconds MPC restricted 35 10

30 5 T_ebul T_vap

st Figure 5.20: 1 TS 5% for the constrained controllers (less is better) settling time. In the case of the first step there is also an overshoot, which is lower for this controller and CMPC (shown in Figure 5.22b), exactly the controllers with the best values in this case. The use of Fuzzy Filters [34] to overcome the problem from Figure 5.22a, would increase the compu- tational time. This would happen because the control actions were going to be closer, leading to similar costs between branches which ultimately leads to a higher number of branches opened. The time of this filter was not worthed, considering the results obtained.

65 60 40

55 35 B&B FM restricted B&B CLLM restricted 50 30 CMPC restricted

Seconds Seconds MPC restricted 45 25

40 20 T_ebul T_vap

nd Figure 5.21: 2 TS 5% for the constrained controllers (less is better)

82.8 85.8 Reference Reference B&B FM 82.7 B&B FM [ºC] 85.75 B&B CLLM [ºC] B&B CLLM 82.6 vap ebul CMPC CMPC

85.7 T T MPC 82.5 MPC 85.65 6 8 10 12 14 20 30 40 minutes minutes

(a) Temperature controlled by B&B with FM above (b) Overshoot from the controllers in Tvap for the first zero step

Figure 5.22: Details in the comparison of controllers

5.5.1 Computational time

The main difference between the controllers is the computational time, where the models based in the MPC from MATLAB R take less computational time. The values are displayed in Figure 5.23 (note the logarithm scale in the y axis).

5 10

4 10

3 10 B&B FM restricted B&B CLLM restricted

2 CMPC restricted

Seconds 10 MPC restricted

1 10

Computational time

Figure 5.23: Computational time for the constrained controllers (less is better)

In the case of B&B, the CLLM based controller has a smaller simulation time. The possibility of a minor number of branches opened could be the justification of such improvement, but, as can be seen in the comparison between the Figure 5.8 and the Figure 5.11b those are quite the same. A study of computational burden can be conducted with the help of the function profile. Table 5.8 presents the 4 most time consuming functions during the simulation of the restricted controllers based

66 in FM and CLLM models.

Table 5.8: Profile summary for B&B with FM and CLLM models

Function Name Calls Total Time Self Time Controller with FM model NMPC_Sx 4003 15726.478 s 0.390 s NMPC_Sx>mdlUpdate 2001 15725.839 s 1.262 s MNPC...\bbm 584989 15690.867 s 268.352 s fmsim 1990829 15266.652 s 1873.650 s Controller with CLLM model NMPC_Sx 4003 2386.773 s 0.432 s NMPC_Sx>mdlUpdate 2001 2386.079 s 0.864 s MNPC...\bbmCLLM 630531 2382.391 s 304.126 s simloc 2135913 1507.018 s 315.190 s

The functions NMPC_Sx and NMPC_Sx>mdlUpdate are the functions running inside the controller block, responsible for compute its output and update it, but, as it can be seen they, are not responsible for much of the time spend by the simulation (see Self Time). The functions bbm and bbmCLLM are the application of the B&B algorithm with FM and CLLM models respectively. Much of the time in simulation was spent in them but in the case of the FM model 97% of the time spent is simulating the model (function fmsim), while in the case of the CLLM model only 63% of the time is spent with the simulation of the model (function simloc). This means that in fact, the simulation of the FM model is the most responsible for the high compu- tational time, even if its called less times than the correspondent function in CLLM. Note that a higher number of Calls means that more branches were opened.

67 68 Chapter 6

Fault Tolerant Control

The fault tolerant control is presented in this chapter. It starts by defining the simulated fault, the implemented detection mechanism and the reconfiguration of the controller. The results of these steps are presented in the final section.

6.1 Problem description

A single fault will be considered in this work. An equipment failure in the feed flow valve (input Fv) will be simulated as a stuck valve, leaving only fR and fReflux as workable control actions. This failure is considered as an abrupt failure. In this section, the reference used had to be changed, since the reference used before push the system and control actions to a state where was impossible to get out from the failure situation. The reference is therefore replaced by a ramp, instead of a step, with a new limit for both temper- atures. Figure 6.1 shows the selected trajectory for the reference and the response of the controlled system outputs.

85.8 Reference 85.6 Simple Controller 85.4 ebul

T 85.2 85

0 20 40 60 80 100 minutes

83.6 Reference Simple Controller 83.4

vap 83.2 T 83

82.8 0 20 40 60 80 100 minutes

Figure 6.1: Reference and response of the system without any failure

69 Both the CLLM model and the CMPC controller proved to have acceptable behaviors when compared to the other algorithms. Since they had the best performance in terms of computational load, they were chosen to be used in this part of the work.

6.1.1 Fault Detection

The detection of the valve failure is made by monitoring the error between the column and the model outputs. In a normal experience this error is limited within a certain range, even with the noise from the measurements. In this case it is possible to observe the evolution of the error and impose a limit of acceptance

(represented by errorlim in Algorithm 6.1). Figure 6.2 shows the evolution of the error between the First Principles Model and the CLLM model.

0.05 Fault Treshold ebul 0

Fault Treshold error in T −0.05 0 20 40 60 80 100 minutes 0.1 vap 0 error in T −0.1 0 20 40 60 80 100 minutes

Figure 6.2: Error between the model and the system outputs

The error in output Tebul is smaller, and since the CLLM model has a better behavior in this output, as demonstrated in Figure 4.24e, it will be used to monitor the fault condition.

The error reaches 0.033 in the case of Tebul and 0.06 in Tvap. The limit of acceptable error is define as 0.035, which means that when the error exceed this limit the identification algorithm will try to identify the fault.

6.1.2 Fault Identification

The identificatioln of failure is achieved by running multiple models in parallel with various possible faults. The identification of the fault is limited to the range of trained failures. The validation of the faulty model results from computing the VAF between the simulated output and the real output of the previous instants, see Algorithm 6.1. This value of VAF also has a threshold, which determines whether or not the fault selected is comparable to the real situation. In order to avoid failing to identify a not trained faulty model, it is possible to lower the limit of ac- ceptable VAF, represented by V AFlim. This way the actual fault is not identified, but instead the closest

70 monitored fault, allowing the controller to be reconfigured, improving its performance relatively to the new situation.

Algorithm 6.1 Fault Identification if y yˆ error and state(failure) = FALSE then | − | ≥ lim for i = 1 to number of failures to test do y(i) =simulation(failure(i)) V AF (i) = VAF(y,y(i)) end for V AF = max(V AF (i)) value(failure) = failure(i) max ⇒ if V AF V AF then max ≥ lim state(failure) = TRUE Redefine Controller end if end if

The model used during the execution of Algorithm 6.1 is also the CLLM model which, was already mentioned in Section 5.5, is not a high time consuming task. In the eventuality of a non identification of the failure, it is possible to determine some limits, such as maximum numbers of tested validations or maximum error y yˆ allowed, which, when passed, | − | executes the procedures to shutdown the column.

6.1.3 Control Reconfiguration Mechanism

After fault identification, it is necessary to reconfigure the controller in order to account for this new situation. Using the MPC object from MATLAB R , Fv changes from a controllable input in the system to a measured disturbance, which means that the controller has the awareness of the current situation and adapts the control actions to it.

(a) Before failure (b) After failure

Figure 6.3: Changes in control loop

The weights in the controller can be the same used in the faultless case, or they can be changed, taking into account that, in a fault situation, the desired operating conditions may not be possible to achieve.

71 6.2 Results

The evolution of the control action, applied to the faultless system (Figure 6.1) is presented in Figure 6.4 in order to find a suitable failure in Fv. The simulated failure will be the maximum value reach by the input, Fvmax = 1.5, at 30 minutes.

1.5 v

F Fault Situation Normal Situation 1 0 20 40 60 80 100 minutes

Figure 6.4: Control action of F v in the case of a faultless system

The effect that such failure will cause in the system is presented in Figure 6.5b. In this case the controller is not aware that a failure has occurred and tries to control the system using the same config- uration and weights of the original controller.

85.8 1.5 Reference 85.6 Simple Controller v Simple Controller Fault Controller F Fault Controller 85.4 ebul 1 0 20 40 60 80 100 T 85.2 minutes 85 0.3 0 20 40 60 80 100 minutes

fR Simple Controller Fault Controller 0.25 83.6 Reference 0 20 40 60 80 100 Simple Controller minutes 83.4 Fault Controller

0.6 vap 83.2 T 0.4 Simple Controller 83 Fault Controller fReflux 82.8 0.2 0 20 40 60 80 100 0 20 40 60 80 100 minutes minutes

(a) Control actions (b) Response of the system

Figure 6.5: Failure case with a faulty controller

The error evolution near the failure is presented in Figure 6.6. The error passes its limit, errorlim, at 31.2 minutes, which means that the identification algorithm has a dwell time of 1 minute.

0.035 ebul 0

error in T −0.035 Fault Condition 25 27 29 31 33 35 37 minutes

Figure 6.6: Response of the system to a faulty controller

It is important to notice that the number of points used to make the comparison, between the real output and the fault models, can increase the time between the fault detection and the fault identification.

72 The limit conditions of Algorithm 6.1 used in the identification are presented in Table 6.1.

Table 6.1: Limits used in Algorithm 6.1.

Property Symbol Value

Maximum error before fault condition errorlim 0.035

Minimum acceptable VAF V AFlim 75 NumberofpointsusedtocalculateVAF 20 Monitored faults 0, 0.1, 0.2, 0.3, 0.4, 0.5

Using these limits it was possible to find an acceptable fault condition at 31.4 minutes, only 0.2 minutes after the fault detection. The controller is then reconfigured, using the same weights as the original controller, Table 5.1, and taking into account the measurable disturbance. The control actions of the new controller compared with previous are presented in Figure 6.5a. Notice that Fv has the fault value after the this one being identified. It is possible to see that both new and previous controller are similar, which means that using these weights, the controller cannot find a better solution than the previous. The fact that fR has almost no influence in the system outputs, Figure 4.24f, leads to the situation where fReflux has to control both temperatures. In this situation, the rearrangement of the controller weights in order to try to control only one of the outputs can be convenient, if its taken in account that one of the outputs is more relevant than the other.

6.2.1 Tuning of Model Based Controller in case of Tebul

Considering Tebul as the main concern of the control loop, the weights defined in both controllers are replaced by the ones presented in Table 6.2.

Table 6.2: Weights in NMPC cost function

Property Weight Value

Tebul Tebul error α 10000 Tvap Tevap error α 100

Variation in control action βi 1

With this new weights the output Tvap looses almost any chance of following the reference, but Tebul loses the offset from the previous condition. The comparison between the outputs of the controller without awareness of the fault condition and the fault tolerant controller is presented in Figure 6.7b. The response of the system to both controllers is shown in Figure 6.7a.

In the fault controller Tebul is more stable, having an overshoot at the end of the ramp, caused by the failure in Fv. The error is always less than the error of the faulty controller leading to a decrease of 0.000491 to 0.000237 in MSE.

On the contrary, Tvap has an even worst response, increasing MSE from 0.048437 to 0.066086.

73

85.8 1.5 Reference 85.6 Simple Controller v Simple Controller Fault Controller F Fault Controller 85.4 ebul 1 0 20 40 60 80 100 T 85.2 minutes 85 0.3 0 20 40 60 80 100 minutes

fR Simple Controller Fault Controller 0.25 83.6 Reference 0 20 40 60 80 100 Simple Controller minutes 83.4 Fault Controller

0.6 vap 83.2 T 0.4 Simple Controller 83 Fault Controller fReflux 82.8 0.2 0 20 40 60 80 100 0 20 40 60 80 100 minutes minutes

(a) Control actions (b) Response of the system

Figure 6.7: Fault control focused in Tebul

This result is explained by the response of Tebul to the input Fv, which is more significant than the response in Tvap. Thereby, since the controller is now focused in following the reference for Tebul and knows that the failure is influencing the outcome of the control loop, its response is more aggressive in trying to eliminate the error caused by the fault.

6.2.2 Tuning of Model Based Controller in case of Tvap

The selection of weights, needed to tune the controller in order to focus in Tvap, was also tried. The values were αT ebul =100 and αT vap =10000. However, since Fv does not have much influence in this temperature, the information that the failure has occurred is not reflected in the controller. The error improved from 0.000010 to 0.000009. The comparison of the original controller and the fault tolerant controller is presented in Figure 6.8.

85.8 1.5 Reference 85.6 Simple Controller v Simple Controller Fault Controller F Fault Controller 85.4 ebul 1 0 20 40 60 80 100 T 85.2 minutes 85 0.3 0 20 40 60 80 100 minutes

fR Simple Controller Fault Controller 0.25 83.6 Reference 0 20 40 60 80 100 Simple Controller minutes 83.4 Fault Controller

0.6 vap 83.2 T 0.4 Simple Controller 83 Fault Controller fReflux 82.8 0.2 0 20 40 60 80 100 0 20 40 60 80 100 minutes minutes

(a) Control actions (b) Response of the system

Figure 6.8: Fault control focused in Tebul

74 Chapter 7

Conclusions

The final conclusions for this work regarding both modeling and control of the distillation column are presented in this chapter. The chapter ends with suggestions for future work.

7.1 Modeling

Two main types of modeling paradigms were addressed in this work: linear state-space models and nonlinear models, which were estimated directly from experimental data and from simulated data provided by a previously developed First Principles Model implemented in MATLAB R . The linear models built with simulated data proved to have similar dynamics in some cases, but they were not suitable to reproduce dynamics with fast varying inputs. These behaviors were retained only by the nonlinear models, especially using CLLM and FM models. When compared to dynamic data collected from the real distillation column, the predictions of these models agreed with the dynamic behavior presented, but in some cases showed an offset. The models based in real data (Linear, FM and CLLM, models) had similar behavior: for the data set used in the models calibration the outputs were similar, but for the case of real data not used in the models calibration, the dynamic behavior was similar but in some cases there was also an offset. This offset was mainly due to the fact that the composition in the feed stream was not considered as an input in the models, so should be constant for the different experiments and also during the experiments. However, for experimental reasons the premise of constant composition could not be assured for all the different experiments. The ANN models built during this work did not provide the expected results, needing a more complex structure than expected, therefore they were not tuned.

7.2 Control

The controllers tested in this work had similar performances in terms of control. The main difference was the overshoot after the step in the downward direction. The response offered by the controller based

75 in Branch-and-Bound using the FM model was the best, although by the end of that step this controller had an unstable behavior, due to the switching control action which is usual in these controllers. The composition of MPC’s merged the smooth varying control actions of a linear MPC, present in the stable behavior after reaching the step, with the awareness of the nonlinear assumption, obtaining the overall best results.

7.3 Fault Identification and Control

The fault reproduced was a possible failure in the feed flow valve, making it trapped in the maximum value. This failure induced an error in the controller, which did not have awareness of the actual control action given to the distillation column. The fault detection was a simple error threshold between the distillation column and model outputs. After that threshold has been exceeded the Fault Identification algorithm tried to match the system outputs by testing various models with different values as inputs. After the identification of the failure, the controller was reconfigured to consider that input as a mea- sured disturbance instead of a control action. The results proved that the desired operation conditions could not be achieved in this new situation, since the remaining control actions were not capable to guide the two temperatures to the desired reference. This controller showed a improvement from the original controller when one of the temperatures was selected as main concern.

7.4 Future work

Concerning the experimental work, it will be important to ensure that the feed composition will be constant in order to be possible to identify models and validate them with relative certainty. The controllers tested in simulation can be extended to be used in the real distillation column, but first it is necessary to overcome the problem of the interface between the Simulink R and LabView environments. This problem was the main reason why in this work the control part was not validated with real data. Also improvements in the controllers can be tested, like implement more efficient nonlinear solvers, such as yalmip, as an alternative to B&B, or even other types of controllers, for instance Internal Model Control. Concerning the last part of this work, other methods of fault detection and identification can be tested. The introduction of a Fuzzy Inference System can help to determine whether or not the threshold breach was due to a failure or simply caused by noise, which can be a problem with the methodology presented.

76 Bibliography

[1] Abdullah, Z., N. Aziz and Z. Ahmad (2007). Nonlinear modelling application in distillation column. Chemical Product and Process Modeling 2(3-12).

[2] Babuska,ˇ R. (1998). Fuzzy Modeling for Control. Boston: Kluwer Academic Publishers.

[3] Blanke, M., M. Kinnaert, J. Lunze and M. Staroswiecki (2006). Diagnosis and Fault-Tolerant Control (2nd ed.). Springer.

[4] Borges, J. (2007). State-space system identification new developments and applications. Ph. D. thesis, UTL, Instituto Superior Tecnico.´

[5] Borges, J., V. Verdult, M. Verhaegen and M. Ayala Botto (July 2004). Separable least squares for projected gradient identification of composite local linear state-space models. In Proceedings of the 16th International Symposium on Mathematical Theory of Networks and systems, Leuven, Belgium.

[6] Brizuela, E., M. Uria and R. Lamanna (1996). Predictive control of a multi-component distillation column based on neural networks. In NICROSP ’96: Proceedings of the 1996 International Workshop on Neural Networks for Identification, Control, Robotics, and Signal/Image Processing, Washington, DC, USA. IEEE Computer Society.

[7] Buckley, P., W. Luyben and J. Shunta (1985). Design of Distillation Column Control Systems. Else- vier.

[8] Camacho, E. and C. Bordons (1999). Model Predictive Control. Springer-Verlag.

[9] Findeisen, R. and F. Allgower¨ (2002). An introduction to nonlinear model predictive control. In Control, 21st Benelux Meeting on Systems and Control, Veidhoven.

[10] Forbes, R. (1970). Short History of the Art of Distillation from the Beginnings Up to the Death of Cellier Blumenthal (Second Edition ed.). Brill Academic Publishers.

[11] Jang, J.-S., C.-T. Sun and E. Mizutani (1997). Neuro-Fuzzy and Soft Computing. Prentice-Hall. A Computational Approach to Learning and Machine Intelligence.

[12] Kalid, R. Controle de coluna de destilac¸ao.˜ Technical report, Dept. Engenharia Qu´ımica - UFBA.

[13] Kister, H. (1990). Distillation Operation. McGraw-Hill, Inc.

77 [14] Kister, H. (1992). . McGraw-Hill, Inc.

[15] Ljung, L. (1999). System Indentification - Theory for the User (2nd ed.). Prentice-Hall.

[16] Lundstrom,¨ P. and S. Skogestad (1995). Opportunities and difficulties with 5 5 distillation columns. × Journal of Process Control 5(4). IFAC Symposium: Advanced Control of Chemical Processes.

[17] Maciejowski, J. (2000). Predictive Control with Constraints. Prentice-Hall.

[18] Mahfouf, M., S. Kandiah and D. Linkens (2002). Fuzzy model-based predictive control using an arx structure with feedforward. Fuzzy Sets and Systems 125(1).

[19] Mahoney, D. and P. Fruehauf. An integrated approach for distillation column control design using steady state and dynamic simulation.

[20] Mendonc¸a, L. F., C. A. Silva and J. M. Sousa (2000). Branch-and-bound optimization in model pre- dictive control applied to mimo systems. In Proceedings of 4th Portuguese Conference on Automatic Control, Controlo’2000, Guimares, Portugal (October).

[21] Murray-Smith, R. and T. Johansen (1997). Multiple Model Approaches to Modelling and Control. London: Taylor and Francis.

[22] Oliveira, J. and W. Pedrycz (2007). Advances in Fuzzy Clustering and its Applications. John Wiley & Sons, Ltd.

[23] Oliveira, P., N. Batalha, C. Pinheiro, J. Borges and J. Silva (2008). Nonlinear dynamic modeling of a real pilot scale continuous distillation column for fault tolerant control purposes. In CD of the Proceedings of the 10th International Chemical Eng. Conference - CHEMPOR’2008, Universidade do Minho, Braga, Portugal (September).

[24] Oliveira, P., N. Batalha, T. Sousa, C. Pinheiro and J. Silva (2008). Relatorio´ tecnico´ - coluna de destilac¸ao˜ piloto. set-up experimental e modelo. Technical report, Instituto Superior Tecnico´ - UTL. Trabalho realizado no ambitoˆ do projecto POCI/EM/59522/04.

[25] Petlyuk, F. (2004). Distillation Theory and Its Application to Optimal Design of Separation Units. Cambridge Series in Chemical Engineering. Cambridge University Press.

[26] Shaw, A. and F. Doyle (1997). Multivariable nonlinear control applications for a high purity distillation column using a recurrent dynamic neuron model. Journal of Process Control 7(4).

[27] Singh, V., I. Gupta and H. Gupta (2005). Ann based estimator for distillation–inferential control. Chemical Engineering and Processing 44(7).

[28] Singh, V., I. Gupta and H. Gupta (2007). Ann-based estimator for distillation using levenberg- marquardt approach. Engineering Applications of Artificial Intelligence 20(2). Special Issue on Appli- cations of Artificial Intelligence in Process Systems Engineering.

78 [29] Skogestad, S. (1992). Dynamics and control of distillation columns - A critical survey. In IFAC- Symposium DYCORD+’92, Maryland (April).

[30] Skogestad, S. (1997). Dynamics and control of distillation columns: A tutorial introduction. Trans IChemE, Part A (Chemical Engineering Research and Design) 75.

[31] Skogestad, S. (2007). The dos and dont’s of distillation column control. Chemical Engineering Research and Design (Trans IChemE, Part A) 85.

[32] Sousa, J., R. Babuskaˇ and H. Verbruggen (1997). Fuzzy predictive control applied to an air- conditioning system. Control Eng. Practice 5(10), 1395–1406.

[33] Sousa, J. and U. Kaymak (2002). Fuzzy Decision Making in Modeling and Control. World Scientific Pub. Co.

[34] Sousa, J. and M. Setnes (1999). Fuzzy predictive filters in model predictive control. Industrial Electronics, IEEE Transactions on 46(6), 1225–1232.

[35] Tham, M. (March - 2009). Introduction to distillation. Available from Internet: http://lorien.ncl.ac.uk/ming/distil/distil0.htm.

[36] Turner, P., G.A. Montague, A.J. Morris, O. Agammenoni, C. Pritchard, G. Barton and J. Romagnoli (1995). Application of a model based predictive control scheme to a distillation column using neural networks. In American Control Conference, 1995. Proceedings of the, Volume 3, Jun), pp. 2312–2316 vol.3.

[37] Verbruggen, H.B., H.-J. Zimmermann and R. Babuskaˇ (1999). Fuzzy Algorithms for Control. Inter- national Series in Intelligent Technologies. Kluwer Academic Publisher.

[38] Yalgm, Mustak E., Johan A. K . Suykens and Joos P. L . Vandewalle (2005). Cellular Neural Networks, Multi-Scroll Chaos and Synchronization, Volume 50 of Nonlinear Science - Series A. World Scientific Publishing.

[39] Zhu, Y. (1999). Distillation column identification for control using wiener model. In American Control Conference, 1999. Proceedings of the 1999, Volume 5.

79 80 Appendix

81

Appendix A

Fuzzy models Properties

A.1 Model based in simulations

The consequent parameters of the fuzzy model based simulated data are presented in Tables A.1 and A.2, and the membership functions in Figures A.1 and A.2.

Table A.1: Tebul consequent parameters of equation 2.6 for FM model based in simulation

rules y1(k − 1) y2(k − 1) u1(k − 1) u1(k − 2) u1(k − 3) u2(k − 1) − − − − − − 1 9.96 · 10 1 3.33 · 10 4 −7.98 · 10 4 −2.11 · 10 3 −3.72 · 10 3 1.23 · 10 1 − − − − − − 2 9.87 · 10 1 3.05 · 10 3 −8.79 · 10 4 −1.81 · 10 3 −4.58 · 10 3 1.67 · 10 1

rules u2(k − 2) u2(k − 3) u3(k − 1) u3(k − 2) u3(k − 3) offset − − − − − − 1 1.94 · 10 2 −8.87 · 10 2 −1.18 · 10 3 1.14 · 10 3 3.28 · 10 4 3.81 · 10 4 − − − − − − 2 −1.55 · 10 2 −1.42 · 10 1 4.18 · 10 3 −1.07 · 10 3 2.56 · 10 2 −2.84 · 10 3

Table A.2: Tvap consequent parameters of equation 2.6 for FM model based in simulation

rules y1(k − 1) y2(k − 1) u1(k − 1) u1(k − 2) u1(k − 3) u2(k − 1) − − − − − − 1 1.39 · 10 3 9.97 · 10 1 2.23 · 10 2 −3.13 · 10 3 −1.65 · 10 2 4.18 · 10 1 − − − − − − 2 −2.65 · 10 4 9.92 · 10 1 −9.91 · 10 3 2.20 · 10 3 8.95 · 10 3 2.55 · 10 1

rules u2(k − 2) u2(k − 3) u3(k − 1) u3(k − 2) u3(k − 3) offset − − − − − − 1 −4.76 · 10 1 7.81 · 10 2 4.02 · 10 2 −1.55 · 10 1 1.45 · 10 1 2.18 · 10 3 − − − − − − 2 −2.27 · 10 1 −3.41 · 10 2 2.06 · 10 1 7.90 · 10 2 −2.07 · 10 1 −5.56 · 10 5

83 1 1

µ 0.5 µ 0.5

0 0 −1 −0.8 −0.6 −0.4 −0.2 0 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 y (k−1) y (k−1) 1 2 1 1

µ 0.5 µ 0.5

0 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 u (k−1) u (k−2) 1 1 1 1

µ 0.5 µ 0.5

0 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−3) u (k−1) 1 2 1 1

µ 0.5 µ 0.5

0 0 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−2) u (k−3) 2 2 1 1

µ 0.5 µ 0.5

0 0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 u (k−1) u (k−2) 3 3 1

µ 0.5

0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 u (k−3) 3 Figure A.1: Membership functions of FM model based in simulations for Tebul

1 1

µ 0.5 µ 0.5

0 0 −1 −0.8 −0.6 −0.4 −0.2 0 −1.8 −1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 y (k−1) y (k−1) 1 2 1 1

µ 0.5 µ 0.5

0 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 u (k−1) u (k−2) 1 1 1 1

µ 0.5 µ 0.5

0 0 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−3) u (k−1) 1 2 1 1

µ 0.5 µ 0.5

0 0 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−2) u (k−3) 2 2 1 1

µ 0.5 µ 0.5

0 0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 u (k−1) u (k−2) 3 3 1

µ 0.5

0 −0.18 −0.16 −0.14 −0.12 −0.1 −0.08 −0.06 −0.04 −0.02 0 u (k−3) 3 Figure A.2: Membership functions of FM model based in simulations for Tvap

84 A.2 Model based in real data

The consequent parameters of the fuzzy model based in real data are presented in Tables A.3 and A.4, and the membership functions in Figures A.3 and A.4.

Table A.3: Tebul consequent parameters of equation 2.6 for FM model based in real data

rules y1(k − 1) y1(k − 2) y2(k − 1) y2(k − 2) u1(k − 3) u1(k − 4) 1 0.00 · 100 1.82 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 2 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 − − − − − − 3 9.55 · 10 1 2.93 · 10 2 7.80 · 10 2 −6.27 · 10 2 −4.31 · 10 3 −2.90 · 10 2

rules u2(k − 3) u2(k − 4) u3(k − 3) u3(k − 4) offset 1 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 2 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 − − − − − 3 −1.70 · 10 1 1.46 · 10 1 −7.42 · 10 2 1.46 · 10 1 3.00 · 10 2

Table A.4: Tvap consequent parameters of equation 2.6 for FM model based in real data

rules y1(k − 1) y1(k − 2) y2(k − 1) y2(k − 2) u1(k − 3) u1(k − 4) 1 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 − − − − − − 2 2.74 · 10 2 −2.44 · 10 2 9.21 · 10 1 6.73 · 10 2 2.65 · 10 2 −5.64 · 10 2 3 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100

rules u2(k − 3) u2(k − 4) u3(k − 3) u3(k − 4) offset 1 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 − − − − − 2 −3.44 · 10 1 3.37 · 10 1 3.50 · 10 3 8.88 · 10 2 −8.26 · 10 5 3 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100 0.00 · 100

85 1 1

µ 0.5 µ 0.5

0 0 −1 −0.5 0 0.5 1 1.5 2 −1 −0.5 0 0.5 1 1.5 2 y (k−1) y (k−2) 1 1 1 1

µ 0.5 µ 0.5

0 0 −2 −1.5 −1 −0.5 0 0.5 −2 −1.5 −1 −0.5 0 0.5 y (k−1) y (k−2) 2 2 1 1

µ 0.5 µ 0.5

0 0 0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5 u (k−3) u (k−4) 1 1 1 1

µ 0.5 µ 0.5

0 0 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−3) u (k−4) 2 2 1 1

µ 0.5 µ 0.5

0 0 −0.2 −0.15 −0.1 −0.05 0 −0.2 −0.15 −0.1 −0.05 0 u (k−3) u (k−4) 3 3 Figure A.3: Membership functions of FM model based in real data for Tebul

1 1

µ 0.5 µ 0.5

0 0 −1 −0.5 0 0.5 1 1.5 2 −1 −0.5 0 0.5 1 1.5 2 y (k−1) y (k−2) 1 1 1 1

µ 0.5 µ 0.5

0 0 −2 −1.5 −1 −0.5 0 0.5 −2 −1.5 −1 −0.5 0 0.5 y (k−1) y (k−2) 2 2 1 1

µ 0.5 µ 0.5

0 0 0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5 u (k−3) u (k−4) 1 1 1 1

µ 0.5 µ 0.5

0 0 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 u (k−3) u (k−4) 2 2 1 1

µ 0.5 µ 0.5

0 0 −0.2 −0.15 −0.1 −0.05 0 −0.2 −0.15 −0.1 −0.05 0 u (k−3) u (k−4) 3 3 Figure A.4: Membership functions of FM model based in real data for Tvap

86 Appendix B

Modifications implemented to the Branch and Bound MPC scheme

B.1 Integration in Simulink

The original program used to execute the B&B algorithm was developed by Mendonc¸a et al. [20] and used the models from the toolbox originally created by Babuskaˇ [2]. This toolbox run in a m-file and used simulations, with a duration equal to the sample time of the Fuzzy model, to update the real outputs of the system. This way the simulation ran in a discrete way, with the states of the system being saved in every simulation, to be use in the next simulation. The B&B algorithm benefited from this loop, because it already has the output of the system y(t) while computing the control action u(t), obtaining the best control action for that instant.

Algorithm B.1 Original algorithm Begin simulation with initial control action u(0) given in advance

for i = 1 to (Total time of simulation)/Ts do Stop simulation at t = i T × s Read the system output y(i T ) × s Compute u(i T ) with B&B by estimating the output of the system yˆ((i + 1) T ), using y(i T ) × s × s × s and the control action u(i T ) being tested tested × s Begin simulation at t = i T with the last output y(i T ) and the new control action calculated × s × s i = i + 1 end for

However, for this work, it was necessary to integrate the controller in Simulink R , since the first principles model used a continuous solver, not being possible to stop and rerun the simulation. To include the controller in Simulink R it was used a block for a Level-1 M-file S-Function. This function is structured in flags, which vary according to the state of the simulation:

87 Figure B.1: Schematic representation of the original program

Initialization Runs only in the beginning of the simulation. Sets the initial conditions and states (x(0)),

and sample time Ts of the block.

Outputs Receives the discrete updated states x(t) and compute the block output until the next sample time hit u ( t t + T ). → s

Update Receives input y(t) and states x(t) to compute the discrete states x(t + Ts)

Figure B.2: Schematic representation of a discrete Level-1 M-file S-Function Dashed lines represents discrete signals and continuous lines represent continuous signals

Computing u(t) directly in flag Outputs is not possible because this block should pass information straightforward, i.e. it should not have complex calculations like B&B, since it is called continuously throughout the simulation, by the continuous solver. Thus it was necessary to compute u(t) directly from the discrete state x(t) which was computed in t T . In other terms, the control action given at time t by Outputs had to be computed in t T by − s − s Update. Although it seems a bite confusing why u(t) had to be computed at t Ts, it gets clear if we think that − in a experiment if we want to have a control action at given instant we should already have the control action computed, before reaching that instant. The main problem with this approach was that at time t T , we only have y(t T ). Thereby it was − s − s necessary to have a prediction of y(t) to be able to compute the optimal u(t).

88 Figure B.3: Schematic representation of the computing of the controller block output Dashed lines represents discrete signals and continuous lines represent continuous signals

The new algorithm embedded in the controller is presented next:

Algorithm B.2 Modified algorithm Begin simulation with initial control action u(0) given in advance

for i = 0 incremented by Ts until simulation is stopped do Apply u(i T ) to the system × s Read the system output y(i T ) × s Estimate yˆ((i + 1) T ), using u(i T ) and y(i T ) × s × s × s Compute u((i + 1) T ) with B&B by estimating the output of the system yˆ((i + 2) T ), using × s × s yˆ((i + 1) T ) and the control action u((i + 1) T ) being tested. × s × s i = i + 1 end for

89 90