Coding Issue with estimating parameters for a BiLangmuir adsorption model

I’ve been trying to use the ‘singleExperimentCustomParamTransform.m’ function in CADET 4.0.0 to estimate the kA, kD, and qMax parameters for two different binding sites in a one component BiLangmuir adsorption system.

I tried reformatting the original ‘singleExperiment’ code for this model, and I’ve been having some issues with getting it to run. I’m unable to debug an error in the ‘MexSimulator.setParameters’ part of the code. The error says:

Also, I haven’t found a way to upload the whole MATLAB file of my code, but I’ve included some of it here.

function z_sECPT2()

   sim = createSimulation();
   res = sim.run();

   params = cell(6, 1);

   params{1} = makeSensitivity([0], {'Metal_KA'}, [0], [-1],[-1], [0], [-1]);
   params{2} = makeSensitivity([0], {'Metal_KD'}, [0], [-1],[-1], [0], [-1]);
   params{3} = makeSensitivity([0], {'Metal_qMax'}, [0], [-1], [-1], [0], [-1]);
   params{4} = makeSensitivity([0], {'C18_KA'}, [0], [-1], [-1], [1], [-1]);
   params{5} = makeSensitivity([0], {'C18_KD'}, [0], [-1], [-1], [1], [-1]);
   params{6} = makeSensitivity([0], {'C18_qMax'}, [0], [-1], [-1], [1], [-1]);

   sim.setParameters(params, true(6, 1));

The ‘sim.setParameters(params, true(6, 1));’ part is where the error occurs.

I think the parameters that I included in my code look similar to the example parameters from the original ‘singleExperimentCustomParamTransform.m’ code. I’m not exactly sure what is causing the issue. If anyone has any ideas about what could be amiss, I would really appreciate any advice.

The parameter name in makeSensitivity cannot be chosen by the user. This is meant to be the name of the parameter from the file format (see corresponding section in doc.pdf).

In your case, you’d have to use

params{1} = makeSensitivity([0], {'MCBL_KA'}, [0], [-1],[-1], [0], [-1]);
params{2} = makeSensitivity([0], {'MCBL_KD'}, [0], [-1],[-1], [0], [-1]);
params{3} = makeSensitivity([0], {'MCBL_QMAX'}, [0], [-1], [-1], [0], [-1]);
params{4} = makeSensitivity([0], {'MCBL_KA'}, [0], [-1], [-1], [1], [-1]);
params{5} = makeSensitivity([0], {'MCBL_KD'}, [0], [-1], [-1], [1], [-1]);
params{6} = makeSensitivity([0], {'MCBL_QMAX'}, [0], [-1], [-1], [1], [-1]);
1 Like

Thank you! That part works now.

1 Like