# The Exact Local Method with Explicit Solution¶

Every industrial process is under limitations ranging from design/safety (e.g. temperature or pressure which an equipment can operate, etc.), environmental (e.g. pollutant emissions), to quality specifications (e.g. product purity), and economic viability. More often than not, these constraints are applied all at once and can be conflicting. Therefore, it is mandatory to operate such processes optimally (or, at least, close to its optimal point) in order to attain maximum profits or keep expenses at minimum while still obeying these specifications.

One way to achieve this is through the application of plantwide control methodologies. In particular, Self-Optimizing Control (SOC) [28][31][2], is a practical way to design a control structure of a process following a criterion (for instance: economic, environmental or performance) considering a constant set-point policy [3]. The SOC methodology is advantageous in this scenario because there is no need to reoptimize the process every time that a disturbance occurs.

However, the review presented here contains merely the paramount elements needed to understand the main concepts and expressions that translate the ideas behind the SOC methodology. If the reader needs a more detailed explanation can be found in [31][13][15][14][2][3][22][21][35].

From [32]:

“Self-optimizing control is when one can achieve an acceptable loss with constant setpoint values for the controlled variables without the need to reoptimize when disturbances occur.”

It is assumed the process objective function, assumed scalar, is influenced by its steady-state operation. Therefore, the optimization problem described in (3) is formed, with \(J\) being the cost function, \(u_{0}\) being the degrees of freedom available, \(x\) and \(d\) representing the states and the disturbances of the system, respectively.

Regarding the disturbances, these can be: change in feed conditions, prices of the products and raw materials, specifications (constraints) and/or changes in the model. Using NLP solvers, the objective function can be optimized considering the expected disturbances and implementation errors.

Since the whole technology considers near-optimal operation, as a result of keeping constant setpoints (differently from RTO, for instance), there will always exist a (positive) loss, given by (4):

*Metacontrol* focus on the first four steps of the SOC technology, named by
[31] as “top-down” analysis. In these steps, the variable
selection seeking the usage of the steady-state degrees of freedom
is the main problem to be addressed with the systematic procedure proposed. It
is possible to search for a SOC structure basically using two methods:

- Brute-force approach:
Manually testing each possible control structure, reoptimizing the process for different disturbances’ scenarios, and choosing the structure that yields the lowest (worst-case or average-case) loss;

- Local approximations:
Using local methods based on second-order Taylor series expansion of the objective function, that are capable of easily and quickly “pre-screening” the most promising CV candidates;

The manual nature of the brute-force approach and the possibility of creating
an automated framework using local approximations motivated the creation
of *Metacontrol* itself. However, the current version of the software only
implements the second method.

Therefore, a linear model with respect to the plant measurements (\(y\)) can be represented as (5).

with:

Where \(u\) are the manipulated variables (MV), \(G^{y}\) and \(G^{y}_{d}\) are the gain matrices with respect to the measurements and disturbances, respectively. Regarding the candidate variables (CV), linearization will give (6):

With

Where \(H\) is a linear combination matrix of the CVs.

Linearizing the loss function (4) results in (7):

where \(J_{uu}\) being the Hessian of cost function with respect to the manipulated variables \(\left(\frac{\partial^{2} J}{\partial^{2} u}\right)\) and \(J_{ud}\) being the Hessian of cost function with respect to the disturbance variables \(\left(\frac{\partial^{2} J}{\partial u\partial d}\right)\).

Later [13], developing the exact local method, showed that the loss function can be rewritten as in (8)

If one assumes that \(W_d\) is a (diagonal) magnitude matrix that considers the disturbances and \(W_{n}^y\) the magnitude matrix that takes into account the measurement error, and considering that both are 2-norm-bounded ([13] and [2] contains a discussion and justification for using 2-norm), (9) to (11) can be defined to scale the system:

Where \(n^{y^{\prime}}\) being the implementation error with respect to the measurements

The loss function from (7) can be also written in a more appropriate way considering the definition of [2] of the uncertainty variables regarding the contribution of the disturbances and measurement error on the incurred loss, (12) and considering the scaled system from (9) to (11)

where:

with \(F\) being the optimal measurement sensitivity matrix with respect to the disturbances.

Finally, if one uses all the definitions described so far, the worst-case loss for the effect of the disturbances and measurement error is given by (13):

(13) shows that in order to minimize the worst-case loss, it is necessary to minimize \(\bar{\sigma}(M)\), (14):

This optimization problem was initially solved using a numerical search, as proposed by [13]. Fortunately, [2] derived an explicit solution that gives the optimal linear combination of measurements coefficient matrix (H) that minimize the worst-case loss that exists due to the effect of the disturbances and measurement errors, in (15):

where

Assuming that \(\tilde{F} \tilde{F}^{T}\) is full rank.

(15) has three interesting properties proved by [2]:

It applies to any number of measurements (\(n_{y}\)).

The solution for \(H\) was proved to minimize not only the worst-case, but also the average-case loss. Therefore, if one uses (15) seeking the determination of a control structure that minimizes the loss at the worst-case scenario, he is also minimizing the loss for the average-case scenario. This was called as a “super-optimality” by [2].

The solution proposed minimizes the

*combined*effect of the disturbances and the measurement errors, simultaneously.

Therefore, the usage of the explicit solution will give both the minimized worst
and average case losses using a single evaluation, and will also consider the
combined effect of the disturbances and measurement errors of the problem.
Therefore, this solution it is the default one used in *Metacontrol*.

Since (15) also minimizes the average-case loss, its evaluation
was also considered inside *Metacontrol*: the user can inspect the expected
average-case loss for each control structure that can exist in the
combinatorial problem. The expression for the average-case loss is a result of
the work of [22] and is described in (16):

Lastly, it was necessary to implement within *Metacontrol* a branch-and-bound
algorithm capable of quickly searching the best control structures for each
possible subset of a given process, using the incurred loss as metric. This was
considered by the authors of [3] as an obligatory feature,
since when *Metacontrol* is being used, it was understood that the main
idea was to, in a comprehensive software, the user operating it should be
capable of inspecting the most promising control structures, and discarding
the unnecessary evaluation of the unpromising structures (i.e.: With a high
incurred loss - both average of worst-case scenario) to save time and effort.
It is important to remember that there is an evident combinatorial problem
that grows in an explosive fashion, as the number of the unconstrained
degrees of freedom of the reduced space problem and the number of available
measurements both increases. Without a search method that is capable of
quickly discarding undesired solutions, the usability of *Metacontrol* would be
seriously compromised. Luckily, there are several implementations of
branch-and-bound algorithms tailored for SOC studies purposes, such as
in [8][7][21].

From the aforementioned works, [21] it is of particular
interest: the monotonic criterion implemented consists of the exact local
method from [13] and derived explicitly by
[2], which is used as the default methodology to pre-screen
the most promising self-optimizing CV candidates in *Metacontrol*. Therefore,
the usage of the proposed branch-and-bound algorithm by [21] it
is not only convenient, making the software more effective, but also keeps the
“calculation engine” from *Metacontrol* using the same criterion. It would not
make any sense, for instance, using a branch-and-bound algorithm that outputs the
index of the most promising CVs using the maximum singular value rule from
[33] and use the CV index sequence from this algorithm
to evaluate the worst-case loss. Fundamentally speaking, the orders of
“best” control structures would not be the same, simply because the search
method would be using an different criterion from the linear method
implemented to evaluate the \(H\) matrix.