Hello,
Has anyone encountered a syntax error using limpet_fe.py when importing a cell model from cellml.org?
I'm interested specifically in the heijman-2011.cellml model (https://models.physiomeproject.org/e/70a). At the later stage of importing a cell model using limpet_fe.py, I get the following errors.
=============
Syntax error at line 407, token '('
Syntax error at line 416, token '('
Syntax error at line 478, token '('
Syntax error at line 485, token '('
Syntax error at line 547, token '('
Syntax error at line 554, token '('
Error, don't assign to variables marked as differential variables
{Var("p")}
Traceback (most recent call last):
File "/home/karl/openCARP/physics/limpet/src/python/limpet_fe.py", line 1704, in <module>
im = IonicModel(open(filename, "r", encoding="utf-8").read());
File "/home/karl/openCARP/physics/limpet/src/python/im.py", line 332, in __init__
self.cleanup()
File "/home/karl/openCARP/physics/limpet/src/python/im.py", line 653, in cleanup
assert(0)
AssertionError
=============
Inspecting the .model file at the specified lines and cross-checking with the actual model, it seems that there isn't anything wrong with the syntax (none that I can see, anyway). Below are the lines in question:
=============
407: akap_sig_PKAf_arg = (atan((akap_sig_PKAf_yi/akap_sig_PKAf_yr))/3.0); .units(unitless);
416: akap_sig_PP1f_cav_arg = (atan((akap_sig_PP1f_cav_yi/akap_sig_PP1f_cav_yr))/3.0); .units(unitless);
478: beta_cav_Gs_f_arg = (atan((beta_cav_Gs_f_yi/beta_cav_Gs_f_yr))/3.0); .units(unitless);
485: beta_cav_Gs_f_i = ((beta_cav_Gs_f_mag*sin(beta_cav_Gs_f_arg))*(1.0+beta_cav_Gs_f_x)); .units(mol/m^3);
547: beta_eca_Gs_f_arg = (atan((beta_eca_Gs_f_yi/beta_eca_Gs_f_yr))/3.0); .units(unitless);
554: beta_eca_Gs_f_i = ((beta_eca_Gs_f_mag*sin(beta_eca_Gs_f_arg))*(1.0+beta_eca_Gs_f_x)); .units(mol/m^3);
=============
The other error "Error, don't assign to variables marked as differential variables {Var("p")}". I think the variable p it's pointing to is a critical factor in differential equations. I'm not sure why it shouldn't be included in the differential equation.
819: diff_O1 = (((-(e+p)*O1)+(o*O2))+(t*C15)); .units(unitless/s);
820: diff_O2 = ((p*O1) - (o*O2)); .units(unitless/s);
827: p = (4.0173e-4*exp(((2.0873e-4*V)*FRT))); .units(unitless/s);
=============
I understand from the tutorial that there's no one solution for troubleshooting a wide range of cell models but any help would be appreciated! Thank you!
Karl