12 namespace test_utils {
68 "Title statement without any text",
76 "LOCAL statement without any variable",
84 "LOCAL statement with empty index",
92 "LOCAL statement with invalid index",
100 "Incomplete macro definition without value",
108 "Nested verbatim blocks",
122 "Nested comment blocks",
126 some code comment here
134 "include_statement_1",
136 "Incomplete include statements",
144 "Incomplete parameter declaration",
156 "Invalid parameter declaration",
168 "Invalid CURIE statement",
196 "Standalone LOCAL statement with single scalar variable",
206 "Standalone LOCAL statement with single vector variable",
216 "Standalone LOCAL statement with multiple variables",
218 LOCAL gbar, ek[2], ik
226 "Standalone LOCAL statement with multiple variables with/without whitespaces",
228 LOCAL gbar, ek[2],ik, gk
231 LOCAL gbar, ek[2], ik, gk
249 "Statements should preserve order with blocks",
265 "Artificial Statement usage",
268 ARTIFICIAL_CELL NSLOC
277 "Stanadlone empty verbatim block",
288 "Standalone verbatim block",
300 "Standalone comment block",
312 "Standalone unit on/off statements",
326 "include_statement_1",
328 "Standalone include statements",
338 "Empty parameter block",
349 "PARAMETER block with all statement types",
353 tau_d_AMPA = 10.1 (mV)
354 tau_r_NMDA = 10 (mV) <1,2>
355 tau_d_NMDA = 10 (mV) <1.1,2.2>
368 "PARAMETER statement can use macro definition as a number",
382 "PARAMETER block with inconsistent whitespaces",
386 tau_d_AMPA = 10.1(mV)
387 tau_r_NMDA = 10 (mV) <1, 2>
388 tau_d_NMDA= 10 (mV)<1.1,2.2>
398 tau_d_AMPA = 10.1 (mV)
399 tau_r_NMDA = 10 (mV) <1,2>
400 tau_d_NMDA = 10 (mV) <1.1,2.2>
413 "PARAMETER block with very small/large doubles",
419 tau_d_NMDA = 1.3643e+27
426 "independent_block_1",
428 "INDEPENDENT block with all statement types",
431 t FROM 0 TO 1 WITH 1 (ms)
432 SWEEP u FROM 0 TO 1 WITH 1 (ms)
436 : INDEPENDENT block is deprecated and has no effect in the NEURON model. Skipped!
444 "ASSIGNED block with all statement types",
449 i_NMDA START 2.1 (nA) <0.1>
450 A_NMDA_step[1] START 1 <0.2>
451 factor_AMPA FROM 0 TO 1
452 B_NMDA_step[2] FROM 1 TO 2 START 0 (ms) <1>
461 "NEURON block with many statement types",
465 REPRESENTS NCIT:C17145
466 REPRESENTS [NCIT:C17145]
468 USEION na READ ena, kna
469 USEION na WRITE ena, kna VALENCE 2.1
470 USEION na READ ena WRITE ina
471 USEION k READ ek WRITE ik REPRESENTS CHEBI:29103
472 USEION na READ ena WRITE ina VALENCE 3.3 REPRESENTS NCIT:C17
473 NONSPECIFIC_CURRENT i
474 NONSPECIFIC_CURRENT i, j
476 RANGE tau_r_AMPA, tau_d_AMPA
492 "UNITS block with unit definitions",
505 "UNITS block with unit and factor definitions",
520 "UNITS block with empty unit (called default unit)",
532 "CONSTANT block with all statement types",
546 "CONSTANT block with signed values",
567 "Empty statement list",
578 "Statement list with local variables",
605 "From statement with integer expressions",
609 FROM i = (0+0) TO (1+b) BY X {
620 "Empty while statement",
633 "While statement with AND expression as condition",
636 WHILE ((a+1)<2 && b>100) {
648 "While statement with OR expression as condition",
651 WHILE ((a+1)<=2 || b>=100) {
663 "While statement with NE and NOT condition",
678 "Empty if statement",
689 "if_else_statement_1",
705 "if_elseif_statement_1",
707 "If multiple else if statements",
723 "if_elseif_else_statement_1",
725 "If with multiple else if nested statements",
727 FUNCTION test(v, x) {
748 "Solve statement without method",
760 "Solve statement with method",
763 SOLVE states METHOD cnexp
770 "solve_block_equation_1",
772 "Solve statement without method using EQUATION, generating BREAKPOINT",
788 "solve_block_equation_2",
790 "Solve statement with method using EQUATION, generating BREAKPOINT",
793 SOLVE states METHOD cnexp
798 SOLVE states METHOD cnexp
806 "solve_block_equation_3",
808 "Solve statement using EQUATION, generating BREAKPOINT",
811 SOLVE states METHOD cnexp
819 SOLVE states METHOD cnexp
831 "Conductance statement",
843 "Conductance statement with ion name",
846 CONDUCTANCE gIm USEION k
855 "CONSERVE statement",
859 CONSERVE pump+pumpca = TotalPump*parea*(1e+10)
868 "COMPARTMENT statement",
871 COMPARTMENT voli {cai}
872 COMPARTMENT diam*diam*PI/4 {qk}
873 COMPARTMENT (1e+10)*area1 {pump pumpca}
874 COMPARTMENT i, diam*diam*vol[i]*1(um) {ca CaBuffer Buffer}
883 "LONGITUDINAL_DIFFUSION statement",
886 LONGITUDINAL_DIFFUSION D {nai}
887 LONGITUDINAL_DIFFUSION Dk*crossSectionalArea {ko}
888 LONGITUDINAL_DIFFUSION i, DIP3*diam*diam*vrat[i] {bufm cabufm}
897 "REACTION statement",
900 ~ c1 <-> i1 (Con, Coff)
901 ~ ca[i] <-> ca[i+1] (DCa*frat[i+1], DCa*frat[i+1])
902 ~ ca[0] << (in*PI*diam*(0.1)*1(um))
903 ~ nai << (-f*ina*PI*diam*(10000)/(FARADAY))
929 ~ I1*bi1+C2*b01-C1*(fi1+f01) = 0
930 ~ C1+C2+C3+C4+C5+O+I1+I2+I3+I4+I5+I6 = 1
939 "NONLINEAR block with solver for",
941 NONLINEAR some_name SOLVEFOR a,b {
942 ~ I1*bi1+C2*b01-C1*(fi1+f01) = 0
943 ~ C1+C2+C3+C4+C5+O+I1+I2+I3+I4+I5+I6 = 1
956 "NONLINEAR block using symbol",
958 NONLINEAR some_name SOLVEFOR a,b {
959 ~+ I1*bi1+C2*b01-C1*(fi1+f01) = 0
960 ~+ C1+C2+C3+C4+C5+O+I1+I2+I3+I4+I5+I6 = 1
964 NONLINEAR some_name SOLVEFOR a,b {
965 ~ I1*bi1+C2*b01-C1*(fi1+f01) = 0
966 ~ C1+C2+C3+C4+C5+O+I1+I2+I3+I4+I5+I6 = 1
978 TABLE RES FROM -20 TO 20 WITH 5000
979 TABLE einf,eexp,etau DEPEND dt,celsius FROM -100 TO 100 WITH 200
992 WATCH (v>(vpeak-0.1*u)) 2
1002 "watch_statement_2",
1004 "WATCH statements with multiple expressions",
1007 IF (celltype == 4) {
1008 WATCH (v>vpeak) 2,(v>vpeak) 3.4
1016 "for_netcon_statement_1",
1018 "FOR_NETCONS statement",
1020 NET_RECEIVE (w(uS), A, tpre(ms)) {
1021 FOR_NETCONS (w1, A1, tp) {
1022 A1 = A1+(wmax-w1-A1)*p*exp((tp-t)/ptau)
1030 "mutex_statement_1",
1032 "MUTEX lock/unlock statements",
1034 PROCEDURE fun(w, A, tpre) {
1043 "protect_statement_1",
1045 "PROTECT statements",
1048 PROTECT Rtau = 1/(Alpha+Beta)
1056 "nonlinear_equation",
1058 "NONLINEAR block and equation",
1061 ~ 1/taurise*exp(-tmax/taurise)-afast/taufast*exp(-tmax/taufast)-aslow/tauslow*exp(-tmax/tauslow) = 0
1070 "STATE block with variable names",
1083 "STATE block with variable and associated unit",
1096 "KINETIC block taken from mod file",
1100 qa = q10a^((celsius-22(degC))/10(degC))
1102 ~ c <-> o (alpha, beta)
1103 ~ c <-> cac (kon*qa*ai/bf, koff*qa*b/bf)
1104 ~ o <-> cao (kon*qa*ai, koff*qa)
1105 ~ cac <-> cao (alphaa, betaa)
1106 CONSERVE c+cac+o+cao = 1
1115 "Theadsafe statement",
1128 "FUNCTION_TABLE example",
1130 FUNCTION_TABLE tabmtau(v(mV)) (ms)
1138 "DISCRETE block example",
1148 "derivative_block_1",
1150 "DERIVATIVE block example",
1162 "derivative_block_2",
1164 "DERIVATIVE block with mixed equations",
1167 cri' = ((cui-cri)/180-0.5*icr)/(1+Csqn*Kmcsqn/((cri+Kmcsqn)*(cri+Kmcsqn)))
1176 "FUNCTION definition with other function calls",
1178 FUNCTION test(v, x) (ms) {
1190 "BEFORE block example",
1201 "AFTER block example",
1211 "assignment_statement_1",
1213 "Various assignement statement types",
1226 "steadystate_statement_1",
1228 "SOLVE statement using STEADYSTATE",
1231 SOLVE kin STEADYSTATE sparse
1238 "netreceive_block_1",
1240 "NET_RECEIVE block containing INITIAL block",
1242 NET_RECEIVE (weight, weight_AMPA, weight_NMDA, Psurv, tsyn) {
1244 weight_AMPA = weight
1245 weight_NMDA = weight*NMDA_ratio
1258 "Comments with ? or : are not handled yet",
1263 printf("Hello World!\n");
1270 printf("Hello World!\n");
1280 "Inline comments with ? or : are not handled yet",
1283 a = b+c : some comment here
1284 c = d*e ? another comment here
1296 "empty_unit_declaration",
1298 "Declaration with empty units",
1300 FUNCTION ssCB(kdf(), kds()) (mM) {
1316 "m' = (mInf-m)/mTau",
1317 "m = m+(1.0-exp(dt*((((-1.0)))/mTau)))*(-(((mInf))/mTau)/((((-1.0)))/mTau)-m)",
1324 "A = A+(1.0-exp(dt*((-1.0)/tau_r)))*(-(0.0)/((-1.0)/tau_r)-A)",
1329 "CaDynamics_DC0.mod",
1330 "cai' = -(10000)*ica*surftovol*gamma/(2*FARADAY) - (cai - minCai)/decay",
1331 "cai = cai+(1.0-exp(dt*((-((1.0))/decay))))*(-(((((-(10000))*(ica))*(surftovol))*(gamma))/(2*FARADAY)-(((-minCai)))/decay)/((-((1.0))/decay))-cai)",
1336 "CaDynamics_DC1.mod",
1337 "cai' = -(10000)*ica*surftovol*gamma/(2*FARADAY) - (cai - minCai)/decay * diamref * surftovol",
1338 "cai = cai+(1.0-exp(dt*((-((((1.0))/decay)*(diamref))*(surftovol)))))*(-(((((-(10000))*(ica))*(surftovol))*(gamma))/(2*FARADAY)-(((((-minCai)))/decay)*(diamref))*(surftovol))/((-((((1.0))/decay)*(diamref))*(surftovol)))-cai)",
1344 "A_AMPA' = -A_AMPA/tau_r_AMPA",
1345 "A_AMPA = A_AMPA+(1.0-exp(dt*((-1.0)/tau_r_AMPA)))*(-(0.0)/((-1.0)/tau_r_AMPA)-A_AMPA)",
1351 "n' = a - (a + b)*n",
1352 "n = n+(1.0-exp(dt*((-((a+b))*(1.0)))))*(-(a)/((-((a+b))*(1.0)))-n)",
1358 "l' = al - (al + bl)*l",
1359 "l = l+(1.0-exp(dt*((-((al+bl))*(1.0)))))*(-(al)/((-((al+bl))*(1.0)))-l)",
1365 "mcal' = ((inf-mcal)/tau)",
1366 "mcal = mcal+(1.0-exp(dt*(((((-1.0)))/tau))))*(-((((inf))/tau))/(((((-1.0)))/tau))-mcal)",
1371 "_calciumc_concentration.mod",
1372 "cai' = -(ica*surftovol/FARADAY) - cai/decay",
1373 "cai = cai+(1.0-exp(dt*((-(1.0)/decay))))*(-(-(((ica)*(surftovol))/FARADAY))/((-(1.0)/decay))-cai)",
1378 "_outside_calcium_concentration.mod",
1379 "cao' = ica*(1e8)/(fhspace*FARADAY) + (cabath-cao)/trans",
1380 "cao = cao+(1.0-exp(dt*((((-1.0)))/trans)))*(-(((ica)*((1e8)))/(fhspace*FARADAY)+((cabath))/trans)/((((-1.0)))/trans)-cao)",
1392 "A_AMPA' = -A_AMPA/tau_r_AMPA",
1393 "A_AMPA = A_AMPA+(1.0-exp(dt*((-1.0)/tau_r_AMPA)))*(-(0.0)/((-1.0)/tau_r_AMPA)-A_AMPA)",
1399 "m_VDCC' = (minf_VDCC-m_VDCC)/mtau_VDCC",
1400 "m_VDCC = m_VDCC+(1.0-exp(dt*((((-1.0)))/mtau_VDCC)))*(-(((minf_VDCC))/mtau_VDCC)/((((-1.0)))/mtau_VDCC)-m_VDCC)",
1406 "cai_CR' = -(1e-9)*(ica_NMDA + ica_VDCC)*gamma_ca_CR/((1e-15)*volume_CR*2*FARADAY) - (cai_CR - min_ca_CR)/tau_ca_CR",
1407 "cai_CR = cai_CR+(1.0-exp(dt*((-((1.0))/tau_ca_CR))))*(-((((-(1e-9))*((ica_NMDA+ica_VDCC)))*(gamma_ca_CR))/((1e-15)*volume_CR*2*FARADAY)-(((-min_ca_CR)))/tau_ca_CR)/((-((1.0))/tau_ca_CR))-cai_CR)",
1413 "effcai_GB' = -0.005*effcai_GB + (cai_CR - min_ca_CR)",
1414 "effcai_GB = effcai_GB+(1.0-exp(dt*((-0.005)*(1.0))))*(-((cai_CR-min_ca_CR))/((-0.005)*(1.0))-effcai_GB)",
1420 "Rho_GB' = ( - Rho_GB*(1-Rho_GB)*(rho_star_GB-Rho_GB) + potentiate_GB*gamma_p_GB*(1-Rho_GB) - depress_GB* gamma_d_GB*Rho_GB ) / ((1e3)*tau_GB)",
1421 "Rho_GB = Rho_GB+(1.0-exp(dt*(((((((-1.0)*((1-Rho_GB))+(-Rho_GB)*(((-1.0)))))*((rho_star_GB-Rho_GB))+(-Rho_GB*(1-Rho_GB))*(((-1.0))))+(potentiate_GB*gamma_p_GB)*(((-1.0)))-(depress_GB*gamma_d_GB)*(1.0)))/((1e3)*tau_GB))))*(-Rho_GB)",
1427 "Use_GB' = (Use_d_GB + Rho_GB*(Use_p_GB-Use_d_GB) - Use_GB) / ((1e3)*tau_Use_GB)",
1428 "Use_GB = Use_GB+(1.0-exp(dt*((((-1.0)))/((1e3)*tau_Use_GB))))*(-(((Use_d_GB+(Rho_GB)*((Use_p_GB-Use_d_GB))))/((1e3)*tau_Use_GB))/((((-1.0)))/((1e3)*tau_Use_GB))-Use_GB)",
1436 "A_AMPA' = fun(tau_r_AMPA)",
1437 "A_AMPA = A_AMPA-dt*(-(fun(tau_r_AMPA)))",
1443 "A_AMPA' = fun(tau_r_AMPA, B_AMPA) + B_AMPA",
1444 "A_AMPA = A_AMPA-dt*(-(fun(tau_r_AMPA,B_AMPA)+B_AMPA))",
1450 "A_AMPA' = tau_r_AMPA/A_AMPA",
1451 "DA_AMPA = DA_AMPA/(1.0-dt*(((tau_r_AMPA/(A_AMPA+0.001))-(tau_r_AMPA/A_AMPA))/0.001))",
1457 "A_AMPA' = A_AMPA*A_AMPA",
1458 "A_AMPA = A_AMPA+(1.0-exp(dt*(((1.0)*(A_AMPA)+(A_AMPA)*(1.0)))))*(-A_AMPA)",
1464 "A_AMPA' = tau_r_AMPA/A_AMPA",
1465 "DA_AMPA = DA_AMPA/(1.0-dt*(((tau_r_AMPA/(A_AMPA+0.001))-(tau_r_AMPA/A_AMPA))/0.001))",
1471 "A_AMPA' = A_AMPA*A_AMPA",
1472 "DA_AMPA = A_AMPA*A_AMPA",
1483 "A_AMPA' = -A_AMPA/tau_r_AMPA",
1484 "DA_AMPA = DA_AMPA/(1.0-dt*((-1.0)/tau_r_AMPA))",
1490 "m_VDCC' = (minf_VDCC-m_VDCC)/mtau_VDCC",
1491 "Dm_VDCC = Dm_VDCC/(1.0-dt*((((-1.0)))/mtau_VDCC))",
1497 "cai_CR' = -(1e-9)*(ica_NMDA + ica_VDCC)*gamma_ca_CR/((1e-15)*volume_CR*2*FARADAY) - (cai_CR - min_ca_CR)/tau_ca_CR",
1498 "Dcai_CR = Dcai_CR/(1.0-dt*((-((1.0))/tau_ca_CR)))",
1504 "effcai_GB' = -0.005*effcai_GB + (cai_CR - min_ca_CR)",
1505 "Deffcai_GB = Deffcai_GB/(1.0-dt*((-0.005)*(1.0)))",
1511 "Rho_GB' = ( - Rho_GB*(1-Rho_GB)*(rho_star_GB-Rho_GB) + potentiate_GB*gamma_p_GB*(1-Rho_GB) - depress_GB*gamma_d_GB*Rho_GB ) / ((1e3)*tau_GB)",
1512 "DRho_GB = DRho_GB/(1.0-dt*(((((((-1.0)*((1-Rho_GB))+(-Rho_GB)*(((-1.0)))))*((rho_star_GB-Rho_GB))+(-Rho_GB*(1-Rho_GB))*(((-1.0))))+(potentiate_GB*gamma_p_GB)*(((-1.0)))-(depress_GB*gamma_d_GB)*(1.0)))/((1e3)*tau_GB)))",
1518 "Use_GB' = (Use_d_GB + Rho_GB*(Use_p_GB-Use_d_GB) - Use_GB) / ((1e3)*tau_Use_GB)",
1519 "DUse_GB = DUse_GB/(1.0-dt*((((-1.0)))/((1e3)*tau_Use_GB)))",
1528 "A_AMPA' = -A_AMPA/tau_r_AMPA",
1529 "DA_AMPA = -A_AMPA/tau_r_AMPA",
1535 "m_VDCC' = (minf_VDCC-m_VDCC)/mtau_VDCC",
1536 "Dm_VDCC = (minf_VDCC-m_VDCC)/mtau_VDCC",
1542 "cai_CR' = -(1e-9)*(ica_NMDA + ica_VDCC)*gamma_ca_CR/((1e-15)*volume_CR*2*FARADAY) - (cai_CR - min_ca_CR)/tau_ca_CR",
1543 "Dcai_CR = -(1e-9)*(ica_NMDA + ica_VDCC)*gamma_ca_CR/((1e-15)*volume_CR*2*FARADAY) - (cai_CR - min_ca_CR)/tau_ca_CR",
1549 "effcai_GB' = -0.005*effcai_GB + (cai_CR - min_ca_CR)",
1550 "Deffcai_GB = -0.005*effcai_GB + (cai_CR - min_ca_CR)",
1556 "Rho_GB' = ( - Rho_GB*(1-Rho_GB)*(rho_star_GB-Rho_GB) + potentiate_GB*gamma_p_GB*(1-Rho_GB) - depress_GB*gamma_d_GB*Rho_GB ) / ((1e3)*tau_GB)",
1557 "DRho_GB = ( - Rho_GB*(1-Rho_GB)*(rho_star_GB-Rho_GB) + potentiate_GB*gamma_p_GB*(1-Rho_GB) - depress_GB*gamma_d_GB*Rho_GB ) / ((1e3)*tau_GB)",
1563 "Use_GB' = (Use_d_GB + Rho_GB*(Use_p_GB-Use_d_GB) - Use_GB) / ((1e3)*tau_Use_GB)",
1564 "DUse_GB = (Use_d_GB + Rho_GB*(Use_p_GB-Use_d_GB) - Use_GB) / ((1e3)*tau_Use_GB)",
1574 "uu' = -uu+f(aee*uu-aie*vv-ze+i_e)",
1575 "Duu = Duu/(1.0-dt*(((-(uu+0.001)+f(aee*(uu+0.001)-aie*vv-ze+i_e))-(-uu+f(aee*uu-aie*vv-ze+i_e)))/0.001))",
1581 "vv' = (-vv+f(aei*uu-aii*vv-zi+i_i))/tau",
1582 "Dvv = Dvv/(1.0-dt*((((-(vv+0.001)+f(aei*uu-aii*(vv+0.001)-zi+i_i))/tau)-((-vv+f(aei*uu-aii*vv-zi+i_i))/tau))/0.001))",
1588 "caer' = -(0.001)*( Jip3(cali,caer, ip3ip, Vip3, dact, dinh, dip3, ddis)+errel(cali,caer,kerrel,kerm)-erfil(cali,caer,kerfila,kerfilb)+erlek(cali,caer,kerlek))/(rhover/fer)",
1589 "Dcaer = Dcaer/(1.0-dt*(((-(0.001)*(Jip3(cali,(caer+0.001),ip3ip,Vip3,dact,dinh,dip3,ddis)+errel(cali,(caer+0.001),kerrel,kerm)-erfil(cali,(caer+0.001),kerfila,kerfilb)+erlek(cali,(caer+0.001),kerlek))/(rhover/fer))-(-(0.001)*(Jip3(cali,caer,ip3ip,Vip3,dact,dinh,dip3,ddis)+errel(cali,caer,kerrel,kerm)-erfil(cali,caer,kerfila,kerfilb)+erlek(cali,caer,kerlek))/(rhover/fer)))/0.001))",
1595 "Jip3h' = (Jip3hinf(ip3ip, cali, dinh, dip3, ddis)-Jip3h)/Jip3th(ip3ip, ainh, cali, dinh, dip3, ddis)",
1596 "DJip3h = DJip3h/(1.0-dt*((((-1.0)))/Jip3th(ip3ip,ainh,cali,dinh,dip3,ddis)))",
1602 "messenger' = -gamma*picanmda - eta*messenger",
1603 "Dmessenger = Dmessenger/(1.0-dt*((-(eta)*(1.0))))",
1609 "Np' = nu1*messenger - (pp - picanmda*gdel1)*Np +(Mp*Np*Np)/(Ap+Np*Np)",
1610 "DNp = DNp/(1.0-dt*(((nu1*messenger-(pp-picanmda*gdel1)*(Np+0.001)+(Mp*(Np+0.001)*(Np+0.001))/(Ap+(Np+0.001)*(Np+0.001)))-(nu1*messenger-(pp-picanmda*gdel1)*Np+(Mp*Np*Np)/(Ap+Np*Np)))/0.001))",
1616 "cri' = ((cui - cri)/180 - 0.5*icr)/(1 + Csqn*Kmcsqn/((cri + Kmcsqn)*(cri + Kmcsqn)))",
1617 "Dcri = Dcri/(1.0-dt*(((((cui-(cri+0.001))/180-0.5*icr)/(1+Csqn*Kmcsqn/(((cri+0.001)+Kmcsqn)*((cri+0.001)+Kmcsqn))))-(((cui-cri)/180-0.5*icr)/(1+Csqn*Kmcsqn/((cri+Kmcsqn)*(cri+Kmcsqn)))))/0.001))",
1623 "s' = (s_inf-s)/((1-s_inf)*tau*s)",
1624 "Ds = (s_inf-s)/((1-s_inf)*tau*s)",
1630 "s' = (s_inf-s)/((1-s_inf)*tau*s)",
1631 "Ds = (s_inf-s)/((1-s_inf)*tau*s)",