RuntimeWarning in optimisation

Hi,
I am looking for help with inverse fitting of SMA parameters, specifically equilibrium constant, kinetic constant and characteristic charge. I ran the optimisation overnight, unfortunately no results were obtained and runtime warnings were generated. Here are the warnings. How can I fix this?

Also, this system has two proteins, a and cyto, so I expect 10 x0 (are x0 the initial guess of optimimzation?) as I need to define equilibrium constant, kinetic constant, characteristic charge, desorption rate, adsorption rate for each protein. However, I am allowed to define 5 x0 values. What am I missing?
Also, I am afraid that my cadet process is not the latest version. Is there an ā€˜update cadet processā€™ command?
Thanks in advance.My code and experiment data are available in drive.

Your help is greatly appreciated.

Hi Mao,

it looks like the simulations get stuck. This can be caused by a high capacity in the SMA system without reference concentrations or a high characteristic charge, (charge wasnā€™t a problem for you). If I activate reference concentrations with

    binding_model.capacity = capacity
    binding_model.reference_solid_phase_conc = capacity
    binding_model.reference_liquid_phase_conc = capacity

the simulations run quickly and we get some fitting results.

They are however all bad, mostly because we observe a break-through during the loading phase. That is due to the parameters you used to set up the model. Most notably the total porosity of 0.97, which means your column only contains 3 % stationary phase and only has 1e-6 mĀ³ * 0.03 * 680 mol / mĀ³ = 2e-5 mol of total ionic binding sites. You load 643 mM * 1e-6 / 60 mĀ³ / s * 30 s = 3.2e-4 mol of cyto onto the column, with a characteristic charge of 10 and a steric factor of 10, so it needs 6.4e-3 binding sites in total. So youā€™ll need to look over your parameters. The porosity as well as the concentration of your proteins look a bit off.

Also, this system has two proteins, a and cyto, so I expect 10 x0 (are x0 the initial guess of optimimzation?) as I need to define equilibrium constant, kinetic constant, characteristic charge, desorption rate, adsorption rate for each protein. However, I am allowed to define 5 x0 values. What am I missing?

You define the parameters (e.g. the adsorption rate) like this:

optimization_problem.add_variable(
    name='adsorption_rate',
    parameter_path='flow_sheet.column.binding_model.adsorption_rate',
    lb=1e-10, ub=1e10,
    transform='auto',
    indices=[1]  
)

with indices=[1]. This means, that this ā€˜adsorption_rateā€™ parameter is only going to affect the component at index 1, so ā€œaā€. To also modify ā€œcytoā€ you need to add another variable with e.g.

optimization_problem.add_variable(
    name='adsorption_rate_cyto',
    parameter_path='flow_sheet.column.binding_model.adsorption_rate',
    lb=1e-10, ub=1e10,
    transform='auto',
    indices=[2]  
)

Youā€™ll need to do this for all parameters as well as the parameter dependencies. I recommend setting up a function that adds the variables for a given index and then calling that function twice with index=1 and index=2.

Also, I am afraid that my cadet process is not the latest version. Is there an ā€˜update cadet processā€™ command?

That command is pip install CADET-Process --upgrade executed in your cadet_workshop conda environment. When you do that, also update CADET-Core and CADET-Python with
pip install CADET-Python --upgrade and conda update CADET

2 Likes

Hi Ronald,
Thanks for your helpful reply! I really appreciate your inputļ¼
Iā€™ve added the reference concentration and redefined the parameters as you showed me. I also realised that I made a mistake when converting the loaded protein concentration from mg/ml (from my experiments) to mM (Cadetā€™s unit). The code is running smoothly and I expect good results.
Your guidance is fantastic! Thanks again for making everything clearer for me.
Cheers,
Mao

3 Likes