123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- // Based on ../simulationcode/Step_current_firing.hoc
- load_file("nrngui.hoc")
- //objref cvode
- //cvode = new CVode()
- //cvode.active(1)
- dt = 0.01
- //======================== settings ===================================
- v_init = -80
- //step 1: 0.619
- //step 2: 0.793
- //step 3: 1.507
- step_amp = 0.2
- tstop = 300
- //tstop = 800
- celsius = 34
- //=================== creating cell object ===========================
- load_file("import3d.hoc")
- objref HL23PV
- strdef morphology_file
- morphology_file = "../../L23Net/morphologies/HL23PV.swc"
- load_file("../../L23Net/models/biophys_HL23PV.hoc")
- load_file("../../L23Net/models/NeuronTemplate.hoc")
- HL23PV = new NeuronTemplate(morphology_file)
- biophys_HL23PV(HL23PV)
- //==================== stimulus settings ===========================
- objref st1
- st1 = new IClamp(0.5)
- st1.dur = 200
- st1.del = 50
- st1.amp = step_amp
- HL23PV.soma st1
- //==================== recording settings ==========================
- objref vvec, tvec
- vvec = new Vector()
- tvec = new Vector()
- access HL23PV.soma
- cvode.record(&v(0.5),vvec,tvec)
- objref apcvec, apc
- apcvec = new Vector()
- apc = new APCount(0.5)
- apc.thresh= -10
- apc.record(apcvec)
- objref v_time
- objref f_time
- v_time = new Vector()
- { v_time.record(&t) }
- f_time = new File()
- objref Soma_v
- { Soma_v = new Vector() }
- { Soma_v.record(&HL23PV.soma.v(0.5))}
- objref Soma_ca
- { Soma_ca = new Vector() }
- { Soma_ca.record(&HL23PV.soma.cai(0.5))}
- //======================= plot settings ============================
- //objref gV
- //gV = new Graph()
- //gV.size(0,tstop,-80,40)
- //graphList[0].append(gV)
- //access L5PC.axon
- //access L5PC.soma
- //gV.addvar("soma","v(0.5)",1,1)
- //============================= simulation ================================
- nrnpython("from neuron import h")
- nrnpython("import time")
- nrnpython("print('Starting simulation of %s ms (dt: %s ms)'%(h.tstop,h.dt))")
- nrnpython("start_time = time.time()")
- init()
- run()
- nrnpython("end_time = time.time()")
- nrnpython("print('Finished simulation in %s s'%(end_time-start_time))")
- print "spikes = ", apcvec.printf("%.8f\t")
- print "spike count = ", apcvec.size()
- objref f_Soma_si
- f_Soma_si = new File()
- { f_Soma_si.wopen("Soma.pv.v.dat") }
- for i=0, Soma_v.size()-1 {
- f_Soma_si.printf("%f\t%f\n", v_time.x[i]/1000, Soma_v.x[i]/1000)
- }
- { f_Soma_si.close() }
- objref f_Soma_ca
- f_Soma_ca = new File()
- { f_Soma_ca.wopen("Soma.pv.ca.dat") }
- for i=0, Soma_ca.size()-1 {
- f_Soma_ca.printf("%f\t%f\n", v_time.x[i]/1000, Soma_ca.x[i])
- }
- { f_Soma_ca.close() }
|