Optimization Algorithms

Efflux uses numerical optimization to solve two classes of problems: calibration (fitting model parameters to experimental data) and process optimization (searching for operating conditions that maximize an objective such as yield or purity). Both rely on the same core algorithms, differing only in the quantity they minimize or maximize.

Calibration Objective

In calibration, the algorithm minimizes a weighted sum of per-objective errors. Each objective pairs a reference dataset (a chromatogram or fraction analysis) with the method that produced it. For each objective, the user selects which data series to fit against (UV, conductivity, pH, or individual deconvoluted species) and an error norm.

The global error that the algorithm minimizes is:

f(θ)=∑kwk⋅Ek(θ)f(\theta) = \sum_{k} w_k \cdot E_k(\theta)

where wkw_k is the weight assigned to objective kk and EkE_k is the error norm evaluated over its selected series. Three error norms are available:

  • NRMSE (Normalized Root Mean Square Error): the point-wise root mean square error between the simulated and reference signals, normalized by the range of the reference data.
  • NRMSE Integral: similar to NRMSE, but computed on the cumulative integral of the signal rather than on the raw trace.
  • Peak Position: penalizes only differences in peak elution position rather than overall curve shape.

Differential Evolution

Differential Evolution (DE) is a population-based global optimization method. It maintains a population of candidate solutions and evolves them over generations through mutation, recombination, and selection.

How it works

  1. Initialize a population of candidate parameter vectors, uniformly sampled across the bounds of each variable.
  2. For each candidate in the population, generate a mutant vector by combining three other randomly selected candidates, scaled by the mutation factor FF:
v=xr1+F⋅(xr2−xr3)v = x_{r_1} + F \cdot (x_{r_2} - x_{r_3})
  1. Perform crossover between the mutant and the current candidate with probability equal to the recombination rate, producing a trial vector.
  2. Evaluate the objective for the trial vector. If it improves on the current candidate, it replaces it in the next generation; otherwise the current candidate is kept.
  3. Repeat until the population converges (relative spread falls below tolerance), the minimum simulation count has been reached, or the maximum simulation budget is exhausted.

Parameters

ParameterDefault valueDescription
Max Simulations10,000Upper limit on the total number of simulations.
Min Simulations30Minimum number of simulations before convergence can be declared.
Population Size10Number of candidates evaluated per generation (range: 5 to 50). Larger populations explore the parameter space more broadly but require more simulations per generation.
Mutation0.8Differential weight factor (typical range: 0.5 to 2.0). Higher values increase exploration; lower values favor refinement of existing solutions.
Recombination0.7Crossover probability (0.0 to 1.0). Higher values produce more mixing between candidates; lower values let candidates evolve more independently.
Tolerance0.1Relative tolerance for convergence. Smaller values require more agreement among the population before convergence is declared.
Max Error1,000Maximum acceptable best error for convergence. If the best error exceeds this threshold, convergence is blocked and evolution continues.
Differential Evolution is the default optimization algorithm in Efflux. It is preferred when the parameter landscape is complex or the starting guess is uncertain, as usually is the case for chromatography models.

Pattern Search

Pattern Search is a local optimization method. It refines the parameters from a starting point by probing along coordinate directions and reducing the step size when no improvement is found. The algorithm is best suited for refining model parameters.

How it works

  1. Start from the initial parameter values with a step size equal to a fraction of each parameter's range (default 0.25).
  2. Evaluate the objective at trial points generated by perturbing one parameter at a time by the current step size.
  3. If a trial point improves the objective, accept it and continue from the new point. If no trial point improves the objective, halve the step size.
  4. Repeat until the step size falls below the convergence tolerance, the minimum simulation count has been reached, or the maximum simulation budget is exhausted.

Parameters

ParameterDefault valueDescription
Max Simulations2,000Upper limit on the total number of simulations. Higher values allow a more thorough search at the cost of longer run time.
Min Simulations30Minimum number of simulations before convergence can be declared, even if other criteria are met sooner.
Tolerance0.01Minimum step size before convergence is declared. Smaller values produce more precise results but require more simulations.
Initial Step Size0.25Starting step size as a fraction of the parameter range (0 to 1). Larger values explore more aggressively in the first iterations but may overshoot the optimum.
Max Error1,000Maximum acceptable best error for convergence. If the best error exceeds this threshold, convergence is blocked and the search continues.
Pattern Search converges quickly when the starting values are reasonably close to the optimum. If they are far off, the algorithm will likely settle in a local minimum. A practical approach is to run Differential Evolution first, and then refine with Pattern Search.

Troubleshooting

ProblemPossible causeSolution
Calibration converges to a poor fitPattern Search settled in a local minimumSwitch to Differential Evolution.
Reference data misaligned with the simulationAdjust the x shift on the objective to align reference and simulated traces.
Wrong error norm for the dataTry NRMSE Integral if peaks are slightly shifted, or Peak Position if timing matters more than shape.
Incorrect or missing reference data annotationRe-annotate peaks and verify species assignments on the reference data.
Calibration uses the full budget without convergingSimulation budget too lowIncrease Max Simulations.
Variable bounds too wideNarrow the bounds to reduce the search space.
Too many free variablesFix parameters that can be estimated independently and calibrate only the remaining ones.
All simulations failSimulation unstable for parameter combinations in the search rangeIncrease max solver steps or tighten tolerances. Verify that variable bounds are physically reasonable.