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

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

.pdf
Скачиваний:
0
Добавлен:
15.09.2026
Размер:
15 Мб
Скачать
☆
Nonsmooth Modeling for Simulation and Optimization of Continuous... 235
https://t.me/medicina_free
the functional form of g. For example, given an algebraic equation 0 = g(p,x, y) ≡ |x|+|y|−p with reference parameter value p
⎧
⎨
π
g(p0,x,y) =
y
⎩
= 1,
0
{1}, if y>0, [−1, 1] if y = 0, {−1}, if y<0,
for any x ∈ R. Hence, if a solution (x(t, p for all t ∈[t
], then it is regular. In general it may be challenging to analyze
0,tf
), y(t, p0)) of (1) satisfies y(t, p0) = 0
0
the generalized differentiation index or regularity of a solution associated with the nonsmooth DAE system (1), but this is also true for a nonlinear smooth DAE system.
2.2 Sensitivity Information of a Nonsmooth DAE Model
In the traditional case of a smooth DAE set the sensitivity system of Eq. (1)isgiven by
∂f
˙
S
x
0
ny×n
S
x(t0
where the partial derivatives of f and g are evaluated at (p The sought functions S
(t) =
x
∂f
(t) =
∂p
∂g
=
p
∂p
) = Jf0(p0),
∂x
(t, p0) and Sy(t) =
∂p
+
S
∂x
∂g
+
S
∂x
parametric sensitivity functions. The smooth DAE sensitivity system (5) is linear and admits a unique continuous solution and initialization. However, system (5)is not valid for a nonsmooth DAE system. In the nonsmooth case a regular solution (x, y) may vary nonsmoothly with respect to parameter so that S not be well-defined for all t . In this case we will search for elements of the Clarke Jacobians ∂x
) and ∂ yt(p0) (i.e. for fixed t and varying p). These elements
t(p0
provide sensitivity information with respect to p at p = p algebraic variables, respectively, and guarantee attractive convergence properties in nonsmooth optimization and equation-solving methods (see [3] and the references therein). A new theory enables the calculation of such elements, as described hereafter.
The lexicographic directional (LD-)derivative [12] is a nonsmooth analogue of the classical directional derivative. It satisfies sharp calculus rules, which makes it a useful tool for automatic evaluation, and is applicable to a wide class of nonsmooth functions including PC
1
functions, convex functions, the Euclidean norm, and all compositions of such functions. The LD-derivative is defined with respect to a point and a directions matrix whose columns represent different directions
(t) +
x
(t) +
x
∂f
∂y
∂g
∂y
S
(t),
y
S
(t),
y
, x(t, p0), y(t, p0)).
0
∂y
(t, p0) are the forward
∂p
(t) and Sy(t) may
x
for differential and
0
(5)
236 M. Patrascu and P. I. Barton
https://t.me/medicina_free
to systematically probe local sensitivity information. Given that P is square and nonsingular, the LD-derivatives of x
t ∈[t
]) in the directions P ∈ R
0,tf
and ytof Eq. (1)atp0(for some fixed time
t
np×n
p
(denoted [xt](p0;P) and [yt](p0;P))
can be used to build the computationally relevant generalized derivative elements,
S
(t) and Sy(t), in the following way:
x
(p0;P) = Sx(t)P,
x
]
[
t
(p0;P) = Sy(t)P,
y
]
[
t
(6)
where S
(t) and Sy(t) are the Jacobian-like sensitivities1of the differentiable and
x
algebraic variables at time t , respectively. These are a nonsmooth analogue of the forward parametric sensitivity functions of the smooth case. The Jacobian-like objects S
[y
](p0;P) are available. Explicit LD-derivative calculus rules for basic nonsmooth
t
(t) and Sy(t) can be calculated once the LD-derivatives [xt](p0;P) and
x
functions have already been established [3, 12].
Given a regular solution (x, y) of (1)on[t
parameter value p
that passes through the point (t0, p0, x0, y0), the nonsmooth
0
] associated with the reference
0,tf
DAE sensitivity system associated with Eq. (1) is given by the following nonsmooth DAE system [34]:
˙
X(t) = f
0
X(t
for some directions matrix P ∈ R
(p0, x(t, p0), y(t, p0);(P, X(t), Y(t ))),
= g(p0, x(t, p0), y(t, p0);(P, X(t), Y(t ))),
ny×n
p
) =[f0](p0;P),
0
np×n
p
chosen a priori (which is a sequence of
(7)
directions exploring the parameter space). Here
(p0, x(t, p0), y(t, p0);(P, X(t), Y(t )))
f
is the LD-derivative of f at (p
, x(t, p0), y(t, p0)) in the directions of the matrix
0
⎡
⎤
P
⎣
(P, X(t), Y(t )) =
X(t)
⎦
.
Y(t)
Equation (7) admits a unique solution on the time horizon [t
X(t) =[x
1
Formally, Sx(t) = JL[xt](p0;P) and Sy(t) = JL[yt](p0;P) are the lexicographic (L-)derivatives
[21]ofx
and ytat p0in the directions P.
t
(p0;P), Y(t ) =[y
]
t
(p0;P),
]
t
0,tf
] given by
Nonsmooth Modeling for Simulation and Optimization of Continuous... 237
https://t.me/medicina_free
ny×n
which satisfies X(t0) =[f0](p0;P) such that Y(t0) = Y0∈ R
p
is the unique
solution of the nonsmooth equation system
(p0, x0, y0;(P, X(t0), Y0)).
0 = g
For a detailed procedure to obtain generalized derivative information, including
numerical examples, the reader is referred to [33].
3 Applications in Pharmaceuticals Manufacturing
Nonsmooth formulations are useful in modeling many processes in chemical engineering and other disciplines. Plant-wide dynamic simulation and optimization tools are essential to improve yields, productivity, energy consumption and other important process attributes. In recent years, various studies have focused on the dynamics of individual process units, e.g. crystallization, granulation, and blending [15, 18,37, 42], where the time to steady-state, the interaction of unit operations, the effect of process upsets and process optimization were studied. We recently studied the optimal performance of a fully integrated end-to-end continuous pharmaceutical plant over the entire time horizon of the campaign, rather than only the steady-state operation [22–24].
In this section we describe a few important examples with wide applications in the pharmaceutical industry. We demonstrate the usefulness of the nonsmooth mod­eling framework using an equation-oriented approach in the form of Eq. (1). Such examples include multi-phase systems such as single and multi-component ther­modynamic vapor-liquid equilibrium (VLE) and liquid-liquid equilibrium (LLE). Another multi-phase example models changes in kinetic modes, such as between growth and dissolution in crystallization processes.
3.1 Liquid-Liquid Extraction
Here, we look at a separation process conducted in a membrane based contin­uous microfluidic liquid-liquid extraction device [14], which separates a multi­component stream (denoted by LLE) to an organic phase (denoted by org) and an aqueous phase (denoted by aq). We assume there exist five components: C are raw material, C3is the product, I1is a byproduct and cat is the acidic catalyst, all of which flow from an upstream reactor to the continuous separation device. Pure organic and aqueous solvents (S device. The total number of components is thus n of this system is depicted in Fig. 2.
The mass and component balances are expressed by the nonsmooth formulation (8) that was originally developed for VLE systems [41] and whose thermodynamical
and C
1
and S2) are added prior to feeding to the separation
1
LLE
= 7. A process flow diagram
c
2
238 M. Patrascu and P. I. Barton
https://t.me/medicina_free
Fig. 2 Process flow diagram of a continuous liquid-liquid separation device
correctness was proven in [26]. This formulation uses the nonsmooth mid function, which picks the median out of three arguments. Due to the short residence time we can assume a pseudo steady-state, equilibrium-limited separation, where K
LLE
i
are constant partition coefficients, and perfect separation of the organic and aqueous phases is simulated.
org
F
(t)w
S
1
F
(t)w
org
F
(t) +F
0 = mid
F
org
w
(t) = K
i
org
(t) +Faq(t)w
i
S
1
(t) +F
i
aq1
org
F
org
(t)
F
org
(t) +Faq(t)
LLE
i
S
(t) = Fin(t) +F
org
F
(t) +Faq(t)
aq
w
i
aq
(t) = Fin(t)w
i
S
2
2
(t)w
(t), i = 1,...,n
i
S
1
(t) +F
LLE
nc
(t)
− 1,
i=1
,
(t), i = 1,...,n
in
(t)+ (8a)
i
LLE
,
c
S
2
(t), (8b)
LLE
nc
w
aq
i
LLE
c
i=1
org
w
(t), (8c)
i
(t) −
. (8d)
The feed flow rates of the solvents are assumed to be perfectly controlled to obtain 0.12 %w of the desired component C in the aqueous phase. A naive approach will be to simply write Finw however, this formulation may result in a high index system or an unphysical solution, since F
org
is determined from the nonsmooth equation (8c), and may equal to zero if only the aqueous phase exists. Furthermore, the concentration w be too small to enable the desired 0.12 %w. Therefore, we use a direct nonsmooth formulation using the max function to determine F
in
inlet composition w
S
1
F
(t) = Fin(t) max0,
, as follows:
i
w
0.12
in
(t)
C
3
in the organic phase and 20 %w of C
3
−w
in
(t) +w
C
3
S
1
in I
and F
(t) +w
1
S
2
, depending on the
in
(t)
C
1
in
= 0.12F
C
3
org
in
might
C
3
, (9)
2
;
Nonsmooth Modeling for Simulation and Optimization of Continuous... 239
https://t.me/medicina_free
4
(a)
3.5
3
2.5
2
Flow rates
1.5
1
0.5
0
0 2 4 6 8 10
Time [h]
pur1
F
F
F
F
raf1
LLE1 S
1
LLE1 S
2
1.2
(b)
1
0.8
0.6
Mass fraction
0.4
0.2
0
0 2 4 6 8 10
Time [h]
pur1
Σw
-Σw
i
pur1
Σw
i raf1
Σw
i raf1 i
Fig. 3 Nonsmooth dynamics associated with continuous liquid-liquid extraction. Inlet solvent flow rates and outlet flow rates (a) and composition of the organic (raf1) andaqueous (pur1) phases (b) during the start-up process
S
2
F
(t) = Fin(t) max0,
in
w
(t)
C
0.2
2
−w
in
(t) +w
C
2
in cat
(t)
. (10)
1
We can now simulate (solve) the nonsmooth model, Eqs. (8)–(10). Note that this is a pure algebraic system of equations, however, it is a dynamic one since it is connected to an upstream dynamic unit, i.e. the inlet stream to this unit changes with time (rate and composition).
Figure 3 depicts a start-up process of an example system (more details can be found in [22]). Initially, pure C
(in practice the solvent from the upstream reactor)
2
flows into the membrane separator and is mixed with a water stream, at a flow rate,
S
2
F
, determined by Eq. (10). Temporarily, only one flowing phase exists, Faq, and
the flow rate of the raffinate, F
org
, is zero. Equation (8c) picks the correct argument
(or selection function) of the mid function and becomes:
because the expression
is between 0 and 1, as illustrated in Fig. 3b. The other argument equals −1inthis case. Two phases will exist only when the above expression equals zero. At this time the mass fractions associated with F the organic phase does not exist. As flow of organic components from the reactor increases, the liquid solution approaches the two-phase thermodynamic regime, the expression above rapidly approaches zero, reaching it at t ∼ 2.75 h. At this point the mid function switches between the selection functions, and Eq. (8c) reads:
LLE
n
c
i=1
0 =
org
F
aq
w
(t) −
i
org
(t)
F
(t) +Faq(t),
LLE
n
c
org
w
(t)
i
i=1
org
are pseudo mass fractions, because
240 M. Patrascu and P. I. Barton
https://t.me/medicina_free
0 =
LLE
n
c
i=1
aq
w
i
(t) −
LLE
n
c
i=1
org
w
(t),
i
which simulates the existence of two phases, reaching the steady-state of this example system.
3.2 Crystallization
Next we look at crystallization processes [17, 19, 43]. In these processes the solid phase of component C is formed from a liquid phase (a solution of C, a solvent, and often other components). This is a relatively slow process and is usually represented by a concentration dependent kinetic expression. The reverse process, dissolution, is usually much faster compared to crystallization. These two modes, formation­growth and dissolution-disappearance, are important to take into account when modeling the dynamics of crystallizers, especially when changes in the operating conditions (such as temperature or feed composition) may lead toswitching between the modes. This is accomplished by the following nonsmooth equations (min, max and |·|all being examples of nonsmooth functions) [22]:
nG−1
G(t) = maxk
G
D(t) = min0,k
(t)s (t )|s(t)
(t)s (t )|s(t)
D
|
, 0, (11a)
nD−1
|
, (11b)
B(t) = G(t)
Here, the absolute function is necessary to avoid the undefined operation of raising a negative number to a positive but non-integer power. D, G, and B are the dissolution, growth, and nucleation (birth) rates of crystals, which are functions of the supersaturation, s, defined as:
where the saturation mass fraction, w
and kDare temperature-dependent empirical rate constants calculated from:
k
G
and k
is a constant. nD, nG, and nBare empirical rate orders.
B
(t)
k
B
kG(t)
w
s(t) =
k
= k
G
k
D
exp−k
G,0
= 10kG, (13b)
nB−n
|
|
s(t)
l
(t) −w
C
sat
w
T(t)
(
C
sat
, is assumed to be temperature dependent.
C
G,1
D(t)
sat
C
G
T(t)
(
)
+
n
(t). (11c)
1
2L
)
, (12)
/(T + 273), (13a)
Nonsmooth Modeling for Simulation and Optimization of Continuous... 241
https://t.me/medicina_free
These kinetic rate equations are coupled to dynamic continuous flow models of mass and component balances, known as mixed suspension mixed product removal (MSMPR) models. Here, the occupied volume, V , is allowed to change freely.
dM
dt
i
(t) = F
in
− F
(t)w
i,in
(t)εw(t)w
out
(t)
,l
(t) +(1 − εw(t))w
i
,s
(t),i= 1,...,nc,
i
(14)
(t) = Mεw(t)w
M
i
,l
(t) +(1 − εw(t))w
i
,s
(t),i= 1,...,nc,
i
(15)
(t) = ε(t)ρl+(1 −ε(t))ρs, (16)
ρ
m
ε
(t) = ε(t)ρl/ρm(t), (17)
w
where F
ε(t) = 1 − k
M(t)= ρ
n
c
w
i=1
and F
in
,l
(t) = 1, (20)
i
are the mass flow rates in and out, respectively, ε and εware the
out
(t), (18)
vμ3
(t)V (t), (19)
m
liquid volume and mass fractions, respectively (which are calculated based on the crystal size distribution, as described below). ρ the mother liquor and the crystals, respectively, k and μ
is the third moment of the crystal size distribution (CSD), determined from
3
and ρsare the (constant) density of
l
is the shape factor of the crystals
v
a solid particle population balance, as follows:
The mass of solid at a given time is calculated from a dynamic population balance for the MSMPR configuration. Assuming the McCabe law is valid (growth rate is independent of size) a general population balance takes the PDE form:
∂(V n)
(t, z) +(G(t) +D(t)
∂t
∂(V n)
)
∂z
(t, z) = Q
(t)nin(t, z) −Q
in
(t)n(t, z),
out
(21a)
(V n)(t, 0) = B(t)V (t), (21b)
(V n)(t, +∞) = 0, (21c)
(V n)(0,z)= n
where Q
(t) = Fin(t)/ρland Q
in
(z), (21d)
0
rates in and out, respectively, n is the population density of crystals. Equation (21), which is a PDE, is often discretized by an upwind finite volume method to obtain a set of DAEs to be solved numerically by a DAEs solver.
(t) = F
out
(t)/ρm(t) are the volumetric flow
out
242 M. Patrascu and P. I. Barton
https://t.me/medicina_free
F
should be a degree of freedom to determine the optimal residence time and
out
enable to drain and fill the vessel during shutdown and start-up steps. This can also be modeled by a nonsmooth equation:
(t) = u(t)C
F
out
where u is a valve position, C
V(t)− V
√
v
|V(t)− V
is the flow coefficient of the valve, V
v
min
min
, (22)
|+
min
is a small liquid volume below which flow is not permitted (similar to a weir), and  is a small positive number used to make the function Lipschitz continuous.
Let us demonstrate the nonsmooth behavior associated with the transition between crystal growth and dissolution in continuous crystallizers with an example which was first discussed in [22]. Figure 4 illustrates nonsmooth dynamics. First, the vessel is almost empty and contains no crystals (ε
= 1), and the concentration
w
of C is zero, so the supersaturation s is negative. Hence, the nonsmooth equations (11) set the growth rate to zero and the dissolution rate, D,isnegative(butε
w
stays constant, since there is no solid phase). At time t ≈ 1.2h concentrated solution of C flows into the vessel (followed by volume increase) and the supersaturation rapidly becomes positive, switching from dissolution to growth mode (D = 0, G>0), leading to crystal formation, such that ε
falls below one.
w
In this example, at time t = 4 h two control actions are initiated which lead
to dilution of C in the liquid phase. These actions cause the mass fraction w
l
decrease, lowering the supersaturation to a small negative value, switching back to a dissolution mode and increasing ε
slightly. As long as a solid phase exists the
w
supersaturation will be very close to zero, especially when dissolution occurs, which is very fast. After a few minutes the supersaturation crosses zero again, switching back to crystal growth mode. This example illustrates that a crystallizer can switch
to
15
(a)
10
5
0
-5
-10
-15
0 1 2 3 4 5
Time [h]
Fig. 4 Nonsmooth dynamics in a crystallizer during a start-up step. (a) Growth rate, dissolution rate, and the holdup volume. (b) the supersaturation (s), whichis scaled by a factor of 50 for clarity, and the liquid mass fraction (ε
1
(b)
0.8 50s
0.6
ε
w
0.4
G
0.2
D
V
0
0 1 2 3 4 5
Time [h]
)
w
Nonsmooth Modeling for Simulation and Optimization of Continuous... 243
https://t.me/medicina_free
Fig. 5 Process flow diagram of the continuous manufacturing pilot plant. The control valves chosen for the dynamic optimization of the production process, u of the unit and stream names, as labeled here, are referred to in the text
− u5, are highlighted. Some
1
between dissolution and growth several times during start-up, and this sequence of switches is hard to predict a priori.
4 Dynamic Optimization Using Nonsmooth Formulation
The parametric sensitivity information of nonsmooth DAE models introduced in Sect. 2.2 enables the rigorous optimization of continuous pharmaceuticals manu­facturing processes, using gradient-based algorithms. Plant-wide dynamic models of a full production line have been reported in the literature [7, 22], and have been used to find optimal production procedures, including start-up and shutdown phases [23, 24]. These models have been developed for a pilot plant which was operated at the Novartis-MIT Center for Continuous Manufacturing [19]. Next, we demonstrate how nonsmooth DAE models can be used to optimize the dynamics of entire production campaigns.
A schematic process flow diagram of the pilot unit, which includes reaction,
separation, and formulation steps is depicted in Fig. 5. The raw material, C
,isfed
1
244 M. Patrascu and P. I. Barton
https://t.me/medicina_free
to a mixer (M1), together with excess of the second reactant, C2, and the catalyst, cat1. The mixed stream enters a PFR type reactor (R1) to produce the intermediate C
and impurity I1. Solvents S1and S2are added in Mixer M2. C2and cat1 are
3
dissolved in S
while unreacted C1,C3, and I1are dissolved in S1. LLE1 separates
2
the two liquid phases. The organic phase continues downstream for separation. The intermediate compound C
is crystallized in twosequential mixed suspension mixed
3
product removal (MSMPR) crystallizers (Cr1, Cr2). The filter cake is collected and transported into a well-mixed vessel (D1) to which S reduce the concentration of C
to the desired level.
3
A T-mixer (M3) is used to mix the slurry with aqueous HCl to synthesize C
is added to dissolve and
1
by
4
removing the protecting Boc group in Reactor R2 at room temperature where the impurity I phase with C settler (LLE2) and diluted with S with C
is formed. Next the acid is neutralized by adding NaOH. The organic
2
is subsequently separated from the aqueous phase inside a mixer-
4
in a T-mixer downstream of LLE2. The mixture
1
is diluted with S1and mixed with fumaric acid (FA) in a two-stage reactive
4
crystallization (Cr3, Cr4) to crystallize the API. The crystals of API are separated from the mother liquor in a continuous washing and filtration stage (WF2) and then diluted in a well-mixed buffer tank (D2). The slurry with API is mixed with a slurry of silicon dioxide before being fed to a two-stage continuous dryer, which consists of a drum dryer (DD) followed by a tubular dryer with a rotating screw to convey the powder (SD). Finally, the API powder is mixed with polyethylene glycol (PEG) in the extruder (Ex). On-spec product must satisfy the following critical quality attributes: At least 34 %w of the API. Maximum of 0.3 %w of I %w of the total of I
and I2.
1
and maximum 0.5
2
4.1 Problem Formulation
In the pharmaceutical industry achieving a high yield is most often extremely important as the raw materials are very expensive. Thus, we would usually like to find the optimal yield of a manufacturing campaign given some desired productivity (i.e. total volume/mass of final product produced).
The following problem formulation is motivated by the detailed discussion in [25]. It also makes use of nonsmooth models, as demonstrated below. The entire time horizon of the manufacturing campaign is divided into 3 epochs; off­spec, on-spec and off-spec again, on time intervals [0,t respectively. On-spec production is only accounted for during the second epoch, and is guaranteed by enforcing appropriate quality constraints, q. This ensures computable sensitivities of the resulting hybrid (discrete/continuous) system by fixing the mode sequence [10, 25]. t variables, enabling the optimizer to find the longest on-spec production phase (epoch) possible. The concept is similar to the classical approach of a start-up, steady-state (on-spec)operation and shutdown sequence but with amajor difference; the on-spec epoch does not have to be steady. Consequently, this formulation is a
on
and t
), [ton,t
on
are included in the decision
off
] and (t
off
off,tf
],