Greetings!
Our group has been playing around with the Grandi model as found here:
https://models.physiomeproject.org/e/96/grandi_pasqualini_bers_2010.cellml/view (in particular the grandi_2010_none.cellml variant)
I've been able to use OpenCOR-2020-06-19-Linux to export successfully to C code. However, when I use the MATLAB.xml format, the index of the final entry in the CONSTANTS array gets messed up in the initConsts function. The matlab export produces
CONSTANTS(:,124) = 0.00000;
...
CONSTANTS(:,124) = (1.00000./CONSTANTS(:,111)).*log(CONSTANTS(:,117)./CONSTANTS(:,118));
When the correct variant should be
CONSTANTS(:,125) = 0.00000;
...
CONSTANTS(:,124) = (1.00000./CONSTANTS(:,111)).*log(CONSTANTS(:,117)./CONSTANTS(:,118));
This then propagates into the computeRates function, only ever using CONSTANTS(:,124) and not having a CONSTANTS(:,125) at all.
I'm not sure if this is a problem with OpenCOR (maybe something set to use nconstants-1 for the last entry even in the matlab export?) or with the CellML spec of the model.
I've been able to manually fix it for this model, but would like some input on whether this is an OpenCOR export or a CellML spec problem.
Cheers,
Kevin