001: //
002: // Heccer : a compartmental solver that implements efficient Crank-Nicolson
003: // integration for neuronal models.
004: //
005: 
006: //////////////////////////////////////////////////////////////////////////////
007: //'
008: //' Heccer : testbed C implementation
009: //'
010: //' Copyright (C) 2006-2008 Hugo Cornelis
011: //'
012: //' functional ideas ..   Hugo Cornelis, hugo.cornelis@gmail.com
013: //'
014: //' coding ............   Hugo Cornelis, hugo.cornelis@gmail.com
015: //'
016: //////////////////////////////////////////////////////////////////////////////
017: 
018: 
019: #include "../../heccer/compartment.h"
020: #include "../../heccer/heccer.h"
021: 
022: 
023: struct Compartment comp[] =
024: {
025:     {
026:         //m administrative overhead
027: 
028:         {
029:             //m type of structure
030: 
031:             MATH_TYPE_Compartment,
032:         },
033: 
034:         //m index of parent compartment, -1 for none
035: 
036:         -1,
037: 
038: /* 	//m first mechanism */
039: 
040: /* 	NULL, */
041: 
042: /* 	//m number of mechanisms */
043: 
044: /* 	0, */
045: 
046:         //m descriptive values, alphabetical order
047: 
048: /*     double dCm; */
049: 
050:         0,
051: 
052: /*     double dEm; */
053: 
054:         -0.08,
055: 
056: /*     double dInitVm; */
057: 
058:         -0.068,
059: 
060: /*     double dInject;		 */
061: 
062:         1e-8,
063: 
064: /*     double dRa; */
065: 
066:         360501.9688, // unscaled 2.5,
067: 
068: /*     double dRm; */
069: 
070:         358440928, // unscaled 3
071:     },
072: /* [ /Purkinje/soma ]
 */
073: /* activation           = 0
 */
074: /* Vm                   = -0.0680000037
 */
075: /* previous_state       = 0
 */
076: /* Im                   = 0.00378972129
 */
077: /* Em                   = -0.07999999821
 */
078: /* Rm                   = 358440928
 */
079: /* Cm                   = 4.575370291e-11
 */
080: /* Ra                   = 360501.9688
 */
081: /* inject               = 0
 */
082: /* dia                  = 2.979999954e-05
 */
083: /* len                  = 0
 */
084: /* initVm               = -0.0680000037
 */
085: /* somatopetal          = none
 */
086: /* somatopetaltag       = 1
 */
087: /* somatofugal          =  /Purkinje/main
 */
088: /* somatofugaltag       = 0
 */
089: 
090:     {
091:         //m administrative overhead
092: 
093:         {
094:             //m type of structure
095: 
096:             MATH_TYPE_Compartment,
097:         },
098: 
099:         //m index of parent compartment, -1 for none
100: 
101:         0,
102: 
103: /* 	//m first mechanism */
104: 
105: /* 	NULL, */
106: 
107: /* 	//m number of mechanisms */
108: 
109: /* 	0, */
110: 
111:         //m descriptive values, alphabetical order
112: 
113: /*     double dCm; */
114: 
115:         5.755329373e-12, // unscaled 0.0164,
116: 
117: /*     double dEm; */
118: 
119:         1000,
120: 
121: /*     double dInitVm; */
122: 
123:         -0.068,
124: 
125: /*     double dInject;		 */
126: 
127:         0,
128: 
129: /*     double dRa; */
130: 
131:         772813.4375, // unscaled 2.5,
132: 
133: /*     double dRm; */
134: 
135:         8548598272.0, // unscaled 3
136:     },
137: /* [ /Purkinje/main ]
 */
138: /* activation           = 0
 */
139: /* Vm                   = -0.0680000037
 */
140: /* previous_state       = 0
 */
141: /* Im                   = 0.03594784066
 */
142: /* Em                   = -0.07999999821
 */
143: /* Rm                   = 8548598272
 */
144: /* Cm                   = 5.755329373e-12
 */
145: /* Ra                   = 772813.4375
 */
146: /* inject               = 0
 */
147: /* dia                  = 7.720000212e-06
 */
148: /* len                  = 1.446968781e-05
 */
149: /* initVm               = -0.0680000037
 */
150: /* somatopetal          = /Purkinje/soma
 */
151: /* somatopetaltag       = 0
 */
152: /* somatofugal          =  /Purkinje/main[1]
 */
153: /* somatofugaltag       = 0
 */
154: 
155:     {
156:         //m administrative overhead
157: 
158:         {
159:             //m type of structure
160: 
161:             MATH_TYPE_Compartment,
162:         },
163: 
164:         //m index of parent compartment, -1 for none
165: 
166:         1,
167: 
168: /* 	//m first mechanism */
169: 
170: /* 	NULL, */
171: 
172: /* 	//m number of mechanisms */
173: 
174: /* 	0, */
175: 
176:         //m descriptive values, alphabetical order
177: 
178: /*     double dCm; */
179: 
180:         9.952665428e-12, // unscaled 0.0164,
181: 
182: /*     double dEm; */
183: 
184:         -0.08,
185: 
186: /*     double dInitVm; */
187: 
188:         -0.068,
189: 
190: /*     double dInject;		 */
191: 
192:         0,
193: 
194: /*     double dRa; */
195: 
196:         0,
197: 
198: /*     double dRm; */
199: 
200:         4943399424.0, // unscaled 3
201:     },
202: /* [ /Purkinje/main[1] ]
 */
203: /* activation           = 0
 */
204: /* Vm                   = -0.0680000037
 */
205: /* previous_state       = 0
 */
206: /* Im                   = 0.03594784066
 */
207: /* Em                   = -0.07999999821
 */
208: /* Rm                   = 4943399424
 */
209: /* Cm                   = 9.952665428e-12
 */
210: /* Ra                   = 1107083.25
 */
211: /* inject               = 0
 */
212: /* dia                  = 8.220000382e-06
 */
213: /* len                  = 2.350032264e-05
 */
214: /* initVm               = -0.0680000037
 */
215: /* somatopetal          = /Purkinje/main
 */
216: /* somatopetaltag       = 0
 */
217: /* somatofugal          =  /Purkinje/main[2] /Purkinje/b0s01
 */
218: /* somatofugaltag       = 0
 */
219: 
220:     {
221:         //m administrative overhead
222: 
223:         {
224:             //m type of structure
225: 
226:             MATH_TYPE_Compartment,
227:         },
228: 
229:         //m index of parent compartment, -1 for none
230: 
231:         2,
232: 
233: /* 	//m first mechanism */
234: 
235: /* 	NULL, */
236: 
237: /* 	//m number of mechanisms */
238: 
239: /* 	0, */
240: 
241:         //m descriptive values, alphabetical order
242: 
243: /*     double dCm; */
244: 
245:         3.048169139e-12, // unscaled 0.0164,
246: 
247: /*     double dEm; */
248: 
249:         -0.08,
250: 
251: /*     double dInitVm; */
252: 
253:         -0.068,
254: 
255: /*     double dInject;		 */
256: 
257:         0,
258: 
259: /*     double dRa; */
260: 
261:         306646.9688, // unscaled 2.5,
262: 
263: /*     double dRm; */
264: 
265:         0,
266:     },
267: /* [ /Purkinje/main[2] ]
 */
268: /* activation           = 0
 */
269: /* Vm                   = -0.0680000037
 */
270: /* previous_state       = 0
 */
271: /* Im                   = 0.03594784439
 */
272: /* Em                   = -0.07999999821
 */
273: /* Rm                   = 1.614083584e+10
 */
274: /* Cm                   = 3.048169139e-12
 */
275: /* Ra                   = 306646.9688
 */
276: /* inject               = 0
 */
277: /* dia                  = 8.500000149e-06
 */
278: /* len                  = 6.960275186e-06
 */
279: /* initVm               = -0.0680000037
 */
280: /* somatopetal          = /Purkinje/main[1]
 */
281: /* somatopetaltag       = 0
 */
282: /* somatofugal          =  /Purkinje/main[3] /Purkinje/b0s02
 */
283: /* somatofugaltag       = 0
 */
284: 
285:     {
286:         //m administrative overhead
287: 
288:         {
289:             //m type of structure
290: 
291:             MATH_TYPE_Compartment,
292:         },
293: 
294:         //m index of parent compartment, -1 for none
295: 
296:         3,
297: 
298: /* 	//m first mechanism */
299: 
300: /* 	NULL, */
301: 
302: /* 	//m number of mechanisms */
303: 
304: /* 	0, */
305: 
306:         //m descriptive values, alphabetical order
307: 
308: /*     double dCm; */
309: 
310:         0,
311: 
312: /*     double dEm; */
313: 
314:         1000,
315: 
316: /*     double dInitVm; */
317: 
318:         -0.068,
319: 
320: /*     double dInject;		 */
321: 
322:         0,
323: 
324: /*     double dRa; */
325: 
326:         0,
327: 
328: /*     double dRm; */
329: 
330:         0,
331:     },
332: /* [ /Purkinje/main[3] ]
 */
333: /* activation           = 0
 */
334: /* Vm                   = -0.0680000037
 */
335: /* previous_state       = 0
 */
336: /* Im                   = 0.03594784439
 */
337: /* Em                   = -0.07999999821
 */
338: /* Rm                   = 2.635531059e+10
 */
339: /* Cm                   = 1.866796431e-12
 */
340: /* Ra                   = 147150.0781
 */
341: /* inject               = 0
 */
342: /* dia                  = 9.22000072e-06
 */
343: /* len                  = 3.929816558e-06
 */
344: /* initVm               = -0.0680000037
 */
345: /* somatopetal          = /Purkinje/main[2]
 */
346: /* somatopetaltag       = 0
 */
347: /* somatofugal          =  /Purkinje/main[4]
 */
348: /* somatofugaltag       = 0
 */
349: 
350:     {
351:         //m administrative overhead
352: 
353:         {
354:             //m type of structure
355: 
356:             MATH_TYPE_Compartment,
357:         },
358: 
359:         //m index of parent compartment, -1 for none
360: 
361:         4,
362: 
363: /* 	//m first mechanism */
364: 
365: /* 	NULL, */
366: 
367: /* 	//m number of mechanisms */
368: 
369: /* 	0, */
370: 
371:         //m descriptive values, alphabetical order
372: 
373: /*     double dCm; */
374: 
375:         3.81543408e-12, // unscaled 0.0164,
376: 
377: /*     double dEm; */
378: 
379:         -0.08,
380: 
381: /*     double dInitVm; */
382: 
383:         -0.068,
384: 
385: /*     double dInject;		 */
386: 
387:         0,
388: 
389: /*     double dRa; */
390: 
391:         335501.9375, // unscaled 2.5,
392: 
393: /*     double dRm; */
394: 
395:         1.289499341e+10, // unscaled 3
396:     },
397: /* [ /Purkinje/main[4] ]
 */
398: /* activation           = 0
 */
399: /* Vm                   = -0.0680000037
 */
400: /* previous_state       = 0
 */
401: /* Im                   = 0.03594784439
 */
402: /* Em                   = -0.07999999821
 */
403: /* Rm                   = 1.289499341e+10
 */
404: /* Cm                   = 3.81543408e-12
 */
405: /* Ra                   = 335501.9375
 */
406: /* inject               = 0
 */
407: /* dia                  = 8.890000572e-06
 */
408: /* len                  = 8.330066521e-06
 */
409: /* initVm               = -0.0680000037
 */
410: /* somatopetal          = /Purkinje/main[3]
 */
411: /* somatopetaltag       = 0
 */
412: /* somatofugal          =  /Purkinje/main[5]
 */
413: /* somatofugaltag       = 0
 */
414: 
415:     {
416:         //m administrative overhead
417: 
418:         {
419:             //m type of structure
420: 
421:             MATH_TYPE_Compartment,
422:         },
423: 
424:         //m index of parent compartment, -1 for none
425: 
426:         5,
427: 
428: /* 	//m first mechanism */
429: 
430: /* 	NULL, */
431: 
432: /* 	//m number of mechanisms */
433: 
434: /* 	0, */
435: 
436:         //m descriptive values, alphabetical order
437: 
438: /*     double dCm; */
439: 
440:         2.239454065e-12, // unscaled 0.0164,
441: 
442: /*     double dEm; */
443: 
444:         -0.08,
445: 
446: /*     double dInitVm; */
447: 
448:         -0.068,
449: 
450: /*     double dInject;		 */
451: 
452:         0,
453: 
454: /*     double dRa; */
455: 
456:         230128.9531, // unscaled 2.5,
457: 
458: /*     double dRm; */
459: 
460:         2.196964147e+10, // unscaled 3
461:     },
462: /* [ /Purkinje/main[5] ]
 */
463: /* activation           = 0
 */
464: /* Vm                   = -0.0680000037
 */
465: /* previous_state       = 0
 */
466: /* Im                   = 0.03594784439
 */
467: /* Em                   = -0.07999999821
 */
468: /* Rm                   = 2.196964147e+10
 */
469: /* Cm                   = 2.239454065e-12
 */
470: /* Ra                   = 230128.9531
 */
471: /* inject               = 0
 */
472: /* dia                  = 8.439999874e-06
 */
473: /* len                  = 5.149985554e-06
 */
474: /* initVm               = -0.0680000037
 */
475: /* somatopetal          = /Purkinje/main[4]
 */
476: /* somatopetaltag       = 0
 */
477: /* somatofugal          =  /Purkinje/main[6] /Purkinje/b0s03
 */
478: /* somatofugaltag       = 0
 */
479: 
480:     {
481:         //m administrative overhead
482: 
483:         {
484:             //m type of structure
485: 
486:             MATH_TYPE_Compartment,
487:         },
488: 
489:         //m index of parent compartment, -1 for none
490: 
491:         6,
492: 
493: /* 	//m first mechanism */
494: 
495: /* 	NULL, */
496: 
497: /* 	//m number of mechanisms */
498: 
499: /* 	0, */
500: 
501:         //m descriptive values, alphabetical order
502: 
503: /*     double dCm; */
504: 
505:         1.754059463e-12, // unscaled 0.0164,
506: 
507: /*     double dEm; */
508: 
509:         -0.08,
510: 
511: /*     double dInitVm; */
512: 
513:         -0.068,
514: 
515: /*     double dInject;		 */
516: 
517:         0,
518: 
519: /*     double dRa; */
520: 
521:         169781.8594, // unscaled 2.5,
522: 
523: /*     double dRm; */
524: 
525:         2.804921958e+10, // unscaled 3
526:     },
527: /* [ /Purkinje/main[6] ]
 */
528: /* activation           = 0
 */
529: /* Vm                   = -0.0680000037
 */
530: /* previous_state       = 0
 */
531: /* Im                   = 0.03594784439
 */
532: /* Em                   = -0.07999999821
 */
533: /* Rm                   = 2.804921958e+10
 */
534: /* Cm                   = 1.754059463e-12
 */
535: /* Ra                   = 169781.8594
 */
536: /* inject               = 0
 */
537: /* dia                  = 8.609999895e-06
 */
538: /* len                  = 3.954098247e-06
 */
539: /* initVm               = -0.0680000037
 */
540: /* somatopetal          = /Purkinje/main[5]
 */
541: /* somatopetaltag       = 0
 */
542: /* somatofugal          =  /Purkinje/main[7] /Purkinje/b0s04
 */
543: /* somatofugaltag       = 0
 */
544: 
545:     {
546:         //m administrative overhead
547: 
548:         {
549:             //m type of structure
550: 
551:             MATH_TYPE_Compartment,
552:         },
553: 
554:         //m index of parent compartment, -1 for none
555: 
556:         7,
557: 
558: /* 	//m first mechanism */
559: 
560: /* 	NULL, */
561: 
562: /* 	//m number of mechanisms */
563: 
564: /* 	0, */
565: 
566:         //m descriptive values, alphabetical order
567: 
568: /*     double dCm; */
569: 
570:         3.37096605e-12, // unscaled 0.0164,
571: 
572: /*     double dEm; */
573: 
574:         -0.08,
575: 
576: /*     double dInitVm; */
577: 
578:         -0.068,
579: 
580: /*     double dInject;		 */
581: 
582:         0,
583: 
584: /*     double dRa; */
585: 
586:         442254.125, // unscaled 2.5,
587: 
588: /*     double dRm; */
589: 
590:         1.459522355e+10, // unscaled 3
591:     },
592: /* [ /Purkinje/main[7] ]
 */
593: /* activation           = 0
 */
594: /* Vm                   = -0.0680000037
 */
595: /* previous_state       = 0
 */
596: /* Im                   = 0.03594784811
 */
597: /* Em                   = -0.07999999821
 */
598: /* Rm                   = 1.459522355e+10
 */
599: /* Cm                   = 3.37096605e-12
 */
600: /* Ra                   = 442254.125
 */
601: /* inject               = 0
 */
602: /* dia                  = 7.780000487e-06
 */
603: /* len                  = 8.409710063e-06
 */
604: /* initVm               = -0.0680000037
 */
605: /* somatopetal          = /Purkinje/main[6]
 */
606: /* somatopetaltag       = 0
 */
607: /* somatofugal          =  /Purkinje/main[8]
 */
608: /* somatofugaltag       = 0
 */
609: 
610:     {
611:         //m administrative overhead
612: 
613:         {
614:             //m type of structure
615: 
616:             MATH_TYPE_Compartment,
617:         },
618: 
619:         //m index of parent compartment, -1 for none
620: 
621:         8,
622: 
623: /* 	//m first mechanism */
624: 
625: /* 	NULL, */
626: 
627: /* 	//m number of mechanisms */
628: 
629: /* 	0, */
630: 
631:         //m descriptive values, alphabetical order
632: 
633: /*     double dCm; */
634: 
635:         5.048512389e-12, // unscaled 0.0164,
636: 
637: /*     double dEm; */
638: 
639:         -0.08,
640: 
641: /*     double dInitVm; */
642: 
643:         -0.068,
644: 
645: /*     double dInject;		 */
646: 
647:         0,
648: 
649: /*     double dRa; */
650: 
651:         518791.0938, // unscaled 2.5,
652: 
653: /*     double dRm; */
654: 
655:         9745444864.0, // unscaled 3
656:     },
657: /* [ /Purkinje/main[8] ]
 */
658: /* activation           = 0
 */
659: /* Vm                   = -0.0680000037
 */
660: /* previous_state       = 0
 */
661: /* Im                   = 0.03594784066
 */
662: /* Em                   = -0.07999999821
 */
663: /* Rm                   = 9745444864
 */
664: /* Cm                   = 5.048512389e-12
 */
665: /* Ra                   = 518791.0938
 */
666: /* inject               = 0
 */
667: /* dia                  = 8.439999874e-06
 */
668: /* len                  = 1.160986722e-05
 */
669: /* initVm               = -0.0680000037
 */
670: /* somatopetal          = /Purkinje/main[7]
 */
671: /* somatopetaltag       = 0
 */
672: /* somatofugal          =  /Purkinje/br1 /Purkinje/br2
 */
673: /* somatofugaltag       = 0
 */
674: 
675: };
676: 
677: 
678: int piC2m[] =
679: {
680:     0,
681:     0,
682:     0,
683:     0,
684:     0,
685:     0,
686:     0,
687:     0,
688:     0,
689:     0,
690:     -1,
691: };
692: 
693: 
694: struct Intermediary inter =
695: {
696:     //m compartment array
697: 
698:     10,
699: 
700:     comp,
701: 
702:     //m all other mathematical components
703: 
704:     NULL,
705: 
706:     //m compartment 2 first mechanism number
707: 
708:     piC2m,
709: };
710: 
711: 
712: #include "main.c"
713: 
714: