-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcell_setup_pc2b_CCh_nov.hoc
793 lines (653 loc) · 17.9 KB
/
cell_setup_pc2b_CCh_nov.hoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
/* ____________ CELL SET-UP PROCEEDURE _____________ */
RmSoma=149999//
RaSoma=42.562//
RmTuft=45373.4//
RaTuft=35//
DistHalfRm=151.741
DistHalfRa=90.8296
SlopeRm=13.8656
SlopeRa=7.76766
soma_hbar = 0.00003//
KirGbar = 0.00020307*5//5 // Maximum conductance of potassium inward rectifier.
Epas=-71.9879
CmSoma=1
SpineFactorBasal=3.5
SpineFactorTuft=3.5
//curbase was 0.05 in the soma and 0.06 in the dendrites
balance = 0
geomnseg = 1
strdef sectype
objref CAN_temp, CAL_temp, CAT_temp, KAD_temp, KAP_temp, NA_temp
//RTH>> set distance ref
soma distance()
// SEVERELY affects experiment results
celsius = 34 // Temperature of slice.")
//NDB >>>> $o1.xopen_library("Terrence","cut-sections")
// cut_sections(maximum_segment_length)
//maximum_segment_length=75
//forall {
// nseg=1+int(L/maximum_segment_length)
//}
//<<<< NDB
//ORIG>>// make 3-d mapping of cell sections
//NDB >>>> $o1.xopen_library("Terrence","map-segments-to-3d")
// map_segments_to_3d()
forall {
insert d3
i=0
x_d3(0)=x3d(0)
y_d3(0)=y3d(0)
z_d3(0)=z3d(0)
for (x) if (x > 0 && x < 1) {
while (arc3d(i)/L < x) { i += 1 }
D=arc3d(i) - arc3d(i-1)
if (D <= 0) {
printf("\t\t * %s had a D < 0\n", secname())
}
alpha = (x*L - arc3d(i-1))/D
x_d3(x)=x3d(i-1) + (x3d(i) - x3d(i-1))*alpha
y_d3(x)=y3d(i-1) + (y3d(i) - y3d(i-1))*alpha
z_d3(x)=z3d(i-1) + (z3d(i) - z3d(i-1))*alpha
}
x_d3(1)=x3d(n3d()-1)
y_d3(1)=y3d(n3d()-1)
z_d3(1)=z3d(n3d()-1)
}
//NDB <<<<
//ORIG>>// prepare to make a graph with cell configuration
//NDB >>>> $o1.tmpo2=new Shape()
objref tmpo2
tmpo2=new Shape()
//NDB <<<<
//ORIG>>// Set initial conductance values
mult_cal=1
soma_caL =0.00006*mult_cal
soma_car =0.00003*mult_cal
gsomacar =0.00008*mult_cal
soma_caLH =0// 0.00018
soma_caT =0.0003*mult_cal
soma_km=0*0.001
potNa=50
mykca_init =0*0.9*1.5*0.03 //0.03 flag
soma_kca =0*0.7*4.5*0.0001//0.003 flag
AXKdr=1
AXNa=3.5//.5//.25
gkdrdend=0
gnanotrunk=0
psoma=0.00075//0.0015//0.01
slowsoma=0.15
slownotsoma=0.1
sinfsoma=1.35//1.35
soma_kap =7*0.0005*4*2.75//4//
axon_kap =7*0.0005*4*4//4//
soma_kad =7*0.0005*4*2.75//4//
gna=0.035*1//
axongkdr=0.011//
//gkdrapical=0.01*0.05//
gkd=0.005
gnadend=0.015*1.5//1.5
gkdrapical=0.01*0.05//
gkv2soma=0.00264*5//*0.05//
gkv2=0.00198*10//*0.05//
gkv2axon=0.00198*10//*0.05//
gkv2scale=0.3
scale_Na_conduct=14//15//13for C1O1 v2 0 everywhere 16 for step function
gkdrsoma=gkdrapical*0
distalv=0
proximalv=6
icannovfrac= 0.0
icannovgbar = 0.06*0.75//
cantau = 400//80
gip3= 1.85 // varies alpha as conductance of IP3R
// ***************************************************
// * Definition of exponential function that doesn't *
// * produce out-of-range values. *
// ***************************************************
func MyExp() {
if ($1>50) {
return exp(50)
} else {
if ($1<-50) {
return 0
} else {
return exp($1)
}
}
}
//ORIG>>// Start inserting mechanisms in cell
sectype ="soma"
forsec "soma" {
insert icannov
gbar_icannov = icannovgbar
taur_icannov = cantau
insert na16a
gbar_na16a= gna * scale_Na_conduct
dist_na16a = sinfsoma
persist_na16a = psoma
slowdown_na16a = slowsoma
C1O1v2_na16a=proximalv
insert kd
gbar_kd=gkdrsoma
//shift_kdr=shiftkdr
//scale_kdr=scalekdr
ena = potNa
insert Kv2like
gbar_Kv2like=gkv2soma
insert nap //flag
gnabar_nap = 0*.5*0.000014
K_nap = 4.5
vhalf_nap = -60.4
insert pas
Rm=RmTuft+1*(RmSoma-RmTuft)/(1+MyExp((-DistHalfRm)/SlopeRm))
Ra=RaTuft+1*(RaSoma-RaTuft)/(1+MyExp((-DistHalfRa)/SlopeRa))
g_pas=1/Rm
cm=CmSoma
insert h // h current
gbar_h = soma_hbar
K_h = 8.8
vhalf_h = -82
insert kap // proximal A current
gkabar_kap = soma_kap
ek = -80
insert km // m-type potassium current
gbar_km = soma_km
ek = -80
insert cal // HVA Ca++-L type current
gcalbar_cal = 0.1*soma_caL
insert cat // LVA Ca++-T type current
gcatbar_cat = soma_caT
//insert somacar // HVAm Ca++-R type current
//gcabar_somacar = gsomacar
insert car // HVAm Ca++-R type current
gcabar_car = gsomacar
insert kca // K(Ca) mAHP potassium type current
cac_kca=0.00075 //0.0005
gbar_kca = 0.5*soma_kca
insert mykca // K(Ca) fAHP potassium type current
gkbar_mykca = 5.5*mykca_init
//insert cad // calcium pump/buffering mechanism
//taur_cad=20
//insert cabalan // calcium pump/buffering mechanism
tmpo2.color(2)
}
//ORIG>> Configure Axon
sectype="axon"
forsec axon_sec_list {
insert nax
gbar_nax=gna*AXNa
insert kd
gbar_kd=axongkdr
//shift_kdr=shiftkdr
//scale_kdr=scalekdr
ena = potNa
insert pas
Rm=RmTuft+1*(RmSoma-RmTuft)/(1+MyExp((-DistHalfRm)/SlopeRm))
Ra=RaTuft+1*(RaSoma-RaTuft)/(1+MyExp((-DistHalfRa)/SlopeRa))
g_pas=1/Rm
cm=CmSoma
insert km // m-type potassium current
gbar_km = 3*soma_km
ek = -80
insert kap // proximal A current
gkabar_kap = axon_kap
ek = -80
insert Kv2like
gbar_Kv2like=gkv2axon
}
//ORIG>> Configure apical trunk
forsec apical_trunk_list {
insert icannov
gbar_icannov = icannovgbar
taur_icannov = cantau
//ORIG>>// apical_h_insert_sig($o1) // Inserting h-current
//NDF>>> apical_caR_caLH_insert($o1) // Inserting Ca++ R-type and Ca++ L-type currents
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
insert car
gcabar_car(x) = 0.1*soma_car
insert calH
if (xdist > 50) {
gcalbar_calH(x) = 2*soma_caLH //4.6*soma_caLH
} else {
gcalbar_calH(x) = 0.1*soma_caLH //0.1*soma_caLH
}
}
//<<<NDF
//NDF>>> apical_caT_insert($o1) // Inserting Ca++ T-type current
caT_distal_maxfactor = 4 //ORIG>> maximum cond. factor in dendrites
caT_distal_distance = 350 //ORIG>> distance in dendrites for maximum cond.
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist = distance(x)
fr = xdist/caT_distal_distance
insert cat
if (xdist < 100) {
gcatbar_cat(x) = 0
} else {
gcatbar_cat(x) = caT_distal_maxfactor*soma_caT*fr
}
}
//<<<NDF
//NDF>>> apical_kca_insert($o1) // Inserting K(Ca) sAHP and mAHP potassium currents
kca_distal_maxfactor = 1 //ORIG>> maximum cond. factor in dendrites
//ORIG>>// kca_distal_maxfactor = 0 //maximum cond. factor in dendrites
kca_distal_distance = 200 //ORIG>> distance in dendrites for maximum cond.
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist = distance(x)
fr = xdist/kca_distal_distance
//insert cad // calsium pump/buffering mechanism
//taur_cad=20
insert kca // slow AHP K++ current
cac_kca=0.00075 //0.0005
insert mykca // medium AHP K++ current
if (xdist < kca_distal_distance && xdist > 50) {
gbar_kca(x) = 5*soma_kca
gkbar_mykca = 2*mykca_init
} else {
gbar_kca(x) = 0.5*soma_kca
gkbar_mykca = 0.5*mykca_init
}
}
//<<<NDF
//ORIG>>// A_insert($o1) // Inserting A-current
insert h
insert kap
insert kad
insert Kv2like
for (x){
xdist = distance(x)
if (xdist>500) {xdist=500}
gbar_h(x) = soma_hbar*(1+(6/5)*xdist/100)
if (xdist > 100){
if (xdist>300) {ndist=300} else {ndist=xdist}
vhalf_h(x)=-81-8*(ndist-100)/200
gkabar_kad(x) = soma_kad*(1+xdist/100)
gkabar_kap(x)=0
gbar_Kv2like(x) =gkv2*gkv2scale
} else {
vhalf_h(x)=-81
gkabar_kap(x) = soma_kap*(1+xdist/100)
gbar_Kv2like(x) = gkv2
gkabar_kad(x)=0
}
}
insert na16a
gbar_na16a=gnadend*scale_Na_conduct
persist_na16a=psoma
slowdown_na16a = slownotsoma
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
y=30+45*(1-MyExp(-xdist/126))
if (y>=25.5) {
if (y<=44.6) {
dist_na16a=(y-11)/14
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
} else { if (y<=58.2) {
dist_na16a=(y-27)/7.3
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
}else { if(y<=65.79) {
dist_na16a=(y-44)/3.3
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
} else{
dist_na16a=(y-44)/3.3
persist_na16a=psoma
C1O1v2_na16a=distalv}
}}} else {
dist_na16a=(y+2.1)/26.848
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200}
}
insert kd
gbar_kd=gkdrapical
//shift_kdr=shiftkdr
//scale_kdr=scalekdr
ena = potNa
insert km // m-type potassium current
gbar_km = soma_km
ek = -80
insert pas
for (x) {
xdist=distance(x)
if (xdist<=100) {
SpineFactor=1
} else {
if (xdist>394) {
SpineFactor=SpineFactorTuft
} else {
SpineFactor=2+(xdist-100)*(SpineFactorTuft-2)/294
}
}
if (xdist<394) {
Rm=RmTuft+(RmSoma-RmTuft)/(1+MyExp((xdist-DistHalfRm)/SlopeRm))
Ra=RaTuft+(RaSoma-RaTuft)/(1+MyExp((xdist-DistHalfRa)/SlopeRa))
} else {
Rm=RmTuft+(RmSoma-RmTuft)/(1+MyExp((394-DistHalfRm)/SlopeRm))
Ra=RaTuft+(RaSoma-RaTuft)/(1+MyExp((394-DistHalfRa)/SlopeRa))
}
cm(x)=SpineFactor*CmSoma
g_pas(x)=SpineFactor/Rm
}
tmpo2.color(4)
insert kir
gbar_kir=KirGbar
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
insert kir
if (xdist > 100) {
gbar_kir=KirGbar
} else {
gbar_kir=KirGbar*xdist/100
}
}
}
// Configure the apical-non-trunk section: insert basic mechanisms
sectype = "apical non-trunk"
forsec apical_non_trunk_list {
insert icannov
gbar_icannov = icannovgbar
taur_icannovnov = cantau
//ORIG>>// apical_h_insert_sig($o1) // Inserting h-current
//NDF>>> apical_caR_caLH_insert($o1) // Inserting Ca++ R-type and Ca++ L-type currents
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
insert car
gcabar_car(x) = 0.1*soma_car
insert calH
if (xdist > 50) {
gcalbar_calH(x) = 2*soma_caLH //4.6*soma_caLH
} else {
gcalbar_calH(x) = 0.1*soma_caLH //0.1*soma_caLH
}
}
//<<<NDF
//NDF>>> apical_caT_insert($o1) // Inserting Ca++ T-type current
caT_distal_maxfactor = 4 // ORIG>> maximum cond. factor in dendrites")
caT_distal_distance = 350 // ORIG>> distance in dendrites for maximum cond.")
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
fr = xdist/caT_distal_distance
insert cat
if (xdist < 100) {
gcatbar_cat(x) = 0
} else {
gcatbar_cat(x) = caT_distal_maxfactor*soma_caT*fr
}
}
//<<<NDF
//NDF>>> apical_kca_insert($o1) // Inserting K(Ca) sAHP and mAHP potassium currents
kca_distal_maxfactor = 1 // ORIG>> maximum cond. factor in dendrites")
// ORIG>>//kca_distal_maxfactor = 0 // maximum cond. factor in dendrites
kca_distal_distance = 200 // ORIG>> distance in dendrites for maximum cond.")
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
fr = xdist/kca_distal_distance
//insert cad // calsium pump/buffering mechanism
//taur_cad=20
insert kca // slow AHP K++ current
cac_kca=0.00075 //0.0005
insert mykca // medium AHP K++ current
if (xdist < kca_distal_distance && xdist > 50) {
gbar_kca(x) = 5*soma_kca
gkbar_mykca = 2*mykca_init
} else {
gbar_kca(x) = 0.5*soma_kca
gkbar_mykca = 0.5*mykca_init
}
}
//<<<NDF
//ORIG>>// A_insert($o1) // Inserting A-current
insert h
insert kap
insert Kv2like
insert kad
for (x){
xdist = distance(x)
if (xdist>500) {xdist=500}
gbar_h(x) = soma_hbar*(1+(6/5)*xdist/100)
if (xdist > 100){
if (xdist>300) {ndist=300} else {ndist=xdist}
vhalf_h(x)=-81-8*(ndist-100)/200
gkabar_kad(x) = soma_kad*(1+xdist/100)
gkabar_kap(x) = 0
gbar_Kv2like(x) = gkv2*gkv2scale
} else {
vhalf_h(x)=-81
gkabar_kap(x) = soma_kap*(1+xdist/100)
gbar_Kv2like(x) = gkv2
gkabar_kad(x) = 0
}
}
insert na16a
gbar_na16a = gnadend*scale_Na_conduct
persist_na16a=psoma
slowdown_na16a = slownotsoma
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
y=30+45*(1-MyExp(-xdist/126))
if (y>=25.5) {
if (y<=44.6) {
dist_na16a=(y-11)/14
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
} else { if (y<=58.2) {
dist_na16a=(y-27)/7.3
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
}else { if(y<=65.79) {
dist_na16a=(y-44)/3.3
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200
} else{
dist_na16a=(y-44)/3.3
persist_na16a=psoma
C1O1v2_na16a=distalv}
}}} else {
dist_na16a=(y+2.1)/26.848
persist_na16a=psoma
C1O1v2_na16a=6-6*xdist/200}
}
insert kd
gbar_kd = gkdrapical
//shift_kdr=shiftkdr
//scale_kdr=scalekdr
ena = potNa
insert km // m-type potassium current
gbar_km = soma_km
ek = -80
insert pas
for (x) {
xdist=distance(x)
if (xdist<=100) {
SpineFactor=1
} else {
if (xdist>394) {
SpineFactor=SpineFactorTuft
} else {
SpineFactor=2+(xdist-100)*(SpineFactorTuft-2)/294
}
}
if (xdist<394) {
Rm=RmTuft+(RmSoma-RmTuft)/(1+MyExp((xdist-DistHalfRm)/SlopeRm))
Ra=RaTuft+(RaSoma-RaTuft)/(1+MyExp((xdist-DistHalfRa)/SlopeRa))
} else {
Rm=RmTuft+(RmSoma-RmTuft)/(1+MyExp((394-DistHalfRm)/SlopeRm))
Ra=RaTuft+(RaSoma-RaTuft)/(1+MyExp((394-DistHalfRa)/SlopeRa))
}
cm(x)=SpineFactor*CmSoma
g_pas(x)=SpineFactor/Rm
}
//ORIG>>//Rm_sigmoid($o1) // configure Rm along apical trunk
//ORIG>>//Ra_sigmoid($o1) // configure Ra along apical trunk
tmpo2.color(3)
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
insert kir
if (xdist > 100) {
gbar_kir=KirGbar
} else {
gbar_kir=KirGbar*xdist/100
}
}
}
//ORIG>>//khoblique_peri_decay($o1) // Configure the apical oblique dendrites
// Configure the basal dendrites
sectype = "basal tree"
forsec basal_tree_list {
insert na3dend
insert nap
gnabar_nap = 0*.5*0.000014 //flag
K_nap = 4.5
vhalf_nap = -60.4
insert kap
gkabar_kap = 0.0025036
insert h
gbar_h = soma_hbar
//ORIG>>//ek = -80
insert kd
//shift_kdr=shiftkdr
//scale_kdr=scalekdr
gbar_na3dend=gnadend
gbar_kd=gkdrdend
ena = potNa
insert Kv2like
gbar_Kv2like = gkv2*gkv2scale
insert pas
for (x) {
xdist=distance(x)
if (xdist<=40) {
SpineFactor=1
} else {
SpineFactor=SpineFactorBasal
}
Rm=RmTuft+1*(RmSoma-RmTuft)/(1+MyExp((-DistHalfRm)/SlopeRm))
Ra=RaTuft+1*(RaSoma-RaTuft)/(1+MyExp((-DistHalfRa)/SlopeRa))
cm(x)=SpineFactor*CmSoma
g_pas(x)=SpineFactor/Rm
}
for (x) {
xdist = find_vector_distance_precise(secname(),x)
xdist=distance(x)
insert kir
if (xdist > 40) {
gbar_kir=KirGbar
} else {
gbar_kir=KirGbar*xdist/40
}
}
tmpo2.color(5)
}
//ORIG>>//khbasal_fixed($o1) // Configure basal dendrites
//forsec "soma" { g_pas= 1/Rm_soma} // force Rm at all soma sections
//ORIG>>// forall if (ismembrane("kdr") ) {
//ORIG>>// ek = -80 //-77
//ORIG>>// }
forall if(ismembrane("ca_ion")) {
eca =140
ion_style("ca_ion",0,1,0,0,0)
vshift_ca = 0
}
maximum_segment_length=75
//freq = 150 // Hz, frequency at which AC length constant will be computed
freq = 100 // Hz, frequency at which AC length constant will be computed
d_lambda = 0.1
func lambda_f() { local i, x1, x2, d1, d2, lam
if (n3d() < 2) {
return 1e5*sqrt(diam/(4*PI*$1*Ra*cm))
}
// above was too inaccurate with large variation in 3d diameter
// so now we use all 3-d points to get a better approximate lambda
x1 = arc3d(0)
d1 = diam3d(0)
lam = 0
for i=1, n3d()-1 {
x2 = arc3d(i)
d2 = diam3d(i)
lam += (x2 - x1)/sqrt(d1 + d2)
x1 = x2 d1 = d2
}
// length of the section in units of lambda
lam *= sqrt(2) * 1e-5*sqrt(4*PI*$1*Ra*cm)
return L/lam
}
if(balance) forall {
for (x) {
if (ismembrane("na_ion") && ismembrane("ca_ion") && ismembrane("Ca_ion") && (ismembrane("k_ion"))) {
e_pas(x)=(ina(x)+ik(x)+ica(x)+iCa(x)+g_pas(x)*v(x))/g_pas(x)
} else if (ismembrane("na_ion") && ismembrane("ca_ion") && (ismembrane("k_ion"))){
e_pas(x)=(ina(x)+ik(x)+ica(x)+g_pas(x)*v(x))/g_pas(x)
} else if (ismembrane("na_ion") && (ismembrane("k_ion"))) {
e_pas(x)=(ina(x)+ik(x)+g_pas(x)*v(x))/g_pas(x)
printf("Section %s ina: %g ik: %g\n", secname(), ina(x), ik(x))
psection()
} else {
print "simply assigning v(x)"
e_pas(x)=v(x)
}
fcurrent()
}
}
forall{
for(x){
e_pas=Epas}
}
if(geomnseg) {forall {
nseg = int((L/(d_lambda*lambda_f(freq))+0.9)/2)*2 + 1
}
}
forall {
for(x){
insert cal4
DCa_cal4=0.22
cao0_ca_ion=2
ip3i_cal4=0.16e-3
if(ismembrane("icannovnov")){
concrelease_icannovnov=500
}
//if(ismembrane("na16a")){
// dist_na16a=12.5
// }
}
}
forsec "soma" {
for (x) {
rdist=distance(x)
alpha_cal4(x)=gip3*(0.75+.25*MyExp(-rdist/100))
print x, rdist, alpha_cal4(x)
}
}
forsec apical_trunk_list {
for (x) {
rdist=distance(x)
alpha_cal4(x)=gip3*(0.75+.25*MyExp(-rdist/100))
print x, rdist, alpha_cal4(x)
}
}
forsec apical_non_trunk_list {
for (x) {
rdist=distance(x)
alpha_cal4(x)=gip3*(0.75+.25*MyExp(-rdist/100))
print x, rdist, alpha_cal4(x)
}
}
forsec basal_tree_list {
for (x) {
rdist=distance(x)
alpha_cal4(x)=gip3*(0.75+.25*MyExp(-rdist/100))
print x, rdist, alpha_cal4(x)
}
}
forall {
nseg = int((L/(d_lambda*lambda_f(freq))+0.9)/2)*2 + 5 //+5
}