First time here? Checkout the FAQ!
x
0 votes
by (1.3k points)
edited by

Hi :)

I am trying to compile a model from HiPSC derived ventricular cells (see CellML https://models.physiomeproject.org/e/594/paci_hyttinen_aaltosetala_severi_ventricularVersion.cellml/view ). I converted first to .model and tried to run the C translator on it, getting some warnings regarding the gates alpha/beta and tau/inifinity. I modified that and run it again. I was then able to create a dynamic model .so. However this gave a warning:

/Users/tpw18/Desktop/DOCUMENTS/others/Norah/P17/Models/HiPSC_ventricle_paci/paci_ventricle.cc:200:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wextern-c-compat]
struct paci_ventricle_Regional_Constants {
^
1 warning generated.

And if I now try to run bench --load-module ./paci_ventricle.so there is no output at all and no error message at all.

The same warning is also generated if I try to compile openCARP from source with that new .model file. And again the newly compiled openCARP doesn't show any output nor error when running bench with that model.

Stuff like bench --load-module paci_ventricle.so --imp-info also have no terminal output.

I checked the C file of the model and on line 200 I have this:

struct paci_ventricle_Regional_Constants {

};

I am not sure that warning is even related to the model not working at all, but since it has no other error or output, it's the only thing I can think of...Can someone give me a hint on what might be happening there?

Thanks!

Teo

1 Answer

0 votes
by (3.6k points)
selected by
 
Best answer
Hi Teo,

Would it be possible for you to share the .model file to have a look at it?

Cheers,

Jorge
by (1.3k points)
Thanks for taking a look Jorge!


#generated from: paci_ventricle.cellml
Vm; .external(Vm); .nodal();
Iion; .external(); .nodal();

#The variables in the group below I added to see if it would change anything on the Regional constants warning - which it didnt
group {
Cao = 1.8; .units(mmol/L);
Nao = 151; .units(mmol/L);
Ki = 150; .units(mmol/L);
Ko = 5.4; .units(mmol/L);
R = 8.314472; .units(J/mol/K);
T = 310; .units(K);
F = 96485.3415; .units(C/mol);
} .param(); .nodal();


# Constants
stim_flag = 0; .units(unitless);
i_stim_Start = 0; .units(s);
i_stim_End = 800; .units(s);
i_stim_Amplitude = 5.5e-10; .units(A);
i_stim_frequency = 60; .units(unitless/s);
i_stim_PulseDuration = 0.005; .units(s);
TTX_3uM = 0; .units(unitless);
TTX_10uM = 0; .units(unitless);
TTX_30uM = 0; .units(unitless);
E4031_30nM = 0; .units(unitless);
E4031_100nM = 0; .units(unitless);
nifed_3nM = 0; .units(unitless);
nifed_10nM = 0; .units(unitless);
nifed_30nM = 0; .units(unitless);
nifed_100nM = 0; .units(unitless);
Chromanol_iKs30 = 0; .units(unitless);
Chromanol_iKs50 = 0; .units(unitless);
Chromanol_iKs70 = 0; .units(unitless);
Chromanol_iKs90 = 0; .units(unitless);
PkNa = 0.03; .units(unitless);
g_Na = 3671.2302; .units(S/F);
g_CaL = 8.635702e-5; .units(m^3/F/s);
tau_fCa = 0.002; .units(s);
g_Kr = 29.8667; .units(S/F);
L0 = 0.025; .units(unitless);
Q = 2.3; .units(unitless);
g_Ks = 2.041; .units(S/F);
g_K1 = 28.1492; .units(S/F);
g_f = 30.10312; .units(S/F);
E_f = -0.017; .units(V);
g_b_Na = 0.9; .units(S/F);
g_b_Ca = 0.69264; .units(S/F);
Km_K = 1; .units(mmol/L);
Km_Na = 40; .units(mmol/L);
PNaK = 1.841424; .units(A/F);
kNaCa = 4900; .units(A/F);
alpha = 2.8571432; .units(unitless);
gamma = 0.35; .units(unitless);
Ksat = 0.1; .units(unitless);
KmCa = 1.38; .units(mmol/L);
KmNai = 87.5; .units(mmol/L);
g_PCa = 0.4125; .units(A/F);
KPCa = 0.0005; .units(mmol/L);
g_to = 29.9038; .units(S/F);
Cm = 9.87109e-11; .units(F);
Vc = 8800; .units(um^3);
V_SR = 583.73; .units(um^3);
a_rel = 16.464; .units(mmol/L/s);
b_rel = 0.25; .units(mmol/L);
c_rel = 8.232; .units(mmol/L/s);
tau_g = 0.002; .units(s);
Kup = 0.00025; .units(mmol/L);
Buf_C = 0.25; .units(mmol/L);
Buf_SR = 10; .units(mmol/L);
Kbuf_C = 0.001; .units(mmol/L);
Kbuf_SR = 0.3; .units(mmol/L);
VmaxUp = 0.56064; .units(mmol/L/s);
V_leak = 0.00044444; .units(unitless/s);

# Initial values
Vm_init = -0.0743340057623841; .units(V);
m_init = 0.102953468725004; .units(unitless);
h_init = 0.786926637881461; .units(unitless);
j_init = 0.253943221774722; .units(unitless);
d_init = 8.96088425225182e-5; .units(unitless);
f1_init = 0.970411811263976; .units(unitless);
f2_init = 0.999965815466749; .units(unitless);
fCa_init = 0.998925296531804; .units(unitless);
Xr1_init = 0.00778547011240132; .units(unitless);
Xr2_init = 0.432162576531617; .units(unitless);
Xs_init = 0.0322944866983666; .units(unitless);
Xf_init = 0.100615100568753; .units(unitless);
q_init = 0.839295925773219; .units(unitless);
r_init = 0.00573289893326379; .units(unitless);
Nai_init = 10.9248496211574; .units(mmol/L);
Cai_init = 1.80773974140477e-5; .units(mmol/L);
Ca_SR_init = 0.2734234751931; .units(mmol/L);
g_init = 0.999999981028517; .units(unitless);

Iion = i_K1     +
        i_to     +
        i_Kr     +
        i_Ks     +
        i_CaL     +
        i_NaK    +
        i_Na     +
        i_NaCa    +
        i_PCa    +
        i_f     +
        i_b_Na     +
        i_b_Ca ;


#electric_potentials
E_Na = (((R*T)/F)*log((Nao/Nai))); .units(V);
E_K = (((R*T)/F)*log((Ko/Ki))); .units(V);
E_Ks = (((R*T)/F)*log(((Ko+(PkNa*Nao))/(Ki+(PkNa*Nai))))); .units(V);
E_Ca = (((0.5*(R*T))/F)*log((Cao/Cai))); .units(V);

##################i_Na
TTX_coeff = ((TTX_3uM==1.) ? 0.18 : ((TTX_10uM==1.) ? 0.06 : ((TTX_30uM==1.) ? 0.02 : 1.))); .units(unitless);
i_Na = (TTX_coeff*(g_Na*((m*m*m)*(h*(j*(Vm - E_Na)))))); .units(A/F);

    #i_Na_m_gate
alpha_m = (1./(1.+exp((((-Vm*1000.) - 60.)/5.)))); .units(unitless);
beta_m = ((0.1/(1.+exp((((Vm*1000.)+35.)/5.))))+(0.1/(1.+exp((((Vm*1000.) - 50.)/200.))))); .units(unitless);

    #i_Na_h_gate
alpha_h = ((Vm<-0.04) ? (0.057*exp((-((Vm*1000.)+80.)/6.8))) : 0.); .units(unitless);
beta_h = ((Vm<-0.04) ? ((2.7*exp((0.079*(Vm*1000.))))+(3.1*((10.*10.*10.*10.*10.)*exp((0.3485*(Vm*1000.)))))) : (0.77/(0.13*(1.+exp((((Vm*1000.)+10.66)/-11.1)))))); .units(unitless);

    #i_Na_j_gate
alpha_j = ((Vm<-0.04) ? ((((-25428.*exp((0.2444*(Vm*1000.)))) - (6.948*((1/10./10./10./10./10./10.)*exp((-0.04391*(Vm*1000.))))))*((Vm*1000.)+37.78))/(1.+exp((0.311*((Vm*1000.)+79.23))))) : 0.); .units(unitless);
beta_j = ((Vm<-0.04) ? ((0.02424*exp((-0.01052*(Vm*1000.))))/(1.+exp((-0.1378*((Vm*1000.)+40.14))))) : ((0.6*exp((0.057*(Vm*1000.))))/(1.+exp((-0.1*((Vm*1000.)+32.)))))); .units(unitless);

#################i_CaL
nifed_coeff = ((nifed_3nM==1.) ? 0.93 : ((nifed_10nM==1.) ? 0.79 : ((nifed_30nM==1.) ? 0.56 : ((nifed_100nM==1.) ? 0.28 : 1.)))); .units(unitless);
i_CaL = (((((g_CaL*(4.*(Vm*(F*F))))/(R*T))*((Cai*exp(((2.*(Vm*F))/(R*T)))) - (0.341*Cao)))/(exp(((2.*(Vm*F))/(R*T))) - 1.))*(d*(f1*(f2*fCa)))); .units(A/F);

    #i_CaL_d_gate
alpha_d = (0.25+(1.4/(1.+exp((((-Vm*1000.) - 35.)/13.))))); .units(unitless);
beta_d = (1.4/(1.+exp((((Vm*1000.)+5.)/5.)))); .units(unitless);
gamma_d = (1./(1.+exp((((-Vm*1000.)+50.)/20.)))); .units(unitless);

    #i_CaL_f1_gate
f1_inf = (1./(1.+exp((((Vm*1000.)+26.)/3.)))); .units(unitless);
tau_f1 = (((20.+((1102.5*exp(-(((((Vm*1000.)+27.)*((Vm*1000.)+27.))/15.)*((((Vm*1000.)+27.)*((Vm*1000.)+27.))/15.))))+((200./(1.+exp(((13. - (Vm*1000.))/10.))))+(180./(1.+exp(((30.+(Vm*1000.))/10.)))))))*constf1)/1000.); .units(s);
constf1 = (((f1_inf - f1)>0.) ? (1.+(1433.*(Cai - (50.*1.e-6)))) : 1.); .units(unitless);

    #i_CaL_f2_gate
f2_inf = (0.33+(0.67/(1.+exp((((Vm*1000.)+35.)/4.))))); .units(unitless);
constf2 = 1.; .units(unitless);
tau_f2 = ((((600.*exp((-(((Vm*1000.)+25.)*((Vm*1000.)+25.))/170.)))+((31./(1.+exp(((25. - (Vm*1000.))/10.))))+(16./(1.+exp(((30.+(Vm*1000.))/10.))))))*constf2)/1000.); .units(s);

    #i_CaL_fCa_gate
alpha_fCa = (1./(1.+((Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)))); .units(unitless);
beta_fCa = (0.1/(1.+exp(((Cai - 0.0009)/0.0001)))); .units(unitless);
gamma_fCa = (0.3/(1.+exp(((Cai - 0.00075)/0.0008)))); .units(unitless);


#################i_Kr
E4031_coeff = ((E4031_30nM==1.) ? 0.77 : ((E4031_100nM==1.) ? 0.5 : 1.)); .units(unitless);
i_Kr = (E4031_coeff*(g_Kr*((Vm - E_K)*(Xr1*(Xr2*sqrt((Ko/5.4))))))); .units(A/F);

    #i_Kr_Xr1_gate
V_half = (1000.*((((-R*T)/(F*Q))*log((((1.+(Cao/2.6))*(1.+(Cao/2.6))*(1.+(Cao/2.6))*(1.+(Cao/2.6)))/(L0*((1.+(Cao/0.58))*(1.+(Cao/0.58))*(1.+(Cao/0.58))*(1.+(Cao/0.58))))))) - 0.019)); .units(mV);
alpha_Xr1 = (450./(1.+exp(((-45. - (Vm*1000.))/10.)))); .units(unitless);
beta_Xr1 = (6./(1.+exp(((30.+(Vm*1000.))/11.5)))); .units(unitless);

    #i_Kr_Xr2_gate
alpha_Xr2 = (3./(1.+exp(((-60. - (Vm*1000.))/20.)))); .units(unitless);
beta_Xr2 = (1.12/(1.+exp(((-60.+(Vm*1000.))/20.)))); .units(unitless);

#################i_Ks
Chromanol_coeff = ((Chromanol_iKs30==1.) ? 0.7 : ((Chromanol_iKs50==1.) ? 0.5 : ((Chromanol_iKs70==1.) ? 0.3 : ((Chromanol_iKs90==1.) ? 0.1 : 1.)))); .units(unitless);
i_Ks = (Chromanol_coeff*(g_Ks*((Vm - E_Ks)*((Xs*Xs)*(1.+(0.6/(1.+pow(((3.8*0.00001)/Cai),1.4)))))))); .units(A/F);

    #i_Ks_Xs_gate
alpha_Xs = (1100./sqrt((1.+exp(((-10. - (Vm*1000.))/6.))))); .units(unitless);
beta_Xs = (1./(1.+exp(((-60.+(Vm*1000.))/20.)))); .units(unitless);

#################i_K1
alpha_K1 = (3.91/(1.+exp((0.5942*(((Vm*1000.) - (E_K*1000.)) - 200.))))); .units(unitless);
beta_K1 = (((-1.509*exp((0.0002*(((Vm*1000.) - (E_K*1000.))+100.))))+exp((0.5886*(((Vm*1000.) - (E_K*1000.)) - 10.))))/(1.+exp((0.4547*((Vm*1000.) - (E_K*1000.)))))); .units(unitless);
XK1_inf = (alpha_K1/(alpha_K1+beta_K1)); .units(unitless);
i_K1 = (g_K1*(XK1_inf*((Vm - E_K)*sqrt((Ko/5.4))))); .units(A/F);

#################i_f
i_f = (g_f*(Xf*(Vm - E_f))); .units(A/F);

    #i_f_Xf_gate
Xf_infinity = (1./(1.+exp((((Vm*1000.)+77.85)/5.)))); .units(unitless);
tau_Xf = ((1900./(1.+exp((((Vm*1000.)+15.)/10.))))/1000.); .units(s);

#################i_b_Na
i_b_Na = (g_b_Na*(Vm - E_Na)); .units(A/F);

#################i_b_Ca
i_b_Ca = (g_b_Ca*(Vm - E_Ca)); .units(A/F);

#################i_NaK
i_NaK = (((((PNaK*Ko)/(Ko+Km_K))*Nai)/(Nai+Km_Na))/(1.+((0.1245*exp(((-0.1*(Vm*F))/(R*T))))+(0.0353*exp(((-Vm*F)/(R*T))))))); .units(A/F);

#################i_NaCa
i_NaCa = ((kNaCa*((exp(((gamma*(Vm*F))/(R*T)))*((Nai*Nai*Nai)*Cao)) - (exp((((gamma - 1.)*(Vm*F))/(R*T)))*((Nao*Nao*Nao)*(Cai*alpha)))))/(((KmNai*KmNai*KmNai)+(Nao*Nao*Nao))*((KmCa+Cao)*(1.+(Ksat*exp((((gamma - 1.)*(Vm*F))/(R*T)))))))); .units(A/F);

#################i_PCa
i_PCa = ((g_PCa*Cai)/(Cai+KPCa)); .units(A/F);

#################i_to
i_to = (g_to*((Vm - E_K)*(q*r))); .units(A/F);

    #i_to_q_gate
q_inf = (1./(1.+exp((((Vm*1000.)+53.)/13.)))); .units(unitless);
tau_q = ((6.06+(39.102/((0.57*exp((-0.08*((Vm*1000.)+44.))))+(0.065*exp((0.1*((Vm*1000.)+45.93)))))))/1000.); .units(s);

    #i_to_r_gate
r_inf = (1./(1.+exp((-((Vm*1000.) - 22.3)/18.75)))); .units(unitless);
tau_r = ((2.75352+(14.40516/((1.037*exp((0.09*((Vm*1000.)+30.61))))+(0.369*exp((-0.12*((Vm*1000.)+23.84)))))))/1000.); .units(s);

#################sodium_dynamics
diff_Nai = ((-Cm*(i_Na+(i_b_Na+((3.*i_NaK)+(3.*i_NaCa)))))/(F*(Vc*1.e-18))); .units(mmol/L/s);

#################calcium_dynamics
i_rel = ((c_rel+((a_rel*(Ca_SR*Ca_SR))/((b_rel*b_rel)+(Ca_SR*Ca_SR))))*(d*(g*0.0411))); .units(mmol/L/s);
i_up = (VmaxUp/(1.+((Kup*Kup)/(Cai*Cai)))); .units(mmol/L/s);
i_leak = ((Ca_SR - Cai)*V_leak); .units(mmol/L/s);
g_inf = ((Cai<=0.00035) ? (1./(1.+((Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)))) : (1./(1.+((Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035))))); .units(unitless);
const2 = ((g_inf>g and Vm>-0.06) ? 0. : 1.); .units(unitless);
diff_g = ((const2*(g_inf - g))/tau_g); .units(unitless/s);
Cai_bufc = (1./(1.+((Buf_C*Kbuf_C)/((Cai+Kbuf_C)*(Cai+Kbuf_C))))); .units(unitless);
Ca_SR_bufSR = (1./(1.+((Buf_SR*Kbuf_SR)/((Ca_SR+Kbuf_SR)*(Ca_SR+Kbuf_SR))))); .units(unitless);
diff_Cai = (Cai_bufc*(((i_leak - i_up)+i_rel) - ((((i_CaL+(i_b_Ca+i_PCa)) - (2.*i_NaCa))*Cm)/(2.*(Vc*(F*1.e-18)))))); .units(mmol/L/s);
diff_Ca_SR = (((Ca_SR_bufSR*Vc)/V_SR)*(i_up - (i_rel+i_leak))); .units(mmol/L/s);

group {
    m;
    h;
    j;
    d;
    f1;
    f2;
    fCa;
    Xr1;
    Xr2;
    Xs;
    Xf;
    q;
    r;
    Nai;
    g;
    Cai;
    Ca_SR;
}.method(cvode);
by (3.6k points)
Hi Teo,

I took a look at the file and remove the variables related to the stimulus.

Additionally, I changed the integration method and added the trace for Vm and Iion.  I think there is something wrong with the units but it converts, compiles and run with no errors.

Cheers,

Jorge

#generated from: paci_ventricle.cellml
Vm; .external(Vm); .nodal();
Iion; .external(); .nodal();

group {
Cao = 1.8; .units(mmol/L);
Nao = 151; .units(mmol/L);
Ki = 150; .units(mmol/L);
Ko = 5.4; .units(mmol/L);
R = 8.314472; .units(J/mol/K);
T = 310; .units(K);
F = 96485.3415; .units(C/mol);
} .param(); .nodal();


# Constants
TTX_3uM = 0; .units(unitless);
TTX_10uM = 0; .units(unitless);
TTX_30uM = 0; .units(unitless);
E4031_30nM = 0; .units(unitless);
E4031_100nM = 0; .units(unitless);
nifed_3nM = 0; .units(unitless);
nifed_10nM = 0; .units(unitless);
nifed_30nM = 0; .units(unitless);
nifed_100nM = 0; .units(unitless);
Chromanol_iKs30 = 0; .units(unitless);
Chromanol_iKs50 = 0; .units(unitless);
Chromanol_iKs70 = 0; .units(unitless);
Chromanol_iKs90 = 0; .units(unitless);
PkNa = 0.03; .units(unitless);
g_Na = 3671.2302; .units(S/F);
g_CaL = 8.635702e-5; .units(m^3/F/s);
tau_fCa = 0.002; .units(s);
g_Kr = 29.8667; .units(S/F);
L0 = 0.025; .units(unitless);
Q = 2.3; .units(unitless);
g_Ks = 2.041; .units(S/F);
g_K1 = 28.1492; .units(S/F);
g_f = 30.10312; .units(S/F);
E_f = -0.017; .units(V);
g_b_Na = 0.9; .units(S/F);
g_b_Ca = 0.69264; .units(S/F);
Km_K = 1; .units(mmol/L);
Km_Na = 40; .units(mmol/L);
PNaK = 1.841424; .units(A/F);
kNaCa = 4900; .units(A/F);
alpha = 2.8571432; .units(unitless);
gamma = 0.35; .units(unitless);
Ksat = 0.1; .units(unitless);
KmCa = 1.38; .units(mmol/L);
KmNai = 87.5; .units(mmol/L);
g_PCa = 0.4125; .units(A/F);
KPCa = 0.0005; .units(mmol/L);
g_to = 29.9038; .units(S/F);
Cm = 9.87109e-11; .units(F);
Vc = 8800; .units(um^3);
V_SR = 583.73; .units(um^3);
a_rel = 16.464; .units(mmol/L/s);
b_rel = 0.25; .units(mmol/L);
c_rel = 8.232; .units(mmol/L/s);
tau_g = 0.002; .units(s);
Kup = 0.00025; .units(mmol/L);
Buf_C = 0.25; .units(mmol/L);
Buf_SR = 10; .units(mmol/L);
Kbuf_C = 0.001; .units(mmol/L);
Kbuf_SR = 0.3; .units(mmol/L);
VmaxUp = 0.56064; .units(mmol/L/s);
V_leak = 0.00044444; .units(unitless/s);

# Initial values
Vm_init = -0.0743340057623841; .units(V);
m_init = 0.102953468725004; .units(unitless);
h_init = 0.786926637881461; .units(unitless);
j_init = 0.253943221774722; .units(unitless);
d_init = 8.96088425225182e-5; .units(unitless);
f1_init = 0.970411811263976; .units(unitless);
f2_init = 0.999965815466749; .units(unitless);
fCa_init = 0.998925296531804; .units(unitless);
Xr1_init = 0.00778547011240132; .units(unitless);
Xr2_init = 0.432162576531617; .units(unitless);
Xs_init = 0.0322944866983666; .units(unitless);
Xf_init = 0.100615100568753; .units(unitless);
q_init = 0.839295925773219; .units(unitless);
r_init = 0.00573289893326379; .units(unitless);
Nai_init = 10.9248496211574; .units(mmol/L);
Cai_init = 1.80773974140477e-5; .units(mmol/L);
Ca_SR_init = 0.2734234751931; .units(mmol/L);
g_init = 0.999999981028517; .units(unitless);

Iion = i_K1 + i_to + i_Kr + i_Ks + i_CaL + i_NaK + i_Na + i_NaCa + i_PCa + i_f + i_b_Na + i_b_Ca;.units(A/F);

#electric_potentials
E_Na = (((R*T)/F)*log((Nao/Nai))); .units(V);
E_K = (((R*T)/F)*log((Ko/Ki))); .units(V);
E_Ks = (((R*T)/F)*log(((Ko+(PkNa*Nao))/(Ki+(PkNa*Nai))))); .units(V);
E_Ca = (((0.5*(R*T))/F)*log((Cao/Cai))); .units(V);

##################i_Na
TTX_coeff = ((TTX_3uM==1.) ? 0.18 : ((TTX_10uM==1.) ? 0.06 : ((TTX_30uM==1.) ? 0.02 : 1.))); .units(unitless);
i_Na = (TTX_coeff*(g_Na*((m*m*m)*(h*(j*(Vm - E_Na)))))); .units(A/F);

        #i_Na_m_gate
alpha_m = (1./(1.+exp((((-Vm*1000.) - 60.)/5.)))); .units(unitless);
beta_m = ((0.1/(1.+exp((((Vm*1000.)+35.)/5.))))+(0.1/(1.+exp((((Vm*1000.) - 50.)/200.))))); .units(unitless);

        #i_Na_h_gate
alpha_h = ((Vm<-0.04) ? (0.057*exp((-((Vm*1000.)+80.)/6.8))) : 0.); .units(unitless);
beta_h = ((Vm<-0.04) ? ((2.7*exp((0.079*(Vm*1000.))))+(3.1*((10.*10.*10.*10.*10.)*exp((0.3485*(Vm*1000.)))))) : (0.77/(0.13*(1.+exp((((Vm*1000.)+10.66)/-11.1)))))); .units(unitless);

        #i_Na_j_gate
alpha_j = ((Vm<-0.04) ? ((((-25428.*exp((0.2444*(Vm*1000.)))) - (6.948*((1/10./10./10./10./10./10.)*exp((-0.04391*(Vm*1000.))))))*((Vm*1000.)+37.78))/(1.+exp((0.311*((Vm*1000.)+79.23))))) : 0.); .units(unitless);
beta_j = ((Vm<-0.04) ? ((0.02424*exp((-0.01052*(Vm*1000.))))/(1.+exp((-0.1378*((Vm*1000.)+40.14))))) : ((0.6*exp((0.057*(Vm*1000.))))/(1.+exp((-0.1*((Vm*1000.)+32.)))))); .units(unitless);

#################i_CaL
nifed_coeff = ((nifed_3nM==1.) ? 0.93 : ((nifed_10nM==1.) ? 0.79 : ((nifed_30nM==1.) ? 0.56 : ((nifed_100nM==1.) ? 0.28 : 1.)))); .units(unitless);
i_CaL = (((((g_CaL*(4.*(Vm*(F*F))))/(R*T))*((Cai*exp(((2.*(Vm*F))/(R*T)))) - (0.341*Cao)))/(exp(((2.*(Vm*F))/(R*T))) - 1.))*(d*(f1*(f2*fCa)))); .units(A/F);

        #i_CaL_d_gate
alpha_d = (0.25+(1.4/(1.+exp((((-Vm*1000.) - 35.)/13.))))); .units(unitless);
beta_d = (1.4/(1.+exp((((Vm*1000.)+5.)/5.)))); .units(unitless);
gamma_d = (1./(1.+exp((((-Vm*1000.)+50.)/20.)))); .units(unitless);

        #i_CaL_f1_gate
f1_inf = (1./(1.+exp((((Vm*1000.)+26.)/3.)))); .units(unitless);
tau_f1 = (((20.+((1102.5*exp(-(((((Vm*1000.)+27.)*((Vm*1000.)+27.))/15.)*((((Vm*1000.)+27.)*((Vm*1000.)+27.))/15.))))+((200./(1.+exp(((13. - (Vm*1000.))/10.))))+(180./(1.+exp(((30.+(Vm*1000.))/10.)))))))*constf1)/1000.); .units(s);
constf1 = (((f1_inf - f1)>0.) ? (1.+(1433.*(Cai - (50.*1.e-6)))) : 1.); .units(unitless);

        #i_CaL_f2_gate
f2_inf = (0.33+(0.67/(1.+exp((((Vm*1000.)+35.)/4.))))); .units(unitless);
constf2 = 1.; .units(unitless);
tau_f2 = ((((600.*exp((-(((Vm*1000.)+25.)*((Vm*1000.)+25.))/170.)))+((31./(1.+exp(((25. - (Vm*1000.))/10.))))+(16./(1.+exp(((30.+(Vm*1000.))/10.))))))*constf2)/1000.); .units(s);

        #i_CaL_fCa_gate
alpha_fCa = (1./(1.+((Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)*(Cai/0.0006)))); .units(unitless);
beta_fCa = (0.1/(1.+exp(((Cai - 0.0009)/0.0001)))); .units(unitless);
gamma_fCa = (0.3/(1.+exp(((Cai - 0.00075)/0.0008)))); .units(unitless);


#################i_Kr
E4031_coeff = ((E4031_30nM==1.) ? 0.77 : ((E4031_100nM==1.) ? 0.5 : 1.)); .units(unitless);
i_Kr = (E4031_coeff*(g_Kr*((Vm - E_K)*(Xr1*(Xr2*sqrt((Ko/5.4))))))); .units(A/F);

        #i_Kr_Xr1_gate
V_half = (1000.*((((-R*T)/(F*Q))*log((((1.+(Cao/2.6))*(1.+(Cao/2.6))*(1.+(Cao/2.6))*(1.+(Cao/2.6)))/(L0*((1.+(Cao/0.58))*(1.+(Cao/0.58))*(1.+(Cao/0.58))*(1.+(Cao/0.58))))))) - 0.019)); .units(mV);
alpha_Xr1 = (450./(1.+exp(((-45. - (Vm*1000.))/10.)))); .units(unitless);
beta_Xr1 = (6./(1.+exp(((30.+(Vm*1000.))/11.5)))); .units(unitless);

        #i_Kr_Xr2_gate
alpha_Xr2 = (3./(1.+exp(((-60. - (Vm*1000.))/20.)))); .units(unitless);
beta_Xr2 = (1.12/(1.+exp(((-60.+(Vm*1000.))/20.)))); .units(unitless);

#################i_Ks
Chromanol_coeff = ((Chromanol_iKs30==1.) ? 0.7 : ((Chromanol_iKs50==1.) ? 0.5 : ((Chromanol_iKs70==1.) ? 0.3 : ((Chromanol_iKs90==1.) ? 0.1 : 1.)))); .units(unitless);
i_Ks = (Chromanol_coeff*(g_Ks*((Vm - E_Ks)*((Xs*Xs)*(1.+(0.6/(1.+pow(((3.8*0.00001)/Cai),1.4)))))))); .units(A/F);

        #i_Ks_Xs_gate
alpha_Xs = (1100./sqrt((1.+exp(((-10. - (Vm*1000.))/6.))))); .units(unitless);
beta_Xs = (1./(1.+exp(((-60.+(Vm*1000.))/20.)))); .units(unitless);

#################i_K1
alpha_K1 = (3.91/(1.+exp((0.5942*(((Vm*1000.) - (E_K*1000.)) - 200.))))); .units(unitless);
beta_K1 = (((-1.509*exp((0.0002*(((Vm*1000.) - (E_K*1000.))+100.))))+exp((0.5886*(((Vm*1000.) - (E_K*1000.)) - 10.))))/(1.+exp((0.4547*((Vm*1000.) - (E_K*1000.)))))); .units(unitless);
XK1_inf = (alpha_K1/(alpha_K1+beta_K1)); .units(unitless);
i_K1 = (g_K1*(XK1_inf*((Vm - E_K)*sqrt((Ko/5.4))))); .units(A/F);

#################i_f
i_f = (g_f*(Xf*(Vm - E_f))); .units(A/F);

        #i_f_Xf_gate
Xf_infinity = (1./(1.+exp((((Vm*1000.)+77.85)/5.)))); .units(unitless);
tau_Xf = ((1900./(1.+exp((((Vm*1000.)+15.)/10.))))/1000.); .units(s);

#################i_b_Na
i_b_Na = (g_b_Na*(Vm - E_Na)); .units(A/F);

#################i_b_Ca
i_b_Ca = (g_b_Ca*(Vm - E_Ca)); .units(A/F);

#################i_NaK
i_NaK = (((((PNaK*Ko)/(Ko+Km_K))*Nai)/(Nai+Km_Na))/(1.+((0.1245*exp(((-0.1*(Vm*F))/(R*T))))+(0.0353*exp(((-Vm*F)/(R*T))))))); .units(A/F);

#################i_NaCa
i_NaCa = ((kNaCa*((exp(((gamma*(Vm*F))/(R*T)))*((Nai*Nai*Nai)*Cao)) - (exp((((gamma - 1.)*(Vm*F))/(R*T)))*((Nao*Nao*Nao)*(Cai*alpha)))))/(((KmNai*KmNai*KmNai)+(Nao*Nao*Nao))*((KmCa+Cao)*(1.+(Ksat*exp((((gamma - 1.)*(Vm*F))/(R*T)))))))); .units(A/F);

#################i_PCa
i_PCa = ((g_PCa*Cai)/(Cai+KPCa)); .units(A/F);

#################i_to
i_to = (g_to*((Vm - E_K)*(q*r))); .units(A/F);

        #i_to_q_gate
q_inf = (1./(1.+exp((((Vm*1000.)+53.)/13.)))); .units(unitless);
tau_q = ((6.06+(39.102/((0.57*exp((-0.08*((Vm*1000.)+44.))))+(0.065*exp((0.1*((Vm*1000.)+45.93)))))))/1000.); .units(s);

        #i_to_r_gate
r_inf = (1./(1.+exp((-((Vm*1000.) - 22.3)/18.75)))); .units(unitless);
tau_r = ((2.75352+(14.40516/((1.037*exp((0.09*((Vm*1000.)+30.61))))+(0.369*exp((-0.12*((Vm*1000.)+23.84)))))))/1000.); .units(s);

#################sodium_dynamics
diff_Nai = ((-Cm*(i_Na+(i_b_Na+((3.*i_NaK)+(3.*i_NaCa)))))/(F*(Vc*1.e-18))); .units(mmol/L/s);

#################calcium_dynamics
i_rel = ((c_rel+((a_rel*(Ca_SR*Ca_SR))/((b_rel*b_rel)+(Ca_SR*Ca_SR))))*(d*(g*0.0411))); .units(mmol/L/s);
i_up = (VmaxUp/(1.+((Kup*Kup)/(Cai*Cai)))); .units(mmol/L/s);
i_leak = ((Ca_SR - Cai)*V_leak); .units(mmol/L/s);
g_inf = ((Cai<=0.00035) ? (1./(1.+((Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)))) : (1./(1.+((Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035)*(Cai/0.00035))))); .units(unitless);
const2 = ((g_inf>g and Vm>-0.06) ? 0. : 1.); .units(unitless);
diff_g = ((const2*(g_inf - g))/tau_g); .units(unitless/s);
Cai_bufc = (1./(1.+((Buf_C*Kbuf_C)/((Cai+Kbuf_C)*(Cai+Kbuf_C))))); .units(unitless);
Ca_SR_bufSR = (1./(1.+((Buf_SR*Kbuf_SR)/((Ca_SR+Kbuf_SR)*(Ca_SR+Kbuf_SR))))); .units(unitless);
diff_Cai = (Cai_bufc*(((i_leak - i_up)+i_rel) - ((((i_CaL+(i_b_Ca+i_PCa)) - (2.*i_NaCa))*Cm)/(2.*(Vc*(F*1.e-18)))))); .units(mmol/L/s);
diff_Ca_SR = (((Ca_SR_bufSR*Vc)/V_SR)*(i_up - (i_rel+i_leak))); .units(mmol/L/s);

group {
        m;
        h;
        j;
        d;
        f1;
        f2;
        fCa;
        Xr1;
        Xr2;
        Xs;
        Xf;
        q;
        r;
        Nai;
        g;
        Cai;
        Ca_SR;
}.method(rk4);

group {
        Vm;
        Iion;
}.trace();
by (1.3k points)
Thanks a lot Jorge!

Indeed now it compiles and runs. And also, indeed, there seems to be a problem with the units, let's see if I can find the issue.
Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], config: ["MMLorHTML.js"], jax: ["input/TeX"], processEscapes: true } }); MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true } } });
...