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: #define HECCER_TEST_INTERPOL_INTERVAL_DEFAULT_ENTRIES           20
024: #define HECCER_TEST_INTERVAL_DEFAULT_START                      (-0.1)
025: #define HECCER_TEST_INTERVAL_DEFAULT_END                        (0.05)
026: #define HECCER_TEST_INTERVAL_DEFAULT_ENTRIES                    50
027: #define HECCER_TEST_STEPS 1
028: 
029: 
030: struct Compartment pcomp[] =
031: {
032:     {
033:         //m administrative overhead
034: 
035:         {
036:             //m type of structure
037: 
038:             MATH_TYPE_Compartment,
039:         },
040: 
041:         //m index of parent compartment, -1 for none
042: 
043:         -1,
044: 
045: /*     //m first mechanism */
046: 
047: /*     NULL, */
048: 
049: /*     //m number of mechanisms */
050: 
051: /*     0, */
052: 
053:         //m descriptive values, alphabetical order
054: 
055: /*     double dCm; */
056: 
057:         4.57537e-11, // unscaled 0.0164,
058: 
059: /*     double dEm; */
060: 
061:         -0.08,
062: 
063: /*     double dInitVm; */
064: 
065:         -0.068,
066: 
067: /*     double dInject;		 */
068: 
069:         0,
070: 
071: /*     double dRa; */
072: 
073:         360502, // unscaled 2.5,
074: 
075: /*     double dRm; */
076: 
077:         3.58441e+08, // unscaled 1
078:     },
079: 
080:     {
081:         //m administrative overhead
082: 
083:         {
084:             //m type of structure
085: 
086:             MATH_TYPE_Compartment,
087:         },
088: 
089:         //m index of parent compartment, -1 for none
090: 
091:         0,
092: 
093: /* 	//m first mechanism */
094: 
095: /* 	NULL, */
096: 
097: /* 	//m number of mechanisms */
098: 
099: /* 	0, */
100: 
101:         //m descriptive values, alphabetical order
102: 
103: /*     double dCm; */
104: 
105:         5.755329373e-12, // unscaled 0.0164,
106: 
107: /*     double dEm; */
108: 
109:         -0.08,
110: 
111: /*     double dInitVm; */
112: 
113:         -0.068,
114: 
115: /*     double dInject;		 */
116: 
117:         0,
118: 
119: /*     double dRa; */
120: 
121:         772813.4375, // unscaled 2.5,
122: 
123: /*     double dRm; */
124: 
125:         8.548598272e9, // unscaled 3
126:     },
127: };
128: 
129: 
130: //v a muscarinic potassium channel
131: 
132: struct ChannelPersistentSteadyStateTau pcsstKM[] =
133: {
134:     {
135:         //m administrative overhead
136: 
137:         {
138:             //m type of structure
139: 
140:             MATH_TYPE_ChannelPersistentSteadyStateTau,
141:         },
142: 
143:         //m first set of descriptive values, alphabetical order
144: 
145:         //m initial reversal potential
146: 
147:         -0.085,
148: 
149:         //m get reversal potential from this intermediary, -1 for none
150: 
151:         -1,
152: 
153:         //m maximal conductance when all channels are permissive
154: 
155:         1.115943116e-09,
156: 
157:         //m contributes to this concentration pool, -1 for none, boolean indicator only.
158: 
159:         -1,
160: 
161:         //m power
162: 
163:         1,
164: 
165:         //m gate table, -1 for initialization
166: 
167:         -1,
168: 
169:         //m gate initial value
170: 
171:         0.03540844397,
172: 
173:         {
174:             //m steady state definition
175: 
176:             {
177:                 //m 1: nominator
178: 
179:                 0.2,
180: 
181:                 //m 2: denominator multiplier 1
182: 
183:                 3.3,
184: 
185:                 //m 5: membrane offset 1
186: 
187:                 0.035,
188: 
189:                 //m 6: denormalized time constant 1
190: 
191:                 0.02,
192: 
193:                 //m 2: denominator multiplier 2
194: 
195:                 1.0,
196: 
197:                 //m 5: membrane offset 2
198: 
199:                 0.035,
200: 
201:                 //m 6: denormalized time constant 2
202: 
203:                 -0.02,
204: 
205:             },
206: 
207:             //m time constant definition
208: 
209:             {
210:                 //m 1: nominator
211: 
212:                 1.0,
213: 
214:                 //m 2: denominator offset
215: 
216:                 1.0,
217: 
218:                 //m 5: membrane offset 1
219: 
220:                 0.035,
221: 
222:                 //m 6: denormalized time constant 1
223: 
224:                 -0.01,
225: 
226:             },
227:         },
228:     },
229: 
230:     {
231:         //m administrative overhead
232: 
233:         {
234:             //m type of structure
235: 
236:             MATH_TYPE_ChannelPersistentSteadyStateTau,
237:         },
238: 
239:         //m first set of descriptive values, alphabetical order
240: 
241:         //m initial reversal potential
242: 
243:         -0.085,
244: 
245:         //m get reversal potential from this intermediary, -1 for none
246: 
247:         -1,
248: 
249:         //m maximal conductance when all channels are permissive
250: 
251:         3.509344551e-11,
252: 
253:         //m contributes to this concentration pool, -1 for none, boolean indicator only.
254: 
255:         -1,
256: 
257:         //m power
258: 
259:         1,
260: 
261:         //m gate table, -1 for initialization
262: 
263:         -1,
264: 
265:         //m gate initial value
266: 
267:         0.03540844397,
268: 
269:         {
270:             //m steady state definition
271: 
272:             {
273:                 //m 1: nominator
274: 
275:                 0.2,
276: 
277:                 //m 2: denominator multiplier 1
278: 
279:                 3.3,
280: 
281:                 //m 5: membrane offset 1
282: 
283:                 0.035,
284: 
285:                 //m 6: denormalized time constant 1
286: 
287:                 0.02,
288: 
289:                 //m 2: denominator multiplier 2
290: 
291:                 1.0,
292: 
293:                 //m 5: membrane offset 2
294: 
295:                 0.035,
296: 
297:                 //m 6: denormalized time constant 2
298: 
299:                 -0.02,
300: 
301:             },
302: 
303:             //m time constant definition
304: 
305:             {
306:                 //m 1: nominator
307: 
308:                 1.0,
309: 
310:                 //m 2: denominator offset
311: 
312:                 1.0,
313: 
314:                 //m 5: membrane offset 1
315: 
316:                 0.035,
317: 
318:                 //m 6: denormalized time constant 1
319: 
320:                 -0.01,
321: 
322:             },
323:         },
324:     },
325: };
326: 
327: 
328: int piC2m[] =
329: {
330:     1,
331:     2,
332:     -1,
333: };
334: 
335: 
336: struct MathComponentArray mca =
337: {
338:     //m number of math components
339: 
340:     2,
341: 
342:     //m math component data
343: 
344:     &pcsstKM[0].mc,
345: 
346:     //m math component index, initialize to NULL
347: 
348:     NULL,
349: 
350: };
351: 
352: 
353: struct Intermediary inter =
354: {
355:     //m compartment array
356: 
357:     2,
358: 
359:     pcomp,
360: 
361:     //m all other mathematical components
362: 
363:     &mca,
364: 
365:     //m compartment 2 first mechanism number
366: 
367:     piC2m,
368: };
369: 
370: 
371: #include "main.c"
372: 
373: