normrand()

NMODL and the Channel Builder.
Post Reply
okanerkaymaz

normrand()

Post by okanerkaymaz »

Hi. Friends

my problem is generator random number however i can't this process
you think is there any way that proccess?

Dear Raj wrote me it that was normrand(0, sqrt(gn()))

i used to like folowing code :

FUNCTION varn() {
UNITSOFF
varm=(2/NaSingle)*(malpha(v)*mbeta(v))/(malpha(v)+mbeta(v))
UNITSON
}
FUNCTION gn() (/ms) {
UNITSOFF
gn=normrand(0,sqrt(varn()))
UNITSON
}

what can i do that code ?

i don't find expect variable (:( )
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

I think it is better if you return to the previous topic https://www.neuron.yale.edu/phpBB2/view ... ight=#1446 and try to indicate what is wrong with the mod code proposed there.


How did you test it? (Give your hoc-code, not that for production, but just your test code.)
What were the error messages?
What did you do further to analyze the problem?

etc. etc.
okanerkaymaz

Post by okanerkaymaz »

thanks you very much RAj
my code is folowing

Code: Select all

NEURON { 
POINT_PROCESS FOXLU
USEION k READ ek WRITE ik 
USEION na READ ena WRITE ina
 
RANGE gk_single, KSingle ,n
RANGE gNabar, NaSingle, m, h, Area
} 

UNITS { 
(S) = (siemens) 
(mV) = (millivolt) 
(mA) = (milliamp) 
} 

PARAMETER { 
gk_single = 0.036 (S/cm2) : Single channel conductance (here a 
: fantasy value at present) reasonable 
: value is needed here. 

gNabar = .12 (mho/cm2)
        ena = 50 (mV)
        ek = -77.5 (mV)
        gl = .0003 (mho/cm2)
        el = -54.3 (mV)
KSingle = 18 (1) : The number of potassium channels 
NaSingle=60 
Area = 10  (um2) // i can change this value  

} 

ASSIGNED { 
v (mV) 

ik (mA/cm2) 
ina (mV) 
} 

STATE { 
m h n
} 

BREAKPOINT { 
SOLVE states METHOD cnexp 
ik = gk_single* KSingle*Area* n^4 * (v - ek) 
ina=NaSingle*Area*gNabar*(m^3*h)*(v-ena) 

} 

INITIAL { 
: Assume v has been constant for a long time 
n = alpha(v)/(alpha(v) + beta(v)) 
m = malpha(v)/(malpha(v)+mbeta(v)) 
h = halpha(v)/(halpha(v)+hbeta(v)) 
} 

DERIVATIVE states { 
: Computes state variable n at present v & t 

n' = (1-n)*alpha(v) - n*beta(v)+gn() 
m' = (malpha(v)*(1-m))-(mbeta(v)*m)+gm() 
h' = (halpha(v)*(1-h))-(hbeta(v)*h) +gh()
} 

FUNCTION alpha(Vm (mV)) (/ms) { 
LOCAL x 
UNITSOFF 
x = (Vm+55)/10 
if (fabs(x) > 1e-6) { 
alpha = 0.1*x/(1 - exp(-x)) 



i had compiled folu.mod file and after i inserted FOXLU in point proccess menu and i can run my code
however i don't get wanted result in other words i can't do stochastic hh (fox-lu )

my idea is creating spike for difference time (ms) however it didn't become

Dear Raj can you test for me that foxlu.mod file
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Unfortunately testing the mod-code is a little project. So to move you forward a few tips. Executing them will take a fair amount of time. If you are very fast a couple of days but a few weeks is probably more realistic.

Test the code I wrote first, without making modifications to include sodium channels:
  • First determine what you expect the mechanism does under voltage clamp steps with:
    • state variables
    • current
  • Insert the mechanism into a section.
  • Attach a voltage clamp mechanism to it and bring up graphs to see how state variables and the current respond.
One thing that probably needs to be fixed is the dependence of the noise on the time step, so read the original paper and/or write the authors to find out how this should be done. It is considered not done these days to write new mechanisms in mod that explicitly depend on the timestep size (as they are dangerous when used in variable timestep integration) but you probably need it here.

Once you are convinced the mechanism is doing what it should, you should create a similar mechanism for the sodium channels, and test this mechanism separately using the same methods.

For all these tests it would be best if there are results available that you can reproduce. Examples that I can imagine but are not necessarily realistic:
  • Limits in which you should find back ordinary HH behavior,
  • Results obtained with the algorhythm elsewhere.
Side remark: Your posting contained several errors, I saw C-style comments (//) and also code blocks without closing brackets. A good editor with syntax highlighting might prevent you from making or help you find such small but fatal errors. You can find information on this among the hot tips.
Post Reply