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

Re: [Orekit Users] My EventDetector class can't correct detecting event?



beowulf zhang <beowulf.zhang@gmail.com> a écrit :

I write a class CWAxisYDetector derived from AbstractDetector, the code is:

public class CWAxisYDetector extends AbstractDetector {

	private LocalOrbitalFrame locOrbFrm;

	private AbsoluteDate initDate;

	protected CWAxisYDetector(Orbit targOrb, LocalOrbitalFrame lof,
AbsoluteDate iDate) {
		super(targOrb.getKeplerianPeriod() / 3, 1.0e-13 *
targOrb.getKeplerianPeriod());
		this.locOrbFrm = lof;
		this.initDate = iDate;
	}

	public int eventOccurred(SpacecraftState s, boolean increasing)
			throws OrekitException {
		System.out.println(s.getDate().durationFrom(initDate));
		return CONTINUE;
	}

	public double g(SpacecraftState s) throws OrekitException {
		return s.getPVCoordinates(locOrbFrm).getPosition().getX();
	}

If the local orbital frame here is linked to the same spacecraft whose orbit is propagated, then s.getPVCoordinates(locOrbFrm).getPosition().getX() should always be 0 (as well as Y and Z since the spacecraft defines the origin of this frame). So the function is essentially an observation of numerical errors in interpolation polynomials, it is not a function that clearly crosses the zero axis at one precise time.

Are you sure about the frame ? Shouldn't it be related to another spacecraft (for relative motion observation for example) ?

Luc


}

but this class can't correct detecting event, and in some integrate
step getinig error information:

Exception in thread "main"
org.apache.commons.math.MathRuntimeException$4: function values at
endpoints do not have different signs.  Endpoints: [0.539, 0.539],
Values: [0, 0]
at org.apache.commons.math.MathRuntimeException.createIllegalArgumentException(MathRuntimeException.java:305) at org.apache.commons.math.analysis.solvers.BrentSolver.solve(BrentSolver.java:219) at org.apache.commons.math.ode.events.EventState.evaluateStep(EventState.java:229) at org.apache.commons.math.ode.events.CombinedEventsManager.evaluateStep(CombinedEventsManager.java:152) at org.apache.commons.math.ode.nonstiff.RungeKuttaIntegrator.integrate(RungeKuttaIntegrator.java:172) at org.orekit.propagation.numerical.NumericalPropagator.propagate(NumericalPropagator.java:419)
	at fr.cs.examples.propagation.SlaveMode.main(SlaveMode.java:136)

why?





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