• Nem Talált Eredményt

5.3 Application Example

5.3.1 First-principle GLC for CSTR

In this subsection, the control law of GLC is derived on the bases of the first-principle model of the controlled process. First, let us transform the (A.1) model into the form of (5.1). The state-variables x = (x1, x2, x3) are: x1 = CA the concentration of A component, x2 = T the reactor temperature and x3 = Tj the jacket temperature. The manipulated input u is the coolant flowrate, the controlled output y is the temperature in the reactor. So the model equations of this affine system:

f(x) =

Then the relative order of the system can be determined based on Lgh(x) = 0

LgLfh(x) = 1 Vj

(Tjf −x3) U A

ρcpV , (5.34)

so the relative degree of the system is r = 2. Therefore, the feedback control

with the following Lie derivatives Lfh(x) =f2(x)

In ideal case, (5.35) input-output feedback linearization results in the fol-lowing second-order transfer function (see Fig. 5.1):

y(s)

v(s) = 1

β2s2+β1s+β0. (5.38) But (5.38) cannot be perfectly realized in practice due to some practical diffi-culties. The first difficulty is that the manipulated input is constrained (how-ever this is not significant if βi parameters are selected appropriately); the second is that the model parameters are not known accurately; and the third is that the state variables cannot be measured perfectly. These difficulties influence the performance of the GLC controller.

From (5.35) the linear controller can be designed, e.g. applying the direct synthesis method. Assuming that the desired close-loop transfer function is a first-order filter, that is

y(s)

ysp(s) = 1

1 +Tcs, (5.39)

where y is the output, ysp is the setpoint and Tc is the filter time-constant;

then the transfer function of linear controller is v(s)

Actually, (5.40) is a classical PID controller with the gainK = βT1

c, the integral time constant Ti = ββ1

0 and derivative time constant Td = ββ2

1.

5.3 Application Example 83 5.3.2 Semi-mechanistic GLC for CSTR

The first-principle GLC controller, see Sect. 5.3.1, builds upon the complete first-principle model of the process. As it was pointed out in Sect. 5.2.1, there may be situations when some part of the first-principle model are not available.

In contrast to first-principle GLC, the key strength of semi-mechanistic GLC is that it does not need a complete first-principle model. In the followings, an example will be presented that illustrates this problem through the application example of CSTR.

The control-related model of CSTR consists of two conservation equations:

the heat balance of the reactor and the heat balance of the jacket. The first balance is associated with the controlled variable (reactor temperature):

heat accumaltated

while the second balance is associated with the manipulated variable (flowrate of coolant):

The mathematical formalization of these terms are well-known in chemical engineering, see the first-principle model in Sect. A.1. Certainly, during the formalization of the model terms, some assumptions must be made with re-spect to certain a priori knowledge, e.g. the heat transfer coefficient was assumed to be constant. But it is not enough to provide an exact description of each term, the model parameters must be provided, too. In the course of modeling of chemical reactors, the parameters of chemical reaction rate are generally problematical. In this application example, it is assumed that this part of the model is not available. Hence, the neural network will model the heat released by the chemical reaction. Therefore, the semi-mechanistic model of CSTR: is the reactor temperature, x3 = Tj is the jacket temperature. One can see that the semi-mechanistic model (5.43) does not contain thex1 state variable.

It means that the semi-mechanistic GLC controller does not need to measure the concentration in reactor.

In the followings, the above described semi-mechanistic model will be uti-lized in the GLC scheme. The procedure is the same as it was in Sect. 5.3.1.

For the sake of simplicity, the state variables will be denoted in the same way:

x2 is the reactor temperature, x3 is the jacket temperature, thus the state vector: x = (x2, x3). The manipulated input u is the coolant flowrate, the controlled output y is the temperature in the reactor. Therefore, the model equations:

It should be noted that (5.44) assumes that the input of the neural network is a function of state variables, i.e.z=fz(x); for example, the input of neural network is composed from measured state-variables, see (5.49).

The relative order of the semi-mechanistic model can be determined through Lie derivatives:

Lgh(x) = 0 LgLfh(x) = 1

Vj(Tjf −x3) U A

ρcpV , (5.45)

so the relative degree of the system is r= 2. The Lie derivatives of the semi-mechanistic model are

Lfh(x) = f1(x)

L2fh(x) = 0 +f1(x)∂f1

∂x2(x) +f2(x)∂f1

∂x3(x), (5.46) with the following partial derivatives:

∂f1

The relative degree is r = 2, thus the feedback control law is identical to (5.35) (but the Lie derivatives differ from each other), that is

u= v−

β0h(x) +β1Lfh(x) +β2L2fh(x)

β2LgLfh(x) . (5.48)

Hence, the linear controller of semi-mechanistic GLC controller is the same, i.e. a PID controller, see (5.40).

5.3 Application Example 85 5.3.3 Design and Identification of Semi-mechanistic Model

It is true that the semi-mechanistic process model is more simple than the first-principle model, but it contains a neural network which must be designed.

The design of neural network consists of three steps:

Design the z input vector of neural network.

Design the structure of neural network.

Identification of θ neural network parameters.

In this application example, a discrete controller algorithm with 0.2 min sam-ple time was applied. It should be noted that this value is relatively small, the typical time constant of the system is about 0.1 h, so the effect of discretization is negligible. Because the controller is discrete, the z input of neural network will contain the measured state variables at discrete time instants. As the out-put of neural network is the estimated heat of reaction in the reactor, the inout-put of the neural network should be the measured reactor temperature values (the other state-variable of the reactor, the concentration is not measured in the semi-mechanistic GLC controller). The following input vector was chosen:

z(k) = (x2(k), x2(k1), x2(k2)), (5.49) wherek denotes thek-th sample time. In this application example, the neural network was a feedforward network and it consisted of six hidden layer nodes with tangent sigmoid transfer functions and one output layer node with linear transfer function:

fN N(z(k)) =w2tanh(W1zT(k) +bT1) +b2, (5.50) whereW1,w2,b1 andb2 are the parameters of the network. Thezinput vec-tor and the number of hidden layer nodes were chosen on the bases of some trial-and-error experiments: we found that the identified semi-mechanistic model was accurate enough with six hidden layer neurons and with the (5.49) input vector.

Before applying the semi-mechanistic model, the parameters of neural net-work must be identified. The (5.50) contains four parameter matrices: W1 weight matrix of hidden layer (6×3),w2 weight vector of output layer (1×6), b1 bias vector of hidden layer (1×6), and b2 bias scalar of output neuron (1×1). During the identification procedure these parameter matrices are ’col-lected’ into the θ parameter vector, that is

θ = (wT1,1, . . . ,wT1,3,b1,w2, b2), (5.51) where w1,i is thei-th column-vector of W1 matrix.

In the first step, the neural network was trained by back propagation algorithm (Sect. 5.2.3). The training data was generated by closed-loop ex-periment, see Fig. 5.6. After that, the neural network was trained by the

0 2 4 6 8 10 0

20 40 60 80 100

Temperature [C]

Time [h]

Reactor Jacket

Fig. 5.6. Training data for back-propagation identification

direct optimization method (Sect. 5.2.3) starting from the point given by the first step, i.e. the initial search point was the result of the back-propagation algorithm. Because the model was unstable, (5.31) was applied in the direct optimization. Figure 5.7 shows this training scheme.

Fig. 5.7. Scheme of neural network training with direct optimization method

The semi-mechanistic GLC controller needs the calculation of partial derivatives of neural network (5.47). In this case, the ∂f∂xN N

3 = 0, and the

∂fN N

∂x2 was calculated with numerical perturbation method.

5.3 Application Example 87 5.3.4 Simulation Results and Analysis

The control problem was a combined problem with setpoint tracking and un-measured disturbance in the coolant feed temperature. The controllers were tested at unstable operating points: 75C - 80C. The coolant feed tempera-ture changed from 10C to 20C at t = 6.33 h.

The parameters of feedback linearization (β0, β1, and β2) were tuned by trial-and-error method. The tuning of these parameters are easy because the meaning of these parameters are very simple (they are the linear parameters of the desired trajectory). Virtually, the tuning of these values is necessary only because the manipulated input is constrained, so these parameters must be tuned in such a way that the calculated manipulated input will satisfy (approximately) these constraints during the control. The selected parameters were:β0 = 1,β1 = 10,β2 = 5. The PID parameters were determined by direct synthesis (5.40): Kc = 1, Ti = 10, Td = 0.2 with Tc = 10. Both the first-principle and the semi-mechanistic GLC controller had the same parameters in order to ensure an adequate comparison between them.

First experiment

In the first experiment, model parameters of the first-principle GLC con-troller were exactly identical to the ’real’ model parameters. It was in the same way for the semi-mechanistic GLC controller, i.e. parameters of the white-box part of the model were accurate. Furthermore it was assumed that all of the state variables can be measured accurately, namely there was not measurement noise. Figure 5.8 and Fig. 5.9 show the simulation results un-der such circumstances. One can see that the performances of the controllers were good, and the first-principle GLC controller achieved better controller performance than the semi-mechanistic controller. It is not surprising since the first-principle GLC controller ’knew’ the perfect model of the reaction kinetic while the semi-mechanistic model estimated the reaction kinetic with a black-box model.

Second experiment (parameter uncertainty)

In the second experiment, the effect ofparameter uncertainty was investigated.

In practice, the parameters of the process models are not known accurately, which can significantly influence the controller performance. Three parameters were assumed to be uncertain for the model in the controller: thek0 (reaction rate coefficient), it was increased by 5%, the Ea (energy of activation), it was increased by 3%, and the U (heat transfer coefficient), it was decreased with 6%. Fig. 5.10 illustrates that the first-principle GLC controller had worse control performance due to erroneous parameters. Moreover, if the reaction kinetic parameters are much more inaccurate, the closed-loop may become unstable. In contrast, the performance of the semi-mechanistic GLC controller

is less deteriorated by the erroneous parameters, see Fig. 5.11, since the neural network could compensate the uncertainties of these parameters. This means that the neural network not only learned how to estimate the heat of reaction, but also how to compensate the ’wrong’ parameters of the first-principles (white-box) part of the model.

Third experiment (measurement noise)

When measurements are corrupted by random variations, they are said to be influenced by noise [91]. Since measurements are often influenced by noise in practice, the effect of measurement noise was investigated in the third ex-periment. The measurement noise is usually modeled by normally distributed random numbers. So in this experiment, normally distributed pseudo random numbers were added to the outputs of CSTR object to simulate measurement noise:

xn(k) =x(k) +χ(k) (5.52)

where xn(k) is the measured state vector at k-th sample time (the controlled output yn = xn2), x(k) is the state vector of the controlled process at k-th sample time, χ(k) is the vector of normally distributed random numbers at k-th sample time. Normally distributed random numbers are characterized by their standard deviation. The applied standard deviation were:

σ(χ1) = 0.08 mol/m3 σ(χ2) = 0.04C σ(χ3) = 0.04C.

To reduce the effect of noise, first-order low-pass filters were applied. Actually, two filters were applied: one for filtering the measured state variables (input of the controller), and one for filtering the manipulated variable (output of the controller). The time constants were selected by trial-and-error method separately for the three compared controller structures. Smaller values result in more noisy manipulated signal, while larger values result in oscillation.

With filters, the first-principle GLC controller was able to provide an ac-ceptable control performance, see Fig. 5.12. But as Fig. 5.13 shows, the per-formance of semi-mechanistic GLC controller was relatively poor. The manip-ulated signal and the controlled signal are noisy because the semi-mechanistic state feedback linearization is very sensitive to measurement noise even if the measuring signal is filtered. When the semi-mechanistic GLC controller was applied with an observer (Sect. 5.2.4), the control performance improved sig-nificantly, as Fig. 5.14 illustrates it. One can see, that the manipulated signal is less noisy than it was in the case of first-principle GLC, but the control error is bigger on the other hand.

These results support the conclusion that the semi-mechanistic modeling can be very useful for model-based control if the first-principle model of the controlled process is incomplete, or the model parameters are not known ac-curately. The semi-mechanistic controller has the advantage that it does not need to measure every state-variables, it is not sensitive to parameter uncer-tainty.

5.3 Application Example 89

0 2 4 6 8 10 12 14

72 74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.8. Response of first-principle GLC (1. experiment)

0 2 4 6 8 10 12 14

72 74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.9. Response of semi-mechanistic GLC (1. experiment)

0 2 4 6 8 10 12 14 72

74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.10. Response of first-principle GLC (2. experiment)

0 2 4 6 8 10 12 14

72 74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.11. Response of semi-mechanistic GLC (2. experiment)

5.3 Application Example 91

0 2 4 6 8 10 12 14

72 74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.12. Response of first-principle GLC (3. experiment)

0 2 4 6 8 10 12 14

72 74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.13. Response of semi-mechanistic GLC (3. experiment)

0 2 4 6 8 10 12 14 72

74 76 78 80 82

Temperature [C]

0 2 4 6 8 10 12 14

0 0.5 1 1.5 2

Coolant [m3 /min]

Time [h]

Fig. 5.14. Response of semi-mechanistic GLC with observer (3. experiment)

5.4 Summary

During last years, a number of nonlinear control system design techniques have been developed to control chemical processes, for example Globally Lin-earizing Control (GLC). Most of the nonlinear control methods are based on the nonlinear model of the controlled process. The effectiveness of nonlin-ear model-based controllers are limited because first-principle models of the controlled systems are often not known accurately in practice. This chapter presents a semi-mechanistic modeling approach for GLC that allows the mod-eler to combine black-box modeling with white-box modeling in such a way that an a posteriori modeled element replaces the uncertain part of the a priori model.

In the proposed semi-mechanistic model, a neural network replaces the difficult-to-model part of the a priori model. Since the neural network is a part of a differential equation system, three methods for training of the neural network were presented: back-propagation, direct optimization and sensitivity approach. The training of neural network may be problematical because if the model is unstable, the gradient descent algorithms cannot converge. For this reason a method was presented that can handle this difficulty.

Globally Linearizing Control assumes the complete observability of the states. Measurement is usually loaded with noise in practice, and the per-formance of a semi-mechanistic GLC controller is sensitive to measurement

5.4 Summary 93 noise. Hence, a semi-mechanistic control structure was developed in which an observer estimates the states of controlled system.

The proposed semi-mechanistic approach was demonstrated by the control of an exothermic continuously stirred tank reactor (CSTR). I derived the semi-mechanistic model of the CSTR process, and demonstrated how it can be used to control the CSTR process. Based on three experiments, I found that the semi-mechanistic controller has several advantages over the white-box controller: the semi-mechanistic controller does not need the measurement of all of the state variables, and the semi-mechanistic controller is less sensitive to parameter uncertainty than first-principle GLC.

6

Summary

Modeling, control and optimization of chemical processes are critical issues of chemical process engineering. These areas have great importance for the chemical industry, furthermore they include several challenging research top-ics and unsolved problems. It is due to lack of knowledge and understanding of complex and nonlinear processes in chemical engineering and the fact that information comes from a vast range of different sources. Hence, the incor-poration of different types of knowledge into the solution of chemical process engineering problems is a challenging and important task, which motivated the research presented in this doctoral dissertation.

In Chapter 2, a prototype of such a tool is developed that handles con-flicting objectives and constraints in a way that it brings the process engineer into the optimization procedure. The concept of this approach is that there are situations when it is not possible to formalize a quantitative objective func-tion but an expert (a process engineer) is able to make a compromise among conflicting objectives. This chapter presents a framework based on Interactive Evolutionary Computation for this kind of process engineering problems. The practical usefulness of the framework is demonstrated through two applica-tion examples from process engineering. In the first example, it is applied for tuning of a controller, while in the second example, it is used for the optimiza-tion of a fermentaoptimiza-tion process. These examples illustrate that the proposed approach is very useful for such optimization problems where it is difficult to formalize and balance the objectives. Further extension of this chapter would be to develop an algorithm based on Particle Swarm Optimization.

Chapter 3 is devoted to possible improvements in structure identification of nonlinear dynamical models. The main problem of identification of nonlinear dynamical models is that it is difficult to determine a model structure which is simultaneously accurate and simple. One of the most preferred structure identification method is Genetic Programming. When Genetic Programming is applied for model structure identification, it tends to generate very accurate but overparameterized models, especially if the measurement data is loaded with noise. Because the model transparency is very important form the aspect

of practical usefulness, it is important to find a balance between accuracy and transparency. Hence, a new concept was introduced, in which negligible terms of linear-in-parameters models are eliminated during the identification procedure. In the proposed approach, the Orthogonal Least Squares algorithm is used to eliminate superfluous terms from the model in such a way that the model preserves its accuracy. The proposed method is analyzed through model order identification problems of simulated chemical reactors.

Chapter 4 deals with the identification of chemical reaction systems. In the course of modeling of chemical reactors, several parameters must be identified from measurement data. The disadvantage of empirical identification is that the utilized quantities often can be measured in a complicated way that results in inaccurate data-points obtained at irregular time intervals. Hence, data smoothing and re-sampling are often required to handle such data set. This chapter presents a new approach that enables the modeler to introducea priori knowledge into data resampling and smoothing methods in order to increase the reliability of parameter identification. This chapter proposes a method in whicha priori knowledge (e.g. assumed balance equations) is transformed into linear equality and inequality constraints on the parameters of cubic splines.

This method is demonstrated through two application examples. In the first example, it is applied to identify kinetic parameters of a simulated reaction network, in the second example, it is used to analyze data taken from an industrial batch reactor. These examples demonstrate that when the proposed algorithm is applied, one obtains not only better fitting to the data points, but also the performance of the estimation of model parameters improves. In this chapter, the proposed approach is used to improve cubic spline approximation alone, so further extension would be to apply the idea for other black-box

This method is demonstrated through two application examples. In the first example, it is applied to identify kinetic parameters of a simulated reaction network, in the second example, it is used to analyze data taken from an industrial batch reactor. These examples demonstrate that when the proposed algorithm is applied, one obtains not only better fitting to the data points, but also the performance of the estimation of model parameters improves. In this chapter, the proposed approach is used to improve cubic spline approximation alone, so further extension would be to apply the idea for other black-box