commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Calle>
Subject [math] Problem with ODE discrete event
Date Mon, 24 Mar 2014 16:28:00 GMT
When using the event handler in the ODE solver I’m getting the error message/exception

"Exception in thread "main" org.apache.commons.math3.exception.NoBracketingException: function
values at endpoints do not have different signs, endpoints: [692,555, 692,556], values: [-0,

What could be the cause of this? My g switching function:

    public double g(double t, double[] y) {

        for(int i=0; i < y.length/6; i++) {
            double norm = Math.sqrt(y[6*i]*y[6*i]+y[6*i+1]*y[6*i+1]+y[6*i+2]*y[6*i+2]);
            if(norm-distanceThreshold < minDistance) minDistance = norm-distanceThreshold;


        return minDistance;

The result of System.out.println(minDistance) does include a sign switch:


However instead of triggering eventOccurred it throws the exception.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message