Changeset 27724 in project


Ignore:
Timestamp:
10/29/12 05:11:23 (7 years ago)
Author:
Ivan Raikov
Message:

nemo: consolidating test scripts into main model file with user template functionality

Location:
release/4/nemo/trunk/examples/CGC
Files:
3 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/nemo/trunk/examples/CGC/DeSouzaCGC.nemo

    r27723 r27724  
    605605EOF
    606606)
     607
     608    ("template.hoc" () 
     609#<<EOF
     610
     611stim_amp=0.01875
     612
     613// object variable will refer to a list that will hold an arbitrary number of NetCon objects.
     614
     615objectvar nclist 
     616
     617// synapses         
     618
     619objectvar synAMPA,synNMDA,synGABAa1,synGABAa2
     620
     621//counting spikes
     622
     623objref spiketimes,spikecount
     624
     625objref voltagem
     626
     627tmax=1000   
     628
     629create soma
     630
     631x=0
     632y=0
     633z=0
     634
     635spiketimes=new Vector()
     636lastspikecount=0
     637
     638voltagem=new Vector()
     639
     640soma {
     641
     642    pt3dclear()
     643    pt3dadd(x,y,z,10)  //set position of cell
     644    pt3dadd(x,y,z+10,10)
     645     
     646    nseg=1
     647
     648{% with diam = default(diam, 11.8), L = default(L, 11.8) %}
     649        diam = {{diam}}
     650        L = {{L}}
     651{% endwith %}
     652
     653    Ra=100
     654    cm=1
     655    celsius = 30
     656   
     657    Area = PI*soma.diam*soma.L*1e-8
     658
     659    insert {{model_name}}_CaHVA
     660    insert {{model_name}}_ca
     661    insert {{model_name}}_KA
     662    insert {{model_name}}_KCa
     663    insert {{model_name}}_Kir   
     664    insert {{model_name}}_KM
     665    insert {{model_name}}_KV
     666    insert {{model_name}}_Lkg1
     667    insert {{model_name}}_Lkg2
     668    insert {{model_name}}_Na
     669   
     670    nclist=new List()
     671   
     672    //Synapses
     673    synAMPA=new Exp2Syn(0.5) //Adding synapse with rise and decay time
     674    synAMPA.tau1=0.03  // ms rise time
     675    synAMPA.tau2=0.5  // ms decay time
     676    synAMPA.e=0     // mV reversal potential
     677   
     678    synNMDA=new Exp2Syn(0.5) //Adding synapse with rise and decay time
     679    synNMDA.tau1=1  // ms rise time
     680    synNMDA.tau2=13.3  // ms decay time
     681    synNMDA.e=0     // mV reversal potential
     682   
     683    synGABAa1=new Exp2Syn(0.5) //Adding synapse with rise and decay time
     684    synGABAa1.tau1=0.31  // ms rise time
     685    synGABAa1.tau2=8.8  // ms decay time
     686    synGABAa1.e=-75     // mV reversal potential
     687   
     688    synGABAa2=new Exp2Syn(0.5) //Adding synapse with rise and decay time
     689    synGABAa2.tau1=0.31  // ms rise time
     690    synGABAa2.tau2=300  // ms decay time
     691    synGABAa2.e=-75     // mV reversal potential
     692   
     693    //counting spikes
     694    spikecount=new APCount(0.5)
     695    spikecount.thresh=-20
     696    spikecount.record(spiketimes)
     697   
     698    //Saving Vm
     699    voltagem.record(&v(0.5))
     700}
     701
     702EOF
     703)
     704    ("neuron_run.hoc" () 
     705
     706#<<EOF
     707
     708load_file( "{{model_name}}_template.hoc" )
     709
     710v_init = -70
     711
     712celsius = 30
     713
     714{% with tstop = default(tstop, 1000) %}
     715tstop = {{tstop}} // for IClamp
     716{% endwith %}
     717
     718dt = 0.025
     719
     720access soma
     721psection()
     722
     723printf("ena: %f", ena)
     724printf("ek: %f", ek)
     725printf("eca: %f", eca)
     726printf("celsius: %f", celsius)
     727
     728objectvar stim
     729soma stim = new IClamp(0.5)
     730stim.del = 1000
     731stim.dur = 1000
     732stim.amp = stim_amp
     733 
     734objref rec_v
     735rec_v = new Vector()
     736rec_v.record (&soma.v(0.5))
     737
     738objref rec_t
     739rec_t = new Vector()
     740rec_t.record (&t)
     741
     742dt = 0.025
     743tstop = 2000
     744run()
     745
     746objref output_file
     747output_file = new File()
     748output_file.wopen("DeSouzaCGC.dat")
     749
     750for (i=0; i < rec_v.size(); i=i+1) {
     751  output_file.printf("%g %g\n", rec_t.x[i], rec_v.x[i])
     752}
     753output_file.close()
     754quit()
     755       
     756
     757EOF
     758)
     759
    607760    ("octave_odepkg_run.m" () 
    608761
     
    620773global celsius cai
    621774
    622 cai = 1e-4;
    623 celsius = 30;
     775
     776{% with cai = default(cai, 1e-4), celsius = default(celsius, 30) %}
     777cai = {{cai}} ;
     778celsius = {{celsius}} ;
     779{% endwith %}
    624780
    625781y0 = {{model_name}}_init(-70)
    626782
     783{% with tstop = default(tstop, 300) %}
     784tstop = {{tstop}} ;
     785{% endwith %}
     786
    627787t0 = 0.0;
    628 t1 = 300.0;
     788t1 = tstop;
     789
    629790dt = 1e-3;
    630791
    631792reltol=1e-2;
    632793abstol=1e-2;
    633 
    634794
    635795function y = step (x, k)
Note: See TracChangeset for help on using the changeset viewer.