Package ca.nengo.math

Examples of ca.nengo.math.RootFinder


   * @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;
    }
  }
View Full Code Here

TOP

Related Classes of ca.nengo.math.RootFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.