Changeset 29159 in project


Ignore:
Timestamp:
06/23/13 12:00:42 (8 years ago)
Author:
Ivan Raikov
Message:

nemo: added netstim test to granule cell example model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/nemo/trunk/examples/Granule/Granule_DeSouza10.nemo

    r29115 r29159  
    758758EOF
    759759)
    760     ("neuron_run.hoc" () 
     760
     761    ("syn_template.hoc" () 
     762#<<EOF
     763
     764objref syn[5]
     765objref nclist
     766
     767nclist = new List()
     768   
     769create soma
     770
     771soma {
     772     
     773    nseg=1
     774
     775{% with diam = default(diam, 11.8), L = default(L, 11.8) %}
     776    diam = {{diam}}
     777    L = {{L}}
     778{% endwith %}
     779
     780    Ra=100
     781    cm=1
     782    celsius = 30
     783
     784    insert {{model_name}}_CaHVA
     785    insert {{model_name}}_ca
     786    insert {{model_name}}_KA
     787    insert {{model_name}}_KCa
     788    insert {{model_name}}_Kir   
     789    insert {{model_name}}_KM
     790    insert {{model_name}}_KV
     791    insert {{model_name}}_Lkg1
     792    insert {{model_name}}_Lkg2
     793    insert {{model_name}}_Na
     794
     795
     796   
     797}
     798
     799for i=0,4 {
     800    syn[i] = new Granule_AMPA(0)
     801}
     802
     803
     804EOF
     805)
     806
     807
     808    ("protocol.hoc" () 
    761809
    762810#<<EOF
     
    816864EOF
    817865)
     866
     867    ("netstim_protocol.hoc" () 
     868#<<EOF
     869load_file("nrngui.hoc")
     870
     871load_file( "{{model_name}}_syn_template.hoc" )
     872
     873objref gc
     874gc = new GC()
     875
     876prelength = 1000
     877mainlength = 6000
     878
     879
     880//**********************************************************************
     881proc simulate() { local preDT, mainDT, logsize  localobj logfile, tlog, Vlog, iklog, inalog, icalog, ica2log
     882   
     883    mainDT = 0.025
     884    preDT = 0.025
     885   
     886    dt = preDT
     887    tstop = prelength
     888    run()
     889   
     890   
     891    if ( stoprun == 1) return
     892   
     893    dt = mainDT
     894    continuerun(prelength + mainlength)
     895    if ( stoprun == 1) return
     896   
     897    logfile=$o1
     898    tlog=$o2
     899    Vlog=$o3
     900    iklog=$o4
     901    inalog=$o5
     902    icalog=$o6
     903    ica2log=$o7
     904   
     905    logsize = tlog.size()
     906   
     907    for i=0,tlog.size()-1 {
     908        logfile.printf("%g %g %g %g %g\n", tlog.x[i], Vlog.x[i], iklog.x[i], inalog.x[i], icalog.x[i], ica2log.x[i])
     909    }
     910
     911}
     912
     913
     914//*************User-Interface*******************************************
     915
     916nrnsecmenu(0.5, 1)
     917
     918xpanel("Spontaneous firing")
     919xvalue("Time for Initialization", "prelength")
     920xvalue("Main duration", "mainlength")
     921
     922xvalue("dt", "dt")
     923xvalue("t", "t")
     924xlabel("")
     925xbutton("Start", "simulate()")
     926xbutton("Stop", "stoprun = 1")
     927xpanel()
     928
     929vec_sizes = (prelength+mainlength)/dt + 1       // recorded traces are all this size
     930
     931strdef logfn
     932objref ns, iklog, inalog, icalog, ica2log, Vlog, tlog, logfile
     933
     934objref stim_rates // input stimulus rates
     935
     936nrates = 5
     937stim_rates = new Vector (nrates)
     938stim_rates.x[0] = 1
     939stim_rates.x[1] = 20
     940stim_rates.x[2] = 50
     941stim_rates.x[3] = 100
     942stim_rates.x[4] = 200
     943
     944for (k=0; k < nrates; k = k + 1) {
     945
     946  ns = new NetStim()
     947  ns.start    = 1000
     948  ns.number   = 100000
     949  ns.noise    = 1
     950  ns.interval = (1 / stim_rates.x[k]) * 1000
     951
     952  gc.nclist.append (new NetCon(ns,gc.syn[0],-20,1,0.1))
     953  gc.nclist.append (new NetCon(ns,gc.syn[1],-20,12,0.1))
     954  gc.nclist.append (new NetCon(ns,gc.syn[2],-20,15,0.1))
     955  gc.nclist.append (new NetCon(ns,gc.syn[2],-20,17,0.1))
     956  gc.nclist.append (new NetCon(ns,gc.syn[2],-20,19,0.1))
     957
     958  iklog = new Vector(vec_sizes)
     959  iklog.record (&gc.soma.ik(0.5))
     960
     961  inalog = new Vector(vec_sizes)
     962  inalog.record (&gc.soma.ina(0.5))
     963
     964  icalog = new Vector(vec_sizes)
     965  icalog.record (&gc.soma.ica(0.5))
     966
     967  ica2log = new Vector(vec_sizes)
     968  ica2log.record (&gc.soma.ica2(0.5))
     969
     970  Vlog = new Vector(vec_sizes)
     971  Vlog.record (&gc.soma.v(0.5))
     972
     973  tlog = new Vector(vec_sizes,0)
     974  tlog.record (&t)
     975
     976  sprint (logfn, "Granule_netstim_protocol_%d_Hz.dat", stim_rates.x[k] )
     977
     978  logfile = new File()
     979  logfile.wopen ( logfn  )
     980
     981  simulate(logfile,tlog,Vlog,iklog,inalog,icalog,ica2log)
     982  logfile.close()
     983}
     984
     985quit()
     986EOF
     987)
     988
     989
    818990
    819991    ("octave_odepkg_run.m" () 
     
    15921764
    15931765
     1766
    15941767) ;; end template declarations
    15951768     
Note: See TracChangeset for help on using the changeset viewer.