next up previous contents
Next: The Table Properties. Up: Tabulated Calculations Previous: Tabulated Calculations   Contents


The calc_mode field.

Genesis makes extensive use of precomputed tables to model conductance that depend on the membrane potential. The tabchannel element is an example. The tables are a simple discretization along the V-axis of the function they model, so they 'export' a set of $ (V_i,y_i)$ tuples, $ V_i = \mathrm{V_0} + i \cdot \Delta\mathrm{V}$, $ 0 \leq i \leq
\mathrm{N}$. Since the membrane potential $ V$ is a computed variable, there is no guarantee that it will be equal to one of the $ V_i$'s at any point in simulation time. The tabulated elements in Genesis know about two basic modes of calculating a value $ y$ for a given value $ V$:

  1. Truncation: for a given value $ V$, $ V_i \leq V < V_{i+1}$, the value $ y_i$ is returned. Since the value $ y_i$ is directly stored in the table, no additional calculations have to be performed.
  2. Linear interpolation: for a given value $ V$, $ V_i \leq V < V_{i+1}$, the value $ y = y_i + (V - V_i) \cdot \frac{(y_{i+1} - y_i)}
{(V_{i+1} - V_i)}$ is returned. The value $ y$ is the result of a linear interpolation between two tuples stored in the table.

The distinction between these two modes of operation is made by the calc_mode field. If this field is set to $ 1$, linear interpolation is used, if the field is set to 0, truncation is used.

For most tabulated elements of genesis the calc_mode field is found in the interpol structs that reside in the element fields. However hsolve has its own calcmode field - note the small difference in name - which is applied to all tabulated calculations. The granularity provided by the Genesis elements is much higher than provided by hsolve. That is why you always have to set the field manually.





NOTE: Never forget to set the calcmode field and to check if it is equal to the calculation mode of all tabulated elements. If you don't, your results will be almost right, but not exactly.






next up previous contents
Next: The Table Properties. Up: Tabulated Calculations Previous: Tabulated Calculations   Contents
2002-11-15