* {@link org.apache.commons.math3.ode.events.EventHandler#g(double, double[])
* EventHandler.g(double, double[])}.
*/
public void test(int eventType) {
double e = 1e-15;
FirstOrderIntegrator integrator = new DormandPrince853Integrator(e, 100.0, 1e-7, 1e-7);
BaseSecantSolver rootSolver = new PegasusSolver(e, e);
EventHandler evt1 = new Event(0, eventType);
EventHandler evt2 = new Event(1, eventType);
integrator.addEventHandler(evt1, 0.1, e, 999, rootSolver);
integrator.addEventHandler(evt2, 0.1, e, 999, rootSolver);
double t = 0.0;
double tEnd = 10.0;
double[] y = {0.0, 0.0};
List<Double> events1 = new ArrayList<Double>();
List<Double> events2 = new ArrayList<Double>();
while (t < tEnd) {
t = integrator.integrate(this, t, y, tEnd, y);
//System.out.println("t=" + t + ",\t\ty=[" + y[0] + "," + y[1] + "]");
if (y[0] >= 1.0) {
y[0] = 0.0;
events1.add(t);