myMode = SimulationMode.DEFAULT;
mySupportedModes = new SimulationMode[]{SimulationMode.DEFAULT, SimulationMode.RATE, SimulationMode.CONSTANT_RATE};
}
private Function getSteadyStateVmFunction() {
CurveFitter fitter = new LinearCurveFitter();
float[] current = new float[]{0f, .25f, .5f, .75f, 1f, 1.25f, 1.5f, 1.75f, 2f, 2.25f, 2.5f, 2.75f, 3f, 3.5f, 4f, 5f, 6f, 8f, 10f, 15f, 20f, 30f, 40f, 50f, 60f};
float[] Vm = new float[current.length];
float[] rt = new float[current.length];
for (int i = 0; i < current.length; i++) {
TimeSeries input = new TimeSeriesImpl(new float[]{0, 0.5f},
new float[][]{new float[]{current[i], 1.0f}, new float[]{current[i], 1.0f}}, new Units[]{Units.uAcm2, Units.UNK});
TimeSeries output = myIntegrator.integrate(myDynamics, input);
Vm[i] = output.getValues()[output.getValues().length - 1][0];
reset(false);
// Plotter.plot(output, "simulation "+i);
rt[i] = getRefreactoryTime(Vm[i]);
}
Function result = fitter.fit(current, Vm);
// Plotter.plot(result, 0, .1f, 60, "current -> Vm");
// Plotter.plot(current, rt, "current -> rt");
return result;
}