[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Developers] Error in eventdetector / BrentSolver?



Petrus Hyvönen <petrus.hyvonen@gmail.com> a écrit :

Hi Luc,

Many thanks for your prompt reply. I added your proposed changes but seems
like the problem still is there,

    Java stacktrace:
org.orekit.errors.PropagationException: function values at endpoints do not
have different signs, endpoints: [0, 119,999], values: [-0, -0,017]
at
org.orekit.errors.PropagationException.unwrap(PropagationException.java:108)
at
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:185)
at
org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:256)
Caused by: org.apache.commons.math3.exception.NoBracketingException:
function values at endpoints do not have different signs, endpoints: [0,
119,999], values: [-0, -0,017]
at
org.apache.commons.math3.analysis.solvers.BracketingNthOrderBrentSolver.doSolve(BracketingNthOrderBrentSolver.java:193)
at
org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve(BaseAbstractUnivariateSolver.java:196)
at
org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve(BaseAbstractUnivariateSolver.java:201)
at
org.orekit.propagation.events.EventState.evaluateStep(EventState.java:213)
at
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(AbstractAnalyticalPropagator.java:278)
at
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:169)
... 1 more


The problematic scenario remained problematic and the non problematic
scenario remained working (different location for the elevationdetector
location, groundstation).

OK. Can you trim down the problem to a simple test case and open an issue in the tracker with data to reproduce it? Since it is based on a simple analytical propagator, I guess it would not be too complex to set up.

best regards,
Luc


Best Regards
/Petrus





On Wed, May 15, 2013 at 2:51 PM, Luc Maisonobe <Luc.Maisonobe@c-s.fr> wrote:

Le 15/05/2013 13:57, Petrus Hyvönen a écrit :
> Hi,

Hi Petrus,

>
> I haven't been able to trace this error down to it's details, so sorry
> for not proving an short error example (yet). I'm propagating an SSO
> orbit (EcksteinHeckler) with an event detector on node and one on
> elevation. For some scenarios this runs completely fine, but some other
> configurations I get an error. Changing parameters on eventdetector
> threshold and maxcheck seems to solve it sometimes.
>
> I am using orekit 6.0 + apache math 3.2 (wrapped and ran via python).
>
> My impression is that this is something related to the BrentSolver in
> math. I've found this solved issue:
>
https://issues.apache.org/jira/browse/MATH-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>
> Any experiences wtih this?

It has been a long time since it last happened. I'm not sure it is
related to MATH-344, there have been numerous changes in this area since
that time.

I think we forgot to update the detection in the Orekit specialized
EventState class which is used by analytical propagators (numerical
propagators rely on the Apache Commons Math class, which has been
slightly changed here. In particular, we do not use the bracketing
solver, but still use an unbracketing Brent solver, with an additional
bracketing pegasus solver to fine tune a posteriori the convergence.

Could you look if the following changes improve the situation for you?
In Orekit EventState, replace :

 final BrentSolver nonBracketing = new BrentSolver(convergence);
 final PegasusSolver bracketing  = new PegasusSolver(convergence);

with

 final BracketedUnivariateSolver<UnivariateFunction> bracketing =
   new new BracketingNthOrderBrentSolver(convergence, 5);

and also replace :

final double dtBaseRoot = forward ?
          nonBracketing.solve(maxIterationcount, f, dtA, dtB) :
          nonBracketing.solve(maxIterationcount, f, dtB, dtA);
final int remainingEval = maxIterationcount -
                          nonBracketing.getEvaluations();
final double dtRoot     = forward ?
   UnivariateSolverUtils.forceSide(remainingEval, f, bracketing,
                                   dtBaseRoot, dtA, dtB,
                                   AllowedSolution.RIGHT_SIDE) :
   UnivariateSolverUtils.forceSide(remainingEval, f, bracketing,
                                   dtBaseRoot, dtB, dtA,
                                   AllowedSolution.LEFT_SIDE);

with
final double dtRoot     = forward ?
    bracketing.solve(maxIterationcount, f, dtA, dtB) :
    bracketing.solve(maxIterationcount, f, dtB, dtA);

best regards,
Luc

>
> Many thanks & Best Regards
> /Petrus
>
>
>
> JavaError: org.orekit.errors.PropagationException: function values at
> endpoints do not have different signs, endpoints: [9, 119,986], values:
> [-0, -0,033]
>
> Java stacktrace:
>
> org.orekit.errors.PropagationException: function values at endpoints do
> not have different signs, endpoints: [9, 119,986], values: [-0, -0,033]
>
> at
>
org.orekit.errors.PropagationException.unwrap(PropagationException.java:108)
>
> at
>
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:185)
>
> at
>
org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:256)
>
> Caused by: org.apache.commons.math3.exception.NoBracketingException:
> function values at endpoints do not have different signs, endpoints: [9,
> 119,986], values: [-0, -0,033]
>
> at
>
org.apache.commons.math3.analysis.solvers.BrentSolver.doSolve(BrentSolver.java:123)
>
> at
>
org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve(BaseAbstractUnivariateSolver.java:196)
>
> at
>
org.apache.commons.math3.analysis.solvers.BaseAbstractUnivariateSolver.solve(BaseAbstractUnivariateSolver.java:201)
>
> at
>
org.orekit.propagation.events.EventState.evaluateStep(EventState.java:195)
>
> at
>
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(AbstractAnalyticalPropagator.java:278)
>
> at
>
org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:169)
>
> ... 1 more
>
> org.orekit.propagation.analytical.EcksteinHechlerPropagator
>
>
> --
> _____________________________________________
> Petrus Hyvönen, Uppsala, Sweden
> Mobile Phone/SMS:+46 73 803 19 00




--
_____________________________________________
Petrus Hyvönen, Uppsala, Sweden
Mobile Phone/SMS:+46 73 803 19 00




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.