pacemaker
Class MaSModel

java.lang.Object
  extended by pacemaker.MaSModel

public class MaSModel
extends java.lang.Object

Useful static code related to Phase Response Curve (PRC) related to "MAS" model (Mirollo and Strogatz 1990).

PRC is a function in the x,y-plane (in the square (0,0)-(1,1)) that shows the relation between:

  1. the phase (the moment during the period)
  2. the amount of eccitation accumulated (eccitation increases during the period, when it reach the threshold, the firefly emits a flash)

(threshold is at value 1,1)

The function will be the classic

f(x)=1/b*log(1+x*(exp(b)-1)) (Mirollo and Strogatz 1990, Fig. 1)

that is a monotonic increasing, concave-down function moving from (0,0) to (1,1).

The parameter named 'b' influences the shape of the PRC in the plane. (see Mirollo and Strogatz 1990, Fig. 3).

b must be in the range ]0,+inf] for the definition of f(x). When b approaches 0, f(x) resembles the identity function (y=x). But when b exactly =0, the function shape degenerates cause of mathematical infinites, although reasonably she should fit exacly the identity. We overcome it in this implementation: when you supply b=0 we will substitute the above f(x) with identity f(x)=x.


Constructor Summary
MaSModel()
           
 
Method Summary
static double eval_inverse_PRC(double y, int b)
          Evaluate the inverse function f-1 of the PRC: given the y value, you get the x value (the phase).
static double eval_PRC(double phase, int b)
          Evaluates the PRC for the given phase (x).
static void main(java.lang.String[] args)
          For testing purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaSModel

public MaSModel()
Method Detail

eval_PRC

public static double eval_PRC(double phase,
                              int b)
Evaluates the PRC for the given phase (x).

  1. f(x)=x if b=0.

  2. f(x)=1/b*log(1+x*(exp(b)-1)) if b=0.

Parameters:
phase - - the phase (x value) proportional to period. In range [0,1]. If longer than the actual period, is beyond the f(x) definition. In this case, always 1 is returned (and in implementation, this will probably trigger the execution of a flash immediately)
Returns:
PRC evaluation (y value): in range [0,1].

eval_inverse_PRC

public static double eval_inverse_PRC(double y,
                                      int b)
Evaluate the inverse function f-1 of the PRC: given the y value, you get the x value (the phase).

eval_prc(double, int)

Parameters:
y - - y value, in range [0,1]
Returns:
x value - the phase. In range [0,1].

main

public static void main(java.lang.String[] args)
For testing purposes