Hi,
I wrote a simple HH neuron with sinusoid current. I think this may be useful for beginner.
HOC code:
load_file("nrngui.hoc")
create soma
access soma
soma {
L=10
diam=10
Ra=123
insert nad
insert leak
insert kad
}
tstop=500
objref stim
soma stim= new IClampSin(0.5)
stim.del=100
stim.dur=300
stim.freq=15
stim.amp=0.1
stim.phase=0
xpanel("Sinus current")
xvalue("Delay", "stim.del")
xvalue("Duration", "stim.dur")
xvalue("Amplitude", "stim.amp")
xvalue("Frequency", "stim.freq")
xvalue("Phases", "stim.phase")
xpanel()
xpanel("Control")
xbutton("Run","run()")
xbutton("Init","stdinit()")
xpanel()
objref g1
g1=new Graph()
addplot(g1,0)
g1.size(0,tstop,-100,60)
g1.addvar("soma.v(0.5)",1,1,0.6,0.9,2)
objref g
g=new Graph()
addplot(g,0)
g.size(0,tstop,-1,1)
g.addvar("stim.i",1,1,0.6,0.9,2)
NMODL K+ current:
NEURON{
SUFFIX kad
USEION k READ ek WRITE ik
RANGE gkbar, ik
}
UNITS{
(S)=(siemens)
(mV)=(millivolt)
(mA)=(milliamp)
}
PARAMETER{gkbar=0.036 (S/cm2)}
ASSIGNED{
v (mV)
ek (mV) : typically ~ -70
ik (mA/cm2)
}
STATE{n}
BREAKPOINT{
SOLVE states METHOD cnexp
ik=gkbar*n^4*(v-ek)
}
INITIAL{
n=alpha(v)/(alpha(v)+beta(v))
}
DERIVATIVE states{
n'=(1-n)*alpha(v)-n*beta(v)
}
FUNCTION alpha(Vm (mV)) (/ms){
UNITSOFF
alpha=(0.01*((-65-Vm)+10))/(exp(((-65-Vm)+10)/10)-1)
UNITSON
}
FUNCTION beta(Vm (mV)) (/ms){
UNITSOFF
beta=0.125*exp((-65-Vm)/80)
UNITSON
}
NMODL for Na+ current:
NEURON{
SUFFIX nad
USEION na READ ena WRITE ina
RANGE gnabar, ina
}
UNITS {
(S) = (siemens)
(mV) = (millivolt)
(mA) = (milliamp)
}
PARAMETER{ gnabar=0.12 (S/cm2)}
ASSIGNED{
v (mV)
ena (mV) : typically ~ +55
ina (mA/cm2)
}
STATE { m h}
BREAKPOINT{
SOLVE states METHOD cnexp
ina=gnabar*m^3*h*(v-ena)
}
INITIAL{
m=alpham(v)/(alpham(v)+betam(v))
h=alphah(v)/(alphah(v)+betah(v))
}
DERIVATIVE states{
m'=alpham(v)*(1-m)-m*betam(v)
h'=alphah(v)*(1-h)-betah(v)*h
}
FUNCTION alpham(Vm (mV)) (/ms){
UNITSOFF
alpham=(0.1*(-65-Vm+25))/(exp((-65-Vm+25)/10)-1)
UNITSON
}
FUNCTION betam(Vm (mV)) (/ms){
UNITSOFF
betam=4*exp((-65-Vm)/18)
UNITSON
}
FUNCTION alphah(Vm (mV)) (/ms){
UNITSOFF
alphah=0.07*exp((-65-Vm)/20)
UNITSON
}
FUNCTION betah(Vm (mV)) (/ms){
UNITSOFF
betah=1/(exp((-65-Vm+30)/10)+1)
UNITSON
}
NMODL for leak current:
: a passive leak current
NEURON{
SUFFIX leak
NONSPECIFIC_CURRENT i
RANGE i,e,g
}
PARAMETER{
g=0.001 (siemens/cm2) <0, 1e9>
e=-65 (millivolt)
}
ASSIGNED{
i (milliamp/cm2)
v (millivolt)
}
BREAKPOINT{ i=g*(v-e)}
NMODL for Sinusoid IClamp:
:Sinusoid current clamp
NEURON{
POINT_PROCESS IClampSin
RANGE del, dur, amp, freq, phase, bias
ELECTRODE_CURRENT i
}
UNITS {
(nA) = (nanoamp)
}
PARAMETER {
del=5 (ms)
dur=200 (ms)
amp=1 (nA)
freq=1 (Hz)
phase=0 (rad)
bias=0 (nA)
PI=3.14159265358979323846
}
ASSIGNED {
i (nA)
}
BREAKPOINT {
at_time(del)
at_time(del+dur)
if (t < del+dur && t>del) {
i = amp*sin(2*PI*freq*(t-del)/1000+phase)+bias
}else{
i = 0}
}
Try it and play. You will get bursting activity in some sin. amp and frequency.
Best,
Kazmer
simple HH neuron with sinusoid trigger current
The basics of how to develop, test, and use models.
Jump to
- The NEURON Forum
- ↳ Goals and Policies
- ↳ Suggestions and Feedback
- ↳ NEURON Announcements
- NEURON installation and configuration
- ↳ OS X
- ↳ MSWin
- ↳ UNIX/Linux
- NEURON design
- ↳ NEURON + Python
- ↳ Reaction-diffusion in NEURON
- Making and using models with NEURON
- ↳ NEURON hacks
- ↳ Hot tips
- ↳ Getting started
- ↳ The GUI
- ↳ Anatomically detailed models
- ↳ Adding new mechanisms and functions to NEURON
- ↳ Modeling networks
- ↳ Optimization
- ↳ Parallel NEURON
- ↳ Other questions
- Tools of interest to NEURON users
- ↳ HNN: Human Neocortical Neurosolver
- ↳ LFPsim
- ↳ NetPyNE
- ↳ SimAgent
- ↳ SimTracker
- ↳ Other tools
- NEURON in neuroscience education
- ↳ From Computer to Brain
- ↳ Neurons in Action
- ↳ SWIMMY
- ↳ Other ways of using NEURON in neuroscience education
- Data sharing
- ↳ ModelDB and other online sources of models
- ↳ Specific models
- ↳ Policies and procedures
- Computational neuroscience in general
- ↳ General questions and discussions about computational neuroscience
- ↳ Employment and educational opportunities