Добавил:
kiopkiopkiop18@yandex.ru t.me/Prokururor I Вовсе не секретарь, но почту проверяю Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_5395_Библиотеки_им_академика_М_И_Перельмана

.pdf
Скачиваний:
0
Добавлен:
15.09.2026
Размер:
15 Мб
Скачать
☆
296 A. Nikolakopoulou et al.
https://t.me/medicina_free
Tubular Reactor
The tubular reactor is modeled by mass conservation equations formulated as partial differential equations (PDEs). The PDEs are discretized in space with n discretization points using a method of lines, and specifically backwards differences, resulting in an ODE system. The mass conservation equations in the tubular reactor are given by
'
'
tot
− c
c
i,l
Vl− V
∂c
∂V
i,l−1
l−1
'
+ r
, for i = 1,...,nc,l= 1,...,nd,
i,l
'
i,l
(5)
,
∂c
∂V
∂c
∂t
i,l
'
'
'
'
i,l
=−Q
=
d
where c the total volumetric flowrate inside the reactor, r lth discretization point, and V
is the molar concentration of species i at lth discretization point, Q
i,l
is the reaction rate of species i at
i,l
is the volume from the entrance of the reactor up to
l
tot
the lth discretization point. The last equation is the first-order spatial discretization of ∂c/∂V. The inlet of the reactor is the 0th discretization point with a known concentration obtained from
˙m
c
in,i
in,i
=
Q
, for i = 1,...,nc, (6)
totMi
and the total volumetric flowrate in the reactor is
˙m
in, tot
, (7)
ρ
where ˙m
=
Q
tot
is the total inlet mass flowrate. The density and hence the volumetric
in, tot
flowrate are assumed constant at every axial position in the tubular reactor.
nc×n
The reaction rate matrix r ∈ R
d
with elements r
has rows that describe the
i,l
reaction rate of each species i throughout the reactor and is given by
r = SR, (8)
nc×n
r
where S ∈ R and n
is the number of reactions. The reaction rates are modeled by an Arrhenius
r
is the stoichiometry matrix, R ∈ R
nr×n
d
is the reaction matrix,
dependency on temperature. The kinetics can vary depending on the synthesis of the pharmaceutical of interest. The rate of the j th reaction at lth discretization point is
R
j,l
= kjexp
−E
RT
A,j
m∈M
(
o
m,j
c
, for j = 1, 2,...,nr,l= 1, 2,...,nd,
m,l
j
(9)
is
Fast Model Predictive Control of Modular Systems for Continuous... 297
https://t.me/medicina_free
where kjis the constant prefactor for the j th reaction, E R is the ideal gas constant, T is the reactor temperature, M
the reactant species in the j th reaction, c species m at the lth discretization point, and o
is the molar concentration of reactant
m,l
is the reaction order of reactant
m,j
is its activation energy,
A,j
is the set containing
j
species m in the j th reaction. A small-scale system can be used offline to acquire all the model-related parameters (e.g., a droplet-based system [19]).
For the synthesis of atropine, the activation energy and the prefactor for each reaction are obtained from linear regression on the experimental data from [35]. The reaction rates for the four reactions in the atropine synthesis process are modeled as being first order with respect to each of the reacting species
R
1,l
R
3,l
= k1exp
= k3exp
−E
−E
RT
RT
A,1
A,3
c
1,lc3,l,R2,l
c
5,lc11,l,R4,l
= k2exp
= k4exp
−E
RT
−E
A,2
RT
A,4
c
4,lc7,l
c
5,lc11,l
,
(10)
.
Numbering of the species is based on their order of appearance in the chemical reaction network, obtained from [35]. All chemical reactions are modeled as homogeneous.
The species and total mass flowrates at the outlet of the tubular reactor are given by
˙m
= c
Q
, for i = 1,...,nc,
totMi
˙m
.
out,i
(11)
˙m
out, tot
out,i
i,n
d
n
c
=
i=1
The tubular reactor ODEs (5) contribute the differential states c total) to the overall system. The algebraic equations (6)–(9) are inserted into (5) and do not contribute any algebraic states to the overall system of equations. Depending on the number of spatial discretization points n can arise. The coarseness of the spatial discretization can be informed by order­of-magnitude analyses of the Péclet and Sherwood numbers to assess the relative contribution of dispersion on the mass transfer. A low dispersive transport rate would imply the need for a higher number of spatial discretization points to ensure that numerical diffusion in the numerical solution is smaller than the dispersion in the system. The selection of the number of spatial discretization points can also depend on the chemical reaction timescales, e.g., fast reaction rates require a high number of discretization points to accurately model the dynamics.
× ndin
i,l(nc
, a very large number of states
d
298 A. Nikolakopoulou et al.
https://t.me/medicina_free
Liquid-Liquid Separator
The mass conservation equations for the liquid-liquid separator (LLS) assume an effective average uniform molar concentration ¯c
for each species i inside the unit,
i
with dynamics modeled as
Q
tot¯ci
= F
OR,i
+ F
, for i = 1,...,nc,
AQ,i
(12)
= Q
tot
c
in,i
d¯c
i
V
dt
where V is the volume of the liquid-liquid separator, F
, for i = 1,...,n
−¯c
i
, (13)
c
is the molar flowrate of
i
species i, and the subscripts “OR” and “AQ” refer to the organic and aqueous phase, respectively. The constant density assumption inside the separator implies that
= QOR+ QAQ. (14)
Q
tot
This assumption does not break during startup since the system at its starting state is filled with solvent. The solutes are assumed to exist in the organic stream in trace quantities, hence
x
in,s
Q
= QOR,
where x
is the mass fraction of the solvent in the inlet of the liquid-liquid
in,s
separator and x
x
+ x
in,s
is the mass fraction of water in the inlet of the unit. The ratio
in,w
in,w
tot
(15)
describes the mass fraction of the organic solvent to the total amount of solvents (organic and water) in the feed stream of the liquid-liquid separator.
The phase equilibrium is modeled by
c
OR,i
= Dic
, for i = 1,...,nc, (16)
AQ,i
which assumes that the liquid-liquid equilibrium takes place instantaneously. The mass transfer kinetics can be modeled by a time delay, given enough data to charac­terize the mass transfer between the two liquid phases. The liquid-liquid separation partition coefficients D
are assumed to have negligible variation with temperature
i
and concentration, and they are approximated using the results from [35]. Direct use of (16) resulted in singularities when only one phase is present, which causes numerical problems during process simulation. To avoid such numerical problems, we used the alternative formulation
Q
AQFOR,i
which depends only on flowrates and does not carry the risk of having a null denominator. The LLS module is described by the differential and algebraic
= QORDiF
, for i = 1,...,nc, (17)
AQ,i
Fast Model Predictive Control of Modular Systems for Continuous... 299
https://t.me/medicina_free
equations (12)–(15) and (17) which contribute to the system model the differential states ¯c
and the algebraic states F
i
OR,i
, F
, QOR, and QAQ(3nc+ 2 in total).
AQ,i
These equations form an index-1 DAE.
Computational Considerations
In the atropine synthesis case study, to simplify the numerical solution of the plant-wide model, some algebraic manipulation was used to reduce the number of algebraic equations. For example, the variables associated with the mixer outlet were not introduced as algebraic states but were calculated and directed as inputs to the equations describing the downstream module. The equations that described the reactors and the separator were combined and the resulting DAE system was solved in MATLAB. Solvers that can handle stiff ODEs, such as ode15s in MATLAB, were used because the time scales of the reactions in the system vary significantly. Additionally, providing the Jacobian matrix or its sparsity pattern to the solver speeds up the calculations for systems of high state dimension. The computational time for a simulation of the operation of the plant from startup to steady state (∼1 hr of operation) in a laptop with i7-5600U CPU at 2.60GHz and 16.0 GB RAM was in the order of magnitude of 10 s for this system of approximately 10,000 states.
2.3 Control Design
The dynamics of the regulatory control loops are much faster than the open- and closed-loop dynamics at the MPC layer. This tight control at the lower level layer enables the simplification of the plant-wide model for the MPC design by excluding the closed-loop dynamics of the lower level control loops. For example, in the atropine synthesis case study, it is assumed that the pumps receive the flowrate setpoint instantaneously. The reactor temperatures are kept at setpoint which can be obtained from the optimization layer. The effectiveness of the separation of time scales between the regulatory and higher level control (supervisory) layers for the design of plant-wide control systems is well established in the literature (e.g., see the review by Ng and Stephanopoulos [36] and Larsson and Skogestad [37]).
Quadratic Dynamic Matrix Control
QDMC is heavily used in manufacturing largely because such processes often have very high state dimension, and the states of such models are typically not practically observable from the available measurements. QDMC is formulated as a quadratic program (QP) which can be solved by convex optimization algorithms
300 A. Nikolakopoulou et al.
https://t.me/medicina_free
minuu(GG + Wu)u − 2eGu + ee,
subject to u
u
min
y
min
≤ u(k) ≤ u
min
≤ u(k) ≤ u
≤ˆy ≤ y
max
max
,
,
max
(18)
,
where u is the vector of future manipulated variable (MV) changes, G is the dynamic matrix which describes how present and future inputs affect the plant output and is constructed from the step response models, e = y
sp
− ypis the
difference between the setpoint and the model prediction due to past and present terms,ˆy is the vector of the future plant output predictions, k denotes the current time instance, and W
is a positive-definite matrix that penalizes changes in the
u
manipulated variables in the cost function [16]. The execution time of the QP (18) depends on the control horizon c which determines the number of optimization variables and on the number of constraints. The prediction horizon p determines the future time window for which the plant behavior is simulated using the dynamical model. The tuning parameters of the QDMC are the W matrix W diagonal elements of W
is chosen to be diagonal, which was taken here. Higher values of the
u
and/or c result in more conservative control. Detailed
u
, c, and p. Typically the
u
mathematical expressions, e.g., that define the elements of G in terms of step response coefficients, are described in any reference on QDMC [16, 17, 38].
QDMC requires a predictive model for the controlled variable (CV) as a function of the past and future values of the MVs. The predictive model can also include information regarding the effect of measured disturbances on the CV. For a plant with multiple inputs, step response models that describe how each MV affects the CV are created. These models should capture a wide and representative range of the operating regime. The step response models needed in QDMC can be automatically derived from the plant-wide simulation model by applying step changes for each MV. The CV response is recorded and then scaled to reflect how a unit change in the MV affects it. The overall multi-input model is built by combining the individual step responses for each MV. The same procedure is followed for each CV if the process has more than one control objective.
Step Response Models and Nonlinear Effects in a Modular System
In the atropine synthesis case study, the CVs were the mass production rate of atropine in the aqueous phase stream and the atropine yield which is defined as the ratio of the atropine mass flowrate over the theoretically possible atropine mass flowrate if all the reactants had completely reacted, based on the stoichiometrically limiting reactants. The MVs were the flowrates of the inlet streams u past study of the plant-wide control of continuous pharmaceutical manufacturing of a different pharmaceutical [9], API dosage and total impurity content were selected as the CVs.
− u6.Ina
1
Fast Model Predictive Control of Modular Systems for Continuous... 301
https://t.me/medicina_free
Four consecutive steps of equal magnitude and a total deviation 20–80% from a nominal value both in increasing and decreasing directions were simulated starting from steady-state conditions for each MV. This type of step change program is also known as a staircase. The eight scaled step responses for each MV-CV pair were analyzed with one step response selected to construct the overall step response IO model which was used in QDMC, as described in Sections “Linear Input-Output Model Construction Methodology” and “Linear Input-Output Model Construction”. The steps for each MV-CV pair are shown in Figs. 3 and 4.
The production rate and yield single-variable controllers were designed around different nominal steady-state operating conditions. Different sets of MV values were selected for each nominal operation in order to test the controllers against a wide range of nonlinearities that arise from differences in the chemistry depending on the operating region. Significant steady-state and dynamic nonlinearities were observed in the step responses (Figs. 3 and 4), especially for the mass production rate. Some observations are
• Many MV-CV pairs have nonlinear responses for their dynamics or steady-state
values.
• All six MVs are mass flowrates that are inlets to the system, so positive steps in
mass flowrates result in faster dynamics and shorter time delays than negative
steps. The variation in plant dynamics can be about a factor of two for the output
to reach steady state (e.g., u
in Fig. 3).
1
• Some of the steady-state gains are highly nonlinear, in some cases changing by
a factor of ten or more (directional nonlinearities), or even changing sign (e.g.,
compare the responses for the positive and negative step changes for 80% in u
2
Fig. 3). It is well-known that changing the size of the steady-state gain can result
in unstable closed-loop systems when a feedback control system with integral
action is applied [7].
• Under some conditions, the CV reaches a threshold so that further changes in the
MV have small effects (e.g., −40% and −60% in u
• The buffer solution andorganic solvent mass flowrates (u
in Fig. 4).
2
and u6) have relatively
5
small steady-state gains and so are not effective MVs.
in
The step response behavior of the CVs is dictated by the nonlinear dynamics of the process. Increasing the flowrate of an incoming stream may result in an excess of a reactant. Simultaneously, by increasing the total flowrate inside that unit operation, the concentration of other species can be diluted. These effects will influence the reaction rates. Additionally, changes in the flowrates affect the residence time which further impacts the extent of the reactions. These tradeoffs determine the overall increase or decrease of the production rate or yield for a given set of inputs. Lastly, operating the plant in nearly optimal values of a CV (that is, near its maximum or minimum achievable value) will result in a change in the sign of the steady­state process gain for some types of disturbances, which will cause instability or oscillations in the closed-loop dynamics [7].
302 A. Nikolakopoulou et al.
https://t.me/medicina_free
0.3
0.2
0.1
0
0 20406080
Time [min]
0.5
0.4
0.3
0.2
0.1
0
0 20406080
Time [min]
0.04
0.03
0.02
0.01
0
0 20406080
Time [min]
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
1
0.8
0.6
0.4
0.2
0
0 20406080
Time [min]
0.6
0.4
0.2
0
-0.2 020406080
Time [min]
0.04
0.03
0.02
0.01
0
0 20406080
Time [min]
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
Fig. 3 Scaled transient responses of the production rate to step changes in the manipulated variables u
,i = 1,...,6. Each step response is denoted by the step magnitude as a percentage of
i
the nominal value of the corresponding manipulated variable. PR denotes the production rate and the subscript ss refers to the corresponding steady-state values of the operation prior to each step change [10]
Fast Model Predictive Control of Modular Systems for Continuous... 303
https://t.me/medicina_free
0
-0.2
-0.4
-0.6 0 20406080
Time [min]
3
2
1
0
-1
0 20406080
Time [min]
0
-0.005
-0.01
-0.015
-0.02
0 20406080
Time [min]
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
0
-0.2
-0.4
-0.6
-0.8
-1 020406080
Time [min]
0
-0.2
-0.4
-0.6 0 20406080
Time [min]
0
-0.02
-0.04
-0.06
0 20406080
Time [min]
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
+20% +40% +60% +80%
-20%
-40%
-60%
-80%
Fig. 4 Scaled transient responses of the atropine yield to step changes in themanipulated variables
u
,i = 1,...,6. Each step response is denoted by the step magnitude as a percentage of the
i
nominal value of the corresponding manipulated variable. Y denotes the atropine yield and the subscript ss refers to the corresponding steady-state values of the operation prior to each step change [10]
304 A. Nikolakopoulou et al.
https://t.me/medicina_free
Linear Input-Output Model Construction Methodology
There is no generally accepted method for the construction of a linear model to use in the design of a linear controller for a nonlinear process. This section discusses three approaches to selecting a step response model for each MV to construct the overall linear model for QDMC.
One strategy often used in industrial settings is to choose the step response model with the highest steady-state gain for all MV-CV pairs. A drawback of this strategy is that the plant would spend most time in operating regions with smaller gains than assumed by the controller, which would result in sluggish control. Also, this strategy does not address MV-CV pairs in which the steady-state gain can change sign.
Here an alternative strategy is taken that aims to address the linear model-plant mismatch which may arise when selecting a model for MV-CV pairs with gain sign changes. For an MV whose steady-state gain sign changes across the various step responses, its contribution to the overall model is eliminated. This means that the MV is treated as if it had no effect to the CV.
1
The motivation behind this approach is to avoid misdirecting the plant when the MV’s effect on the CV has the opposite sign from what is assumed by the model. This approach reduces one degree of freedom per eliminated MV from the controller. Additionally, we account for the step response dynamics in the linear model construction by favoring step responses with fast dynamics. When the plant dynamics are slower than what the model predicts, the controller could be more conservative with respect to the plant. This conservatism could be offset by the potentially lower steady-state gains accompanying step responses with faster dynamics (e.g., −40% vs. −80% for u
1
Fig. 3).
To address cases where removing degrees of freedom from the controller by eliminating MVs results in poor control, another alternative strategy is considered. Instead ofcompletely eliminating thestep response modelexhibiting sign changes, a step response is selected that might reduce model-plant mismatch around the region of linearization for that MV. For the rest of the MVs, the same procedure is followed as in the previously mentioned approach (favoring somewhat faster dynamics).
These methods are compared for the atropine synthesis case study in Sect. 3.1.
in
2.4 Dynamic Optimization
Dynamic optimization (DO) is formulated as
G(x, z, u, θ ) =
min
u
subject to F(t ,˙x, x, z, u, θ ) = 0; x(0) = x
1
For a control problem with a single output, this strategy will result in the MPC setting the MV
associated with the zero step response coefficients to its steady-state value.
T
g(t, x, z, u, θ)dt +h(x, z, u, θ,tf),
0
, z(0) = z0,
0
(19)
Fast Model Predictive Control of Modular Systems for Continuous... 305
https://t.me/medicina_free
n
where x ∈ R
x
are the differential states, z ∈ R
are the control variables or inputs of the process, θ ∈ R
n
z
are the algebraic states, u ∈ R
n
θ
are time-invariant
n
parameters of the model, t is time, F is a vector function that describes the system evolution involving differential and algebraic equations (DAEs), and g and h are algebraic functions. All x, z, u are functions of time. For distributed systems, where some states are continuous functions of spatial dimensions, the PDAEs can be discretized in space as described in Section “Tubular Reactor” resulting in (19).
Equation (19) describes an infinite-dimensional optimization, so a parametriza­tion is needed for its numerical solution. The optimization horizon [0,T] is discretized in n length of each of the n
time stages such that t ∈[tp,t
t
stages is allowed to vary, in order to more accurately
t
],p= 0,...,nt− 1. The
p+1
determine switching times. Two commonly used control input parametrizations are the piecewise constant parametrization, in which the inputs are constant in each time stage, and the continuous piecewise affine parametrization, in which the inputs vary as an affine function of time in each time stage. These two control parametrizations are formulated as
u(t) = u
u(t) = u
,t∈[tp,t
p
t −t
+
p
t
p+1
],p= 0,...,nt− 1, and
p+1
p
(u
− up), t ∈[tp,t
p+1
− t
p
],p= 0,...,nt− 1,
p+1
(20)
respectively.
For the atropine synthesis case study, the optimization objective focuses on waste minimization (excluding water) in the outlet streams from the LLS unit while maximizing the production of atropine. This formulation is tightly coupled to the concept of E-factor [39]. The algebraic functions referenced in the objective G are
u
n
c
g =
i=1
i=n
w
where n
w
a
and naare indices that refer to water and atropine in the respective stream,
w
= 100 weighs the tradeoff between the two mass flow competing terms. This value is selected such that the term corresponding to the product flowrate is of similar magnitude as the waste term, and ensures that the optimization will not drift towards trivial solutions, e.g., nothing is produced and waste is minimized. The value of the weighting factor is informed by a series of optimizations for various values of T , n
w
= 50−103(Fig. 5). Similarly, wt= 100 min is a scaling factor that ensures that
a
t
h is in a similar order of magnitude as g for expected values of n
cost objectives such as reaching a target value for the production rate of atropine can be incorporated in the formulation as a terminal constraint or by appending a penalty term in the DO objective. The optimization variables are the volumetric
n
c
F
OR,i
+
F
i=1
i=n
i=n
− waF
AQ,i
w a
AQ,n
,h=
a
− t
t
n
0
t
, (21)
w
t
= 1, piecewise constant input parametrization, and values of
. Other potential
t