Hi all,
I had a quick check and I run the tutorial with with Harvey 1_03c and 1_03d and MATLAB2021a, Windows, Cplex129.
I obtained the same result as
Jinxia. However, when going back to an older version of the cobratoolbox I obtained the same result as Ines & Filippo.
After investigating I noticed that in line 89 in optimizeWBModel.m param.minNorm is wrongly set to zero (at least in my matlab version):
...........
if ~isfield('param','minNorm')
param.minNorm = 0;
end
.........
The single quotes (') should probably be removed (as param is a 1x2 struct)? Instead:
...........
if ~isfield(param,'minNorm')
param.minNorm = 0;
end
.........
This matters because later, at line 135:
if ~isfield(param,'solveWBMmethod')
if param.minNorm~=0
param.solveWBMmethod = 'QP';
else
param.solveWBMmethod = 'LP';
end
end
Since
param.minNorm was wrongly set to zero,
param.solveWBMmethod is set to
'LP'. This value then persists until line 239:
switch param.solveWBMmethod
case 'LP'
So the vector obtained is from the LP solution instead from the QP solution in the current cobratoolbox. After changing line 89 and making sure to be in:
case 'QP'
solution = optimizeCbModel(model, model.osenseStr, param.minNorm, allowLoops, param);
I’m getting a non-optimal QP solution (solution.stat = 3, origStatText = 'Unknown CPLEX Status value').
This suggests that other functions might need to be fixed, though I can’t identify them at the moment.
Could you Ines/Filippo please check if I might be mistaken? Thank you very much and best wishes,
Daniel