* @param I driving current
* @return Adapted firing rate given this current
*/
public float getAdaptedRate(final float I) {
if (I > 1) {
RootFinder rf = new NewtonRootFinder(50, false);
Function f = new AbstractFunction(1) {
private static final long serialVersionUID = 1L;
public float map(float[] from) {
float r = from[0];
return r - 1 / (myTauRef - myTauRC * (float) Math.log(1f - 1f/(I-G_N*myIncN*myTauN*r)));
}
};
float max = (I-1) / (G_N * myIncN * myTauN); //will be NaN if current < 1
return rf.findRoot(f, 0, max, 0.1f);
} else {
return 0;
}
}