org.apache.commons.math.ode.events.CombinedEventsManager Java Examples

The following examples show how to use org.apache.commons.math.ode.events.CombinedEventsManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #2
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #3
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #4
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #5
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #6
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #7
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #8
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #9
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #10
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #11
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #12
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               FastMath.ulp(FastMath.max(FastMath.abs(startTime), FastMath.abs(endTime))),
                               100);
    return newManager;
}
 
Example #13
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/** Add an event handler for end time checking.
 * <p>This method can be used to simplify handling of integration end time.
 * It leverages the nominal stop condition with the exceptional stop
 * conditions.</p>
 * @param startTime integration start time
 * @param endTime desired end time
 * @param manager manager containing the user-defined handlers
 * @return a new manager containing all the user-defined handlers plus a
 * dedicated manager triggering a stop event at entTime
 */
protected CombinedEventsManager addEndTimeChecker(final double startTime,
                                                  final double endTime,
                                                  final CombinedEventsManager manager) {
    CombinedEventsManager newManager = new CombinedEventsManager();
    for (final EventState state : manager.getEventsStates()) {
        newManager.addEventHandler(state.getEventHandler(),
                                   state.getMaxCheckInterval(),
                                   state.getConvergence(),
                                   state.getMaxIterationCount());
    }
    newManager.addEventHandler(new EndTimeChecker(endTime),
                               Double.POSITIVE_INFINITY,
                               Math.ulp(Math.max(Math.abs(startTime), Math.abs(endTime))),
                               100);
    return newManager;
}
 
Example #14
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #15
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #16
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #17
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #18
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #19
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #20
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #21
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #22
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #23
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #24
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #25
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}
 
Example #26
Source File: AbstractIntegrator.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/** Build an instance.
 * @param name name of the method
 */
public AbstractIntegrator(final String name) {
    this.name = name;
    stepHandlers = new ArrayList<StepHandler>();
    stepStart = Double.NaN;
    stepSize  = Double.NaN;
    eventsHandlersManager = new CombinedEventsManager();
    setMaxEvaluations(-1);
    resetEvaluations();
}