| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>EventFilter (Apache Commons Math 3.3 API)</title> |
| <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="EventFilter (Apache Commons Math 3.3 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/EventFilter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/commons/math3/ode/events/EventFilter.html" target="_top">Frames</a></li> |
| <li><a href="EventFilter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.commons.math3.ode.events</div> |
| <h2 title="Class EventFilter" class="title">Class EventFilter</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.commons.math3.ode.events.EventFilter</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <span class="strong">EventFilter</span> |
| extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> |
| implements <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></pre> |
| <div class="block">Wrapper used to detect only increasing or decreasing events. |
| |
| <p>General <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>events</code></a> are defined implicitely |
| by a <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#g(double, double[])"><code>g function</code></a> crossing |
| zero. This function needs to be continuous in the event neighborhood, |
| and its sign must remain consistent between events. This implies that |
| during an ODE integration, events triggered are alternately events |
| for which the function increases from negative to positive values, |
| and events for which the function decreases from positive to |
| negative values. |
| </p> |
| |
| <p>Sometimes, users are only interested in one type of event (say |
| increasing events for example) and not in the other type. In these |
| cases, looking precisely for all events location and triggering |
| events that will later be ignored is a waste of computing time.</p> |
| |
| <p>Users can wrap a regular <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>event handler</code></a> in |
| an instance of this class and provide this wrapping instance to |
| the <a href="../../../../../../org/apache/commons/math3/ode/FirstOrderIntegrator.html" title="interface in org.apache.commons.math3.ode"><code>ODE solver</code></a> |
| in order to avoid wasting time looking for uninteresting events. |
| The wrapper will intercept the calls to the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#g(double, double[])"><code>g function</code></a> and to the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double, double[], boolean)"><code>eventOccurred</code></a> method in order to ignore uninteresting events. The |
| wrapped regular <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>event handler</code></a> will the see only |
| the interesting events, i.e. either only <code>increasing</code> events or |
| <code>decreasing</code> events. the number of calls to the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#g(double, double[])"><code>g function</code></a> will also be reduced.</p></div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>3.2</dd> |
| <dt><span class="strong">Version:</span></dt> |
| <dd>$Id: EventFilter.java 1458491 2013-03-19 20:13:11Z luc $</dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_class_summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_classes_inherited_from_class_org.apache.commons.math3.ode.events.EventHandler"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from interface org.apache.commons.math3.ode.events.<a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></h3> |
| <code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html" title="enum in org.apache.commons.math3.ode.events">EventHandler.Action</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../../../org/apache/commons/math3/ode/events/EventFilter.html#EventFilter(org.apache.commons.math3.ode.events.EventHandler, org.apache.commons.math3.ode.events.FilterType)">EventFilter</a></strong>(<a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a> rawHandler, |
| <a href="../../../../../../org/apache/commons/math3/ode/events/FilterType.html" title="enum in org.apache.commons.math3.ode.events">FilterType</a> filter)</code> |
| <div class="block">Wrap an <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>event handler</code></a>.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html" title="enum in org.apache.commons.math3.ode.events">EventHandler.Action</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/ode/events/EventFilter.html#eventOccurred(double, double[], boolean)">eventOccurred</a></strong>(double t, |
| double[] y, |
| boolean increasing)</code> |
| <div class="block">Handle an event and choose what to do next.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>double</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/ode/events/EventFilter.html#g(double, double[])">g</a></strong>(double t, |
| double[] y)</code> |
| <div class="block">Compute the value of the switching function.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/ode/events/EventFilter.html#init(double, double[], double)">init</a></strong>(double t0, |
| double[] y0, |
| double t)</code> |
| <div class="block">Initialize event handler at the start of an ODE integration.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/ode/events/EventFilter.html#resetState(double, double[])">resetState</a></strong>(double t, |
| double[] y)</code> |
| <div class="block">Reset the state prior to continue the integration.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="EventFilter(org.apache.commons.math3.ode.events.EventHandler, org.apache.commons.math3.ode.events.FilterType)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>EventFilter</h4> |
| <pre>public EventFilter(<a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a> rawHandler, |
| <a href="../../../../../../org/apache/commons/math3/ode/events/FilterType.html" title="enum in org.apache.commons.math3.ode.events">FilterType</a> filter)</pre> |
| <div class="block">Wrap an <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>event handler</code></a>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>rawHandler</code> - event handler to wrap</dd><dd><code>filter</code> - filter to use</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="init(double, double[], double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>init</h4> |
| <pre>public void init(double t0, |
| double[] y0, |
| double t)</pre> |
| <div class="block">Initialize event handler at the start of an ODE integration. |
| <p> |
| This method is called once at the start of the integration. It |
| may be used by the event handler to initialize some internal data |
| if needed. |
| </p></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#init(double, double[], double)">init</a></code> in interface <code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>t0</code> - start value of the independent <i>time</i> variable</dd><dd><code>y0</code> - array containing the start value of the state vector</dd><dd><code>t</code> - target time for the integration</dd></dl> |
| </li> |
| </ul> |
| <a name="g(double, double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>g</h4> |
| <pre>public double g(double t, |
| double[] y)</pre> |
| <div class="block">Compute the value of the switching function. |
| |
| <p>The discrete events are generated when the sign of this |
| switching function changes. The integrator will take care to change |
| the stepsize in such a way these events occur exactly at step boundaries. |
| The switching function must be continuous in its roots neighborhood |
| (but not necessarily smooth), as the integrator will need to find its |
| roots to locate precisely the events.</p> |
| <p>Also note that the integrator expect that once an event has occurred, |
| the sign of the switching function at the start of the next step (i.e. |
| just after the event) is the opposite of the sign just before the event. |
| This consistency between the steps <string>must</strong> be preserved, |
| otherwise <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception"><code>exceptions</code></a> related to root not being bracketed will occur.</p> |
| <p>This need for consistency is sometimes tricky to achieve. A typical |
| example is using an event to model a ball bouncing on the floor. The first |
| idea to represent this would be to have <code>g(t) = h(t)</code> where h is the |
| height above the floor at time <code>t</code>. When <code>g(t)</code> reaches 0, the |
| ball is on the floor, so it should bounce and the typical way to do this is |
| to reverse its vertical velocity. However, this would mean that before the |
| event <code>g(t)</code> was decreasing from positive values to 0, and after the |
| event <code>g(t)</code> would be increasing from 0 to positive values again. |
| Consistency is broken here! The solution here is to have <code>g(t) = sign |
| * h(t)</code>, where sign is a variable with initial value set to <code>+1</code>. Each |
| time <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double, double[], boolean)"><code>eventOccurred</code></a> is called, |
| <code>sign</code> is reset to <code>-sign</code>. This allows the <code>g(t)</code> |
| function to remain continuous (and even smooth) even across events, despite |
| <code>h(t)</code> is not. Basically, the event is used to <em>fold</em> <code>h(t)</code> |
| at bounce points, and <code>sign</code> is used to <em>unfold</em> it back, so the |
| solvers sees a <code>g(t)</code> function which behaves smoothly even across events.</p></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#g(double, double[])">g</a></code> in interface <code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>t</code> - current value of the independent <i>time</i> variable</dd><dd><code>y</code> - array containing the current value of the state vector</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>value of the g switching function</dd></dl> |
| </li> |
| </ul> |
| <a name="eventOccurred(double, double[], boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>eventOccurred</h4> |
| <pre>public <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html" title="enum in org.apache.commons.math3.ode.events">EventHandler.Action</a> eventOccurred(double t, |
| double[] y, |
| boolean increasing)</pre> |
| <div class="block">Handle an event and choose what to do next. |
| |
| <p>This method is called when the integrator has accepted a step |
| ending exactly on a sign change of the function, just <em>before</em> |
| the step handler itself is called (see below for scheduling). It |
| allows the user to update his internal data to acknowledge the fact |
| the event has been handled (for example setting a flag in the <a href="../../../../../../org/apache/commons/math3/ode/FirstOrderDifferentialEquations.html" title="interface in org.apache.commons.math3.ode"><code>differential equations</code></a> to switch the derivatives computation in |
| case of discontinuity), or to direct the integrator to either stop |
| or continue integration, possibly with a reset state or derivatives.</p> |
| |
| <ul> |
| <li>if <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#STOP"><code>EventHandler.Action.STOP</code></a> is returned, the step handler will be called |
| with the <code>isLast</code> flag of the <a href="../../../../../../org/apache/commons/math3/ode/sampling/StepHandler.html#handleStep(org.apache.commons.math3.ode.sampling.StepInterpolator, boolean)"><code>handleStep</code></a> |
| method set to true and the integration will be stopped,</li> |
| <li>if <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_STATE"><code>EventHandler.Action.RESET_STATE</code></a> is returned, the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#resetState(double, double[])"><code>resetState</code></a> method will be called once the step handler has |
| finished its task, and the integrator will also recompute the |
| derivatives,</li> |
| <li>if <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_DERIVATIVES"><code>EventHandler.Action.RESET_DERIVATIVES</code></a> is returned, the integrator |
| will recompute the derivatives, |
| <li>if <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#CONTINUE"><code>EventHandler.Action.CONTINUE</code></a> is returned, no specific action will |
| be taken (apart from having called this method) and integration |
| will continue.</li> |
| </ul> |
| |
| <p>The scheduling between this method and the <a href="../../../../../../org/apache/commons/math3/ode/sampling/StepHandler.html" title="interface in org.apache.commons.math3.ode.sampling"><code>StepHandler</code></a> method <a href="../../../../../../org/apache/commons/math3/ode/sampling/StepHandler.html#handleStep(org.apache.commons.math3.ode.sampling.StepInterpolator, boolean)"><code>handleStep(interpolator, isLast)</code></a> is to call this method first and |
| <code>handleStep</code> afterwards. This scheduling allows the integrator to |
| pass <code>true</code> as the <code>isLast</code> parameter to the step |
| handler to make it aware the step will be the last one if this method |
| returns <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#STOP"><code>EventHandler.Action.STOP</code></a>. As the interpolator may be used to navigate back |
| throughout the last step (as <a href="../../../../../../org/apache/commons/math3/ode/sampling/StepNormalizer.html" title="class in org.apache.commons.math3.ode.sampling"><code>StepNormalizer</code></a> |
| does for example), user code called by this method and user |
| code called by step handlers may experience apparently out of order values |
| of the independent time variable. As an example, if the same user object |
| implements both this <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><code>EventHandler</code></a> interface and the |
| <a href="../../../../../../org/apache/commons/math3/ode/sampling/FixedStepHandler.html" title="interface in org.apache.commons.math3.ode.sampling"><code>FixedStepHandler</code></a> |
| interface, a <em>forward</em> integration may call its |
| <code>eventOccurred</code> method with t = 10 first and call its |
| <code>handleStep</code> method with t = 9 afterwards. Such out of order |
| calls are limited to the size of the integration step for <a href="../../../../../../org/apache/commons/math3/ode/sampling/StepHandler.html" title="interface in org.apache.commons.math3.ode.sampling"><code>variable step handlers</code></a> and |
| to the size of the fixed step for <a href="../../../../../../org/apache/commons/math3/ode/sampling/FixedStepHandler.html" title="interface in org.apache.commons.math3.ode.sampling"><code>fixed step handlers</code></a>.</p></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double, double[], boolean)">eventOccurred</a></code> in interface <code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>t</code> - current value of the independent <i>time</i> variable</dd><dd><code>y</code> - array containing the current value of the state vector</dd><dd><code>increasing</code> - 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 integration which may go backward in time)</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>indication of what the integrator should do next, this |
| value must be one of <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#STOP"><code>EventHandler.Action.STOP</code></a>, <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_STATE"><code>EventHandler.Action.RESET_STATE</code></a>, |
| <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_DERIVATIVES"><code>EventHandler.Action.RESET_DERIVATIVES</code></a> or <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#CONTINUE"><code>EventHandler.Action.CONTINUE</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="resetState(double, double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>resetState</h4> |
| <pre>public void resetState(double t, |
| double[] y)</pre> |
| <div class="block">Reset the state prior to continue the integration. |
| |
| <p>This method is called after the step handler has returned and |
| before the next step is started, but only when <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double, double[], boolean)"><code>EventHandler.eventOccurred(double, double[], boolean)</code></a> has itself returned the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_STATE"><code>EventHandler.Action.RESET_STATE</code></a> |
| indicator. It allows the user to reset the state vector for the |
| next step, without perturbing the step handler of the finishing |
| step. If the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double, double[], boolean)"><code>EventHandler.eventOccurred(double, double[], boolean)</code></a> never returns the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html#RESET_STATE"><code>EventHandler.Action.RESET_STATE</code></a> indicator, this function will never be called, and it is |
| safe to leave its body empty.</p></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#resetState(double, double[])">resetState</a></code> in interface <code><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>t</code> - current value of the independent <i>time</i> variable</dd><dd><code>y</code> - array containing the current value of the state vector |
| the new state should be put in the same array</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/EventFilter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li>Prev Class</li> |
| <li><a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../../index.html?org/apache/commons/math3/ode/events/EventFilter.html" target="_top">Frames</a></li> |
| <li><a href="EventFilter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2003–2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |