Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Optimize Batch Elution Process (Multi-Objective)

Optimize Batch Elution Process (Multi-Objective)

Setup Optimization Problem

Setup Simulator

Setup Fractionator

Setup Objectives

Add callback for post-processing

Configure Optimizer

Run Optimization

WARNING: pop_size=3 is less than the number of reference directions ref_dirs=56.
This might cause unwanted behavior of the algorithm. 
Please make sure pop_size is equal or larger than the number of reference directions. 
==========================================================
n_gen  |  n_eval  | n_nds  |      eps      |   indicator  
==========================================================
     1 |        3 |      2 |             - |             -
     2 |        6 |      2 |  1.0000000000 |         ideal
     3 |        9 |      2 |  0.3185710017 |         ideal

Optimization Progress and Results

The OptimizationResults which are returned contain information about the progress of the optimization. For example, the attributes x and f contain the final value(s) of parameters and the objective function.

[[512.51326166  36.54762537]
 [553.27593302 203.38731573]]
[[0.00840186 0.0085722  0.95941417 0.97886552 0.73669834 0.75163431]
 [0.01215485 0.00980644 0.26924804 0.21722713 1.56511626 1.26272308]]

After optimization, several figures can be plotted to vizualize the results. For example, the convergence plot shows how the function value changes with the number of evaluations.

(<Figure size 2125.98x236.22 with 6 Axes>, array([<Axes: xlabel='$n_{Evaluations}$', ylabel='Productivity_0'>, <Axes: xlabel='$n_{Evaluations}$', ylabel='Productivity_1'>, <Axes: xlabel='$n_{Evaluations}$', ylabel='Recovery_0'>, <Axes: xlabel='$n_{Evaluations}$', ylabel='Recovery_1'>, <Axes: xlabel='$n_{Evaluations}$', ylabel='EluentConsumption_0'>, <Axes: xlabel='$n_{Evaluations}$', ylabel='EluentConsumption_1'>], dtype=object))
<Figure size 2125.98x236.22 with 6 Axes>
<Figure size 708.661x2125.98 with 12 Axes>
<Figure size 708.661x708.661 with 6 Axes>
<Figure size 2125.98x2125.98 with 42 Axes>
<Figure size 2125.98x236.22 with 6 Axes>

The plot_objectives method shows the objective function values of all evaluated individuals. Here, lighter color represent later evaluations. Note that by default the values are plotted on a log scale if they span many orders of magnitude. To disable this, set autoscale=False.

(<Figure size 708.661x2125.98 with 12 Axes>, array([[<Axes: xlabel='cycle_time', ylabel='Productivity_0'>, <Axes: xlabel='feed_duration.time', ylabel='Productivity_0'>], [<Axes: xlabel='cycle_time', ylabel='Productivity_1'>, <Axes: xlabel='feed_duration.time', ylabel='Productivity_1'>], [<Axes: xlabel='cycle_time', ylabel='Recovery_0'>, <Axes: xlabel='feed_duration.time', ylabel='Recovery_0'>], [<Axes: xlabel='cycle_time', ylabel='Recovery_1'>, <Axes: xlabel='feed_duration.time', ylabel='Recovery_1'>], [<Axes: xlabel='cycle_time', ylabel='EluentConsumption_0'>, <Axes: xlabel='feed_duration.time', ylabel='EluentConsumption_0'>], [<Axes: xlabel='cycle_time', ylabel='EluentConsumption_1'>, <Axes: xlabel='feed_duration.time', ylabel='EluentConsumption_1'>]], dtype=object))
<Figure size 708.661x2125.98 with 12 Axes>

Note that more figures are created for constrained optimization, as well as single-objective optimization. All figures are also saved automatically in the working_directory. Moreover, results are stored in a .csv file.

  • The results_all.csv file contains information about all evaluated individuals.

  • The results_last.csv file contains information about the last generation of evaluated individuals.

  • The results_pareto.csv file contains only the best individual(s).