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 » Fri Nov 22, 2013 11:08 am

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: 5169
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Equation behind Function Table

Post by ted » Fri Nov 22, 2013 12:43 pm

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 » Mon Jul 28, 2014 4:23 pm

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 » Tue Jul 29, 2014 12:41 pm

When the value is out of the TABLE range, it evaluates the nearest point.

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

Re: Equation behind Function Table

Post by ted » Tue Jul 29, 2014 1:41 pm

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

Post Reply