Package ca.nengo.util

Examples of ca.nengo.util.InterpolatorND


    TimeSeries result = integrator.integrate(system, input);
   
    assertTrue(result.getTimes().length < 60);
   
    //check results against selected hard-coded values from matlab solution ...
    InterpolatorND interpolator = new LinearInterpolatorND(result);
    float tolerance = 0.005f;
    float[] time2 = interpolator.interpolate(2);
    TestUtil.assertClose(time2[0], 0.053f, tolerance);
    TestUtil.assertClose(time2[1], -0.157f, tolerance);
    float[] time5 = interpolator.interpolate(5);
    TestUtil.assertClose(time5[0], -0.128f, tolerance);
    TestUtil.assertClose(time5[1], 0.223f, tolerance);
    float[] time8 = interpolator.interpolate(8);
    TestUtil.assertClose(time8[0], 0.257f, tolerance);
    TestUtil.assertClose(time8[1], -0.297f, tolerance);
   
//    Plotter.plot(result, "Van der Pol Oscillator");
  }
View Full Code Here

TOP

Related Classes of ca.nengo.util.InterpolatorND

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.