Equation calculator: External Data
A stand-alone non-modal equation calculator is available, using the same syntax as that used for equations elsewhere in DataView. The facility can act as a simple within-program calculator, or as a testbed for developing and testing complex equations.
- Select the Analyse: External data: Equation calculator menu command to open the Equation calculator dialog. This is available even if no data file is loaded into the main program.
- Copy-and-paste the equation below into the Equation edit box in the dialog.
-0.01 * (x + 60)/(exp((x + 60)/-10) - 1)
This equation is the one used by Hodgkin and Huxley (1952) to describeThe numerical constants in the equation have been updated to use the modern convention for membrane potential values. the voltage-dependency of the α transition rate constant for the activation gates of the potassium channel, where x is the membrane potential. The Result 0.611 is the value of the expression with the default x value of 1, as shown at the top of the parameter list on the left.
- Set x to -70 (a typical resting potential value) and note the change in the Result to 0.058.
- The Result is much lower than it was at the previous x value of -1, indicating that there is a lower rate of activation gates opening at the more hyperpolarized membrane potential.
- Now set x to -60.
- The equation parser generates a divide-by-zero error, because the x + 60 part of the equation generates 0, and exp(0) is 1, and 1-1 is 0, hence the error.
- Edit the equation text to replace the two occurrences of the numeric constant 60 with the parameter symbol a.
- Note that parameter a has a value of 1, so the equation is recalcuated using 1 in the two places where it previously had 60. It no longer generates an error.
- Change parameter a to 60. As should be expected, we are back with an error.
- Change parameter a to 60.001. The slight offset removes the singularity error.
- This is common "fudge" used in neural simulations to make the error less likely.
Including a symbolic constant is useful if that constant occurs in several places within the equation. Then editing its value in one place (the parameter list) changes its value simultaneously in all the occurrences within the equation. The alternative is to hand edit the equation, which is more tedious and error prone.
Re-evaluate expression
- Type "rndn()" into the Equation box to change its contents.
- This generates a standard normal random variable (i.e. one drawn from a population with mean = 0, s.d. = 1) as the Result. Of course, since it's a random number, the value cannot be predicted, although given the s.d. it is unlikely to have a large absolute value.
- Click the Calc button to generate another random number.
- The equation is automatically re-evaluated whenever the equation itself or one of its parameter changes value. However, if you want to generate a new random number without changing anything else, this is the best method.
Decimal places
- Type the symbolic constant "_pi" into the Equation box.
- This evaluates to the value of π, which shows in the Result as 3.142.
- Enter 6 into the n dec edit box.
- The Result now shows 3.141593. The full stored value of π used in calculations in DataView is 3.141592653589793238462643.