Equation behind Function Table

Particularly useful chunks of hoc and/or NMODL code. May be pedestrian or stunningly brilliant, may make you gasp or bring tears to your eyes, but always makes you think "I wish I had written that; I'm sure going to steal it."
Post Reply
figoyouwei
Posts: 41
Joined: Sun Aug 08, 2010 11:09 am

Equation behind Function Table

Post by figoyouwei »

Hi,

I am aware that Function Table works when one gives e.g. an array of voltage and an array of variable value.

I want to know what is the linear fit equation behind that ? Basically I don't want to use such Function Table thing, instead just define a function inside the mod file. How I can do that ?

Thanks.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Equation behind Function Table

Post by ted »

Example:

Code: Select all

FUNCTION myfunc(z) {
   myfunc = cosh(z)
}
figoyouwei
Posts: 41
Joined: Sun Aug 08, 2010 11:09 am

Re: Equation behind Function Table

Post by figoyouwei »

thank you Ted, yeah , FUNCTION works.

A deeper question:

when a FUNCTION_TABLE is provided, e.g. FUNCTION_TABLE var (v(mV)), if the values of voltage v in the provided table range only from -30 to 50, then what happens to NEURON evaluation when the voltage is below -30 ? Does it take the value for -30 at all other voltage values ?
figoyouwei
Posts: 41
Joined: Sun Aug 08, 2010 11:09 am

Re: Equation behind Function Table

Post by figoyouwei »

When the value is out of the TABLE range, it evaluates the nearest point.
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Equation behind Function Table

Post by ted »

Yes, sometimes the quickest and easiest way to answer a question is to run a test.
Post Reply