Chapter 8
Engineering applications
Engineering problems were the first home of the EASY-IEC toolbox, and they show the strength of IEC most clearly: several computable objectives whose trade-off is a matter of experience. This chapter presents six of them — PID tuning, control of an exothermic reactor at its unstable steady state, the temperature profile of a beer fermentation, interpretable fuzzy partitions, robot paths and an image-segmentation pipeline — with their models, their objectives and the ground-truth utilities that let simulated engineers evaluate them. Their benchmark follows in chapter 10, an AI judge on the segmentation problem in chapter 11.
8.1 Why IEC in engineering
A controller, a recipe or a pipeline is judged by several objectives at once — speed against robustness, yield against quality, accuracy against simplicity — and by criteria that experienced engineers recognize but rarely formalize: a response that “rings”, a profile that “stresses the yeast”. Multi-objective optimization can compute the Pareto front, but the engineer still has to choose on it, and a front of a five-objective problem is hard to read. IEC lets the engineer judge what they understand best — the simulated behaviour — and lets the algorithm handle the parameters [2]. Every engineering problem of the package therefore renders the behaviour that engineers look at, reports its key performance indicators through objectives, and defines a target-free utility from them that serves as the hidden taste of simulated engineers. The utilities are hypotheses about good engineering practice, chosen so that random parameters score low and good tunings close to 1; they make benchmarks possible, not engineering decisions.
8.2 PID tuning
The plant is a first-order process with dead time, with , s and s, controlled by a two-degree-of-freedom PID with proportional gain , integral time , derivative time , setpoint weight and derivative filter , an actuator limit and anti-windup by conditional integration. Each candidate shows the response to a setpoint step at 2 s and a load disturbance at 50 s, with the controller output below. The objectives are the integral absolute error (IAE) of the setpoint response, the overshoot, the settling time, the total variation of the controller output and the IAE of the disturbance response. The SIMC rules of Skogestad [65] give a well-known reference tuning (, s with ); the ground-truth utility rewards an IAE close to that of SIMC, little overshoot and moderate control effort. A simulated engineer whose taste is the SIMC response reaches it within a dozen galleries with EASY-IEC (fig. 8.1).
user = ei.SimulatedUser(problem, target="SIMC", noise=0.04, seed=3) result = ei.run(problem, EasyIEC(pop_size=9), user, generations=12, seed=3) print(problem.describe(result.best.genome))
8.3 An exothermic reactor at its unstable steady state
The continuous stirred tank reactor with an exothermic first-order reaction AB and jacket cooling is the classical benchmark of nonlinear process control [66, 67]. With the standard parameter values the reactor has three steady states; the operating point at about 350 K and 0.5 mol/L is the middle one, which is open-loop unstable (the eigenvalues of the Jacobian are about and per minute), so a poor tuning leads to runaway or extinction. The coolant temperature, limited to 250–350 K and to a slew rate of 600 K/min, is the manipulated variable. The scenario raises the setpoint from 350 to 355 K after one minute and the feed temperature by 3 K after eight minutes; temperatures above 380 K count as a safety violation and give zero utility. Two controller families are tuned: a PID with setpoint weighting, written in deviation variables, and a dynamic matrix controller [68] with prediction and control horizons, move suppression and a reference filter. As DMC is designed for stable plants, it supervises a fixed proportional temperature loop, the usual arrangement of model predictive control on top of regulatory control; DMC tuning was the MPC example of the original EASY-IEC paper [2]. Each candidate shows the reactor temperature with its setpoint, the coolant temperature and the concentration (fig. 8.2).
for controller in ["pid", "dmc"]: problem = CSTRControl(controller=controller) user = ei.SimulatedUser(problem, target="default", noise=0.04, seed=2) results[controller] = (problem, ei.run(problem, InteractiveCMAES(pop_size=8), user, generations=12, seed=2)) print(controller, problem.describe(results[controller][1].best.genome))
8.4 The temperature profile of a beer fermentation
The temperature profile of a lager fermentation trades batch time against flavour: warm fermentation is fast but produces diacetyl, which tastes of butter, and esters such as ethyl acetate; cold fermentation is clean but slow. The kinetic model of de Andrés-Toro et al. [9] describes latent, active and dead biomass, sugar, ethanol, diacetyl and ethyl acetate with Arrhenius-type temperature dependence under industrial conditions; the package uses it in the corrected form of Rodman and Gerogiorgis [69]. A beer fermentation was the profile-design example of EASY-IEC and of the interactive PSO [2, 3]. The profile is a piecewise-linear curve through six knots between 9 and 16 °C over 150 hours, integrated by a fourth-order Runge–Kutta method. The objectives are the final ethanol, the batch time (when the sugar is consumed), the diacetyl concentration with a taste limit and the ethyl acetate concentration with an acceptable band (illustrative specifications of 0.5 and 0.5–1.5 in the model’s concentration units, to be set for a given beer), and the total variation of the profile. Held above about 15 °C, the death of active cells stalls the fermentation with residual sugar — a stuck fermentation, which the utility penalizes through the batch time and the ethanol. The problem is editable: a brewer can drag the knots of the chosen profile, and the edited profile enters the population as a new individual (fig. 8.3).
user = ei.SimulatedUser(problem, target="industrial-like", noise=0.04, edit_prob=0.3, edit_step=0.4, seed=5) result = ei.run(problem, InteractiveGA(pop_size=8), user, generations=12, seed=5) edits = [i for i in result.log.individuals.values() if i.origin == "edit"] print(len(edits), "edited profiles;", problem.describe(result.best.genome))
Open in ColabExample plot_03_beer_fermentation.py in the gallery
8.5 Interpretable fuzzy partitions and robot paths
A fuzzy partition of an input variable is interpretable when its terms are ordered, cover the domain, overlap moderately and sum to about one — the interpretability criteria of fuzzy modelling [70, 71]. FuzzyPartitionDesign evolves the peaks and widths of five triangular terms; a canonical repair sorts the peaks with their widths, and the objectives measure coverage, the maximal similarity of neighbouring terms and the deviation from a Ruspini partition. A robot path from the lower-left to the upper-right corner of a field with eight obstacles is given by five via-points; the objectives are length, clearance, collision and curvature, and the utility penalizes collisions strongly. Both problems are editable — a person may drag a peak or a via-point — and both show the value of seeing the phenotype: a path that grazes an obstacle is obvious in the picture and invisible in a table of coordinates. The path landscape is rugged, since a small move of a via-point can cut through an obstacle; an offline optimizer with the same utility reaches about 0.8, the interactive GA of the example 0.68 after 25 galleries.
Open in ColabExample plot_04_fuzzy_and_paths.py in the gallery
8.6 An image-segmentation pipeline with a ground truth
Segmentation pipelines — smoothing, background subtraction, thresholding, morphological opening and closing, removal of small objects — have interacting parameters, and their quality is usually judged by looking at the outlines. ImageSegmentation applies such a seven-parameter pipeline to a synthetic microscopy scene of 20 cells of different contrast on an uneven, noisy background (fig. 8.5). Because the scene is synthetic, the true mask is known, and the Dice coefficient of each candidate is an objective measure of its quality; the ground-truth utility multiplies the Dice coefficient by a penalty on the error in the number of cells. Random pipelines score between 0 and 0.2; good ones above 0.85. The problem is therefore a test bed for evaluators: a person or an AI judge looks at red outlines, and the Dice coefficient tells how good the judgement-driven tuning really is. It is the main problem of the Claude study in chapter 11.
In a nutshell: Engineering applications
- Engineering problems render the behaviour engineers judge, report their KPIs and define a target-free utility for simulated engineers.
- PID tuning against SIMC, PID and DMC control of an unstable reactor, and a beer fermentation profile with knot dragging reproduce and extend the examples of EASY-IEC.
- Fuzzy partitions and robot paths show the value of seeing the phenotype; both are editable.
- The segmentation problem has a true mask, so the Dice coefficient measures how good a judgement-driven tuning is: a test bed for evaluators.