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.

Fit Binding Model Parameters

Fit Binding Model Parameters

This example demonstrates how to estimate SMA binding parameters based on multiple gradient elution chromatograms. It assumes familiarity with the CADETProcess process models, as introduced in the Fit Column Transport Parameters example.

Process creation

To simplify the creation of multiple Process instances with the correct configurations, the process creation was wrapped into a function below:

Creating “experimental” data

To run the parameter estimation algorithm, we need experimental data. This function generates in-silico based “experimental” data for us to use.

Below are two convenience functions, written to simplifly loading references and creating comparators.

['adsorption_rate', 'desorption_rate', 'equilibrium_constant', 'kinetic_constant', 'characteristic_charge']
<Figure size 354.331x472.441 with 2 Axes>
<Figure size 354.331x472.441 with 2 Axes>
<Figure size 354.331x472.441 with 2 Axes>

Optimizer

Run Optimization

==========================================================
n_gen  |  n_eval  | n_nds  |      eps      |   indicator  
==========================================================
     1 |       64 |      4 |             - |             -
     2 |      128 |      3 |  0.2458727913 |         ideal
     3 |      192 |      2 |  7.430050E+01 |         ideal
     4 |      256 |      2 |  1.638312E+01 |         ideal
     5 |      320 |      5 |  0.6340525215 |         ideal
     6 |      384 |      4 |  2.7995863745 |         ideal
     7 |      448 |      5 |  0.7443694659 |         ideal
     8 |      512 |      3 |  0.4247887690 |         ideal
     9 |      576 |      3 |  0.3843428802 |         ideal
    10 |      640 |      4 |  0.0957394546 |         ideal
    11 |      704 |      1 |  0.0217139075 |         ideal
    12 |      768 |      2 |  1.0000000000 |         ideal
    13 |      832 |      2 |  0.000000E+00 |             f
    14 |      896 |      3 |  0.2725701431 |         ideal
    15 |      960 |      4 |  0.0504104568 |         ideal
    16 |     1024 |      6 |  0.0527201862 |         ideal
    17 |     1088 |      7 |  0.0714330609 |         ideal
    18 |     1152 |      5 |  0.0884222111 |         ideal
    19 |     1216 |      2 |  1.0000903844 |         ideal
    20 |     1280 |      3 |  1.0000000000 |         ideal
    21 |     1344 |      4 |  0.0192336387 |             f
    22 |     1408 |      5 |  0.6709755278 |         ideal
    23 |     1472 |      6 |  0.2500102707 |         ideal
    24 |     1536 |      7 |  0.0030354418 |         nadir
    25 |     1600 |      9 |  0.0918570415 |             f
    26 |     1664 |      9 |  0.000000E+00 |             f
    27 |     1728 |     10 |  0.1445561489 |         ideal
    28 |     1792 |     11 |  0.0551777928 |             f
    29 |     1856 |     12 |  0.2272831441 |         ideal
    30 |     1920 |     12 |  0.0232568034 |         ideal
    31 |     1984 |     14 |  0.2291734081 |         ideal
    32 |     2048 |     15 |  0.0211017082 |         ideal
    33 |     2112 |     14 |  0.0208340462 |         ideal
    34 |     2176 |     16 |  0.0223889952 |         ideal
    35 |     2240 |     14 |  0.0652203901 |         ideal
    36 |     2304 |     14 |  0.1539362265 |         ideal
    37 |     2368 |     15 |  0.0107544266 |         ideal
    38 |     2432 |     15 |  0.0632699526 |         nadir
    39 |     2496 |     14 |  0.0029308958 |         ideal
    40 |     2560 |     13 |  0.0662293451 |         nadir
    41 |     2624 |     11 |  0.1562516771 |         ideal
    42 |     2688 |     14 |  0.0265877040 |         ideal
    43 |     2752 |     12 |  0.1336083621 |         ideal
    44 |     2816 |     11 |  0.0112375769 |         ideal
    45 |     2880 |     13 |  0.0645179513 |         ideal
    46 |     2944 |     12 |  0.1163267668 |         ideal
    47 |     3008 |     14 |  0.0715672492 |         ideal
    48 |     3072 |     15 |  0.0359656845 |         ideal
    49 |     3136 |     15 |  0.0290834801 |         ideal
    50 |     3200 |     14 |  0.0843695595 |         ideal
    51 |     3264 |     15 |  0.0212798019 |         ideal
    52 |     3328 |     14 |  0.1578133269 |         ideal
    53 |     3392 |     15 |  0.1111127538 |         ideal
    54 |     3456 |     15 |  0.1527773684 |         ideal
    55 |     3520 |     18 |  0.0647269001 |         ideal
    56 |     3584 |     10 |  0.2661438129 |         ideal
    57 |     3648 |      8 |  0.0491141417 |         ideal
    58 |     3712 |     10 |  0.1972661490 |         ideal
    59 |     3776 |     14 |  0.0282580878 |         ideal
    60 |     3840 |     15 |  0.0121572147 |             f

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.

[[7.40134434e+00 9.86732866e+02 7.50085924e-03 1.01344552e-03
  1.04178208e+01]
 [2.97091005e+00 7.29792764e+02 4.07089546e-03 1.37025201e-03
  9.97912957e+00]
 [8.73517131e+00 9.86283644e+02 8.85665231e-03 1.01390711e-03
  1.01543815e+01]
 [5.71285679e+00 7.96372673e+02 7.17359721e-03 1.25569351e-03
  1.05845365e+01]
 [8.34651888e+00 9.88080135e+02 8.44720846e-03 1.01206366e-03
  1.02532446e+01]
 [7.51967596e+00 9.98281396e+02 7.53262155e-03 1.00172156e-03
  1.05647766e+01]
 [6.79115861e+00 9.88651926e+02 6.86910978e-03 1.01147833e-03
  1.04736174e+01]
 [6.16646889e+00 9.11403268e+02 6.76590605e-03 1.09720914e-03
  1.04327875e+01]
 [5.64722129e+00 8.24202442e+02 6.85174054e-03 1.21329415e-03
  1.04684073e+01]
 [6.20075107e+00 9.87492760e+02 6.27928762e-03 1.01266565e-03
  1.06135980e+01]
 [5.63887914e+00 8.24202442e+02 6.84161906e-03 1.21329415e-03
  1.04684073e+01]
 [4.91274304e+00 7.28741328e+02 6.74140858e-03 1.37222902e-03
  1.05003404e+01]
 [6.70934914e+00 9.79218215e+02 6.85174054e-03 1.02122283e-03
  1.04667574e+01]
 [6.51278785e+00 9.81670271e+02 6.63439451e-03 1.01867198e-03
  1.05977542e+01]
 [6.82859473e+00 9.98147571e+02 6.84126770e-03 1.00185587e-03
  1.06267587e+01]]
[[2.87252352e-03 3.08384801e-04 4.52488657e-04 1.55586689e-04
  4.06281622e-03 3.67082058e-03]
 [3.17666868e-02 9.14230477e-04 4.31857923e-02 1.76706471e-03
  4.70940651e-02 1.06957941e-03]
 [1.97486278e-03 5.21537676e-03 4.52488657e-04 4.55914690e-03
  1.08342319e-03 7.02857896e-03]
 [8.97665827e-04 6.16608811e-05 4.29861606e-03 2.03049776e-03
  9.47967269e-03 7.46588275e-03]
 [1.97486278e-03 3.53643677e-03 4.52488657e-04 3.09071598e-03
  2.97940614e-03 6.08826366e-03]
 [0.00000000e+00 8.17990160e-04 5.65604828e-03 5.59465903e-04
  1.08338123e-02 4.11018826e-03]
 [4.84735880e-03 1.50234061e-03 1.80995277e-03 2.31392390e-03
  1.89598906e-03 1.76095516e-03]
 [5.74499963e-03 7.12584025e-04 3.84613488e-03 1.19926014e-03
  5.41711756e-04 2.87084335e-03]
 [4.84735880e-03 2.96537840e-05 1.80995277e-03 7.92748815e-04
  1.89598906e-03 5.42569158e-03]
 [4.84735880e-03 3.72834410e-03 1.35746523e-03 4.48094123e-03
  3.25025941e-03 3.59009676e-04]
 [4.84735880e-03 3.64159839e-05 2.03619628e-03 7.63834459e-04
  1.62513400e-03 5.39126578e-03]
 [4.84735880e-03 6.45162015e-04 1.58370908e-03 2.91613674e-03
  2.43769831e-03 8.19017828e-03]
 [4.84735880e-03 1.36078692e-03 2.26243958e-03 2.19266458e-03
  1.35427870e-03 1.86394173e-03]
 [3.77017962e-03 2.89722824e-03 6.78732927e-04 3.19596446e-03
  5.41706511e-03 1.59497584e-03]
 [1.97486278e-03 2.74066712e-03 3.16741022e-03 2.86542346e-03
  8.39633573e-03 2.06449741e-03]]

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.

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.

All figures are 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).