org.orekit.propagation.events
Class NullMassPartDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by org.orekit.propagation.events.NullMassPartDetector
All Implemented Interfaces:
Serializable, EventDetector

public class NullMassPartDetector
extends AbstractDetector
implements EventDetector

This class creates an event detector that detects when the mass of the element becomes null. This detector is automatically added (through the continuous thrust) to every propagator and throws a reset_derivatives (because the thrust became null) once it detects a null mass and the mass is set to exactly zero. Since the initial mass of the part is positive or null, the first time where g = 0 will indicate the first time when the mass becomes null.

Since:
2.3
Version:
$Id: NullMassPartDetector.java 14874 2015-12-03 16:15:28Z bignon $
Author:
Sophie LAURENS
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
NullMassPartDetector(double maxCheck, double threshold, MassProvider massModel, String part)
          Inherited constructor.
NullMassPartDetector(int slopeSelection, double maxCheck, double threshold, MassProvider massModel, String part)
          Inherited constructor.
NullMassPartDetector(MassProvider massModel, String part)
          Build a new instance MaxCheck is set to 10.e9, so almost no other date can be added.
 
Method Summary
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          If the mass of the element becomes negative, a reset_state is performed.
 double g(SpacecraftState s)
          Compute the value of the switching function.
 String getPartName()
          Get the name of the part (attribute).
 SpacecraftState resetState(SpacecraftState oldState)
          Reset the state (including additional states) prior to continue propagation.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.orekit.propagation.events.EventDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init
 

Constructor Detail

NullMassPartDetector

public NullMassPartDetector(double maxCheck,
                            double threshold,
                            MassProvider massModel,
                            String part)
Inherited constructor.

Parameters:
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
massModel - mass model
part - name of the part

NullMassPartDetector

public NullMassPartDetector(int slopeSelection,
                            double maxCheck,
                            double threshold,
                            MassProvider massModel,
                            String part)
Inherited constructor.

Parameters:
slopeSelection - g-function slope selection (0, 1, or 2)
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
massModel - mass model
part - name of the part

NullMassPartDetector

public NullMassPartDetector(MassProvider massModel,
                            String part)
Build a new instance MaxCheck is set to 10.e9, so almost no other date can be added. Tolerance is set to 10.e-10.

Parameters:
massModel - mass model
part - name of the part
Method Detail

resetState

public SpacecraftState resetState(SpacecraftState oldState)
                           throws OrekitException
Reset the state (including additional states) prior to continue propagation. This method is called after if the mass becomes negative or null : in that case, the mass of the part is set to zero, and this has to be reset in the spacecraftstate

Specified by:
resetState in interface EventDetector
Overrides:
resetState in class AbstractDetector
Parameters:
oldState - the current SpacecraftState whose MassProvider has to be updated
Returns:
SpacecraftState
Throws:
OrekitException - if mass is negative : bcs function updateMass

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
If the mass of the element becomes negative, a reset_state is performed.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information : date, kinematics, attitude
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
forward - if true, the integration variable (time) increases during integration.
Returns:
EventDetector.Action.RESET_DERIVATIVES

shouldBeRemoved

public boolean shouldBeRemoved()
Description copied from class: AbstractDetector
This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the current detector should be removed after first event detection. WARNING: this method can be called only once a event has been triggered. Before, the value is not available.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection

g

public double g(SpacecraftState s)
         throws OrekitException
Compute the value of the switching function.

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

getPartName

public String getPartName()
Get the name of the part (attribute).

Returns:
partName String : name of the part.


Copyright © 2016 CNES. All Rights Reserved.