aboutsummaryrefslogtreecommitdiff
path: root/commons-math3-3.6.1/docs/apidocs/org/apache/commons/math3/ode/events/EventFilter.html
blob: 68fa2a1cbacfd66d57c771e7f1a8caaff97350d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
<!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.6.1 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.6.1 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><a href="../../../../../../org/apache/commons/math3/ode/events/Action.html" title="enum in org.apache.commons.math3.ode.events"><span class="strong">Prev Class</span></a></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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</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/7/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/7/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 implicitly
 by a <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#g(double,%20double[])"><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,%20double[])"><code>g function</code></a> and to the <a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html#eventOccurred(double,%20double[],%20boolean)"><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,%20double[])"><code>g function</code></a> will also be reduced.</p></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>3.2</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&nbsp;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">&nbsp;</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,%20org.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>&nbsp;rawHandler,
           <a href="../../../../../../org/apache/commons/math3/ode/events/FilterType.html" title="enum in org.apache.commons.math3.ode.events">FilterType</a>&nbsp;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">&nbsp;</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,%20double[],%20boolean)">eventOccurred</a></strong>(double&nbsp;t,
             double[]&nbsp;y,
             boolean&nbsp;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,%20double[])">g</a></strong>(double&nbsp;t,
 double[]&nbsp;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,%20double[],%20double)">init</a></strong>(double&nbsp;t0,
    double[]&nbsp;y0,
    double&nbsp;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,%20double[])">resetState</a></strong>(double&nbsp;t,
          double[]&nbsp;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&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/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/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" 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&nbsp;EventFilter(<a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.html" title="interface in org.apache.commons.math3.ode.events">EventHandler</a>&nbsp;rawHandler,
           <a href="../../../../../../org/apache/commons/math3/ode/events/FilterType.html" title="enum in org.apache.commons.math3.ode.events">FilterType</a>&nbsp;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&nbsp;void&nbsp;init(double&nbsp;t0,
        double[]&nbsp;y0,
        double&nbsp;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,%20double[],%20double)">init</a></code>&nbsp;in interface&nbsp;<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&nbsp;double&nbsp;g(double&nbsp;t,
       double[]&nbsp;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,%20double[],%20boolean)"><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,%20double[])">g</a></code>&nbsp;in interface&nbsp;<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&nbsp;<a href="../../../../../../org/apache/commons/math3/ode/events/EventHandler.Action.html" title="enum in org.apache.commons.math3.ode.events">EventHandler.Action</a>&nbsp;eventOccurred(double&nbsp;t,
                                double[]&nbsp;y,
                                boolean&nbsp;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,%20boolean)"><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,%20double[])"><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,%20boolean)"><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,%20double[],%20boolean)">eventOccurred</a></code>&nbsp;in interface&nbsp;<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&nbsp;void&nbsp;resetState(double&nbsp;t,
              double[]&nbsp;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,%20double[],%20boolean)"><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,%20double[],%20boolean)"><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,%20double[])">resetState</a></code>&nbsp;in interface&nbsp;<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><a href="../../../../../../org/apache/commons/math3/ode/events/Action.html" title="enum in org.apache.commons.math3.ode.events"><span class="strong">Prev Class</span></a></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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</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 &#169; 2003&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>