1 | <html>
|
---|
2 | <!--
|
---|
3 | Licensed to the Apache Software Foundation (ASF) under one or more
|
---|
4 | contributor license agreements. See the NOTICE file distributed with
|
---|
5 | this work for additional information regarding copyright ownership.
|
---|
6 | The ASF licenses this file to You under the Apache License, Version 2.0
|
---|
7 | (the "License"); you may not use this file except in compliance with
|
---|
8 | the License. You may obtain a copy of the License at
|
---|
9 |
|
---|
10 | http://www.apache.org/licenses/LICENSE-2.0
|
---|
11 |
|
---|
12 | Unless required by applicable law or agreed to in writing, software
|
---|
13 | distributed under the License is distributed on an "AS IS" BASIS,
|
---|
14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
15 | See the License for the specific language governing permissions and
|
---|
16 | limitations under the License.
|
---|
17 | -->
|
---|
18 | <!-- $Revision: 920131 $ -->
|
---|
19 | <body>
|
---|
20 | <p>
|
---|
21 | This package provides classes to solve Ordinary Differential Equations problems.
|
---|
22 | </p>
|
---|
23 |
|
---|
24 | <p>
|
---|
25 | This package solves Initial Value Problems of the form
|
---|
26 | <code>y'=f(t,y)</code> with <code>t<sub>0</sub></code> and
|
---|
27 | <code>y(t<sub>0</sub>)=y<sub>0</sub></code> known. The provided
|
---|
28 | integrators compute an estimate of <code>y(t)</code> from
|
---|
29 | <code>t=t<sub>0</sub></code> to <code>t=t<sub>1</sub></code>.
|
---|
30 | If in addition to <code>y(t)</code> users need to get the
|
---|
31 | derivatives with respect to the initial state
|
---|
32 | <code>dy(t)/dy(t<sub>0</sub>)</code> or the derivatives with
|
---|
33 | respect to some ODE parameters <code>dy(t)/dp</code>, then the
|
---|
34 | classes from the <a href="./jacobians/package-summary.html">
|
---|
35 | org.apache.commons.math.ode.jacobians</a> package must be used
|
---|
36 | instead of the classes in this package.
|
---|
37 | </p>
|
---|
38 |
|
---|
39 | <p>
|
---|
40 | All integrators provide dense output. This means that besides
|
---|
41 | computing the state vector at discrete times, they also provide a
|
---|
42 | cheap mean to get the state between the time steps. They do so through
|
---|
43 | classes extending the {@link
|
---|
44 | org.apache.commons.math.ode.sampling.StepInterpolator StepInterpolator}
|
---|
45 | abstract class, which are made available to the user at the end of
|
---|
46 | each step.
|
---|
47 | </p>
|
---|
48 |
|
---|
49 | <p>
|
---|
50 | All integrators handle multiple discrete events detection based on switching
|
---|
51 | functions. This means that the integrator can be driven by user specified
|
---|
52 | discrete events. The steps are shortened as needed to ensure the events occur
|
---|
53 | at step boundaries (even if the integrator is a fixed-step
|
---|
54 | integrator). When the events are triggered, integration can be stopped
|
---|
55 | (this is called a G-stop facility), the state vector can be changed,
|
---|
56 | or integration can simply go on. The latter case is useful to handle
|
---|
57 | discontinuities in the differential equations gracefully and get
|
---|
58 | accurate dense output even close to the discontinuity.
|
---|
59 | </p>
|
---|
60 |
|
---|
61 | <p>
|
---|
62 | The user should describe his problem in his own classes
|
---|
63 | (<code>UserProblem</code> in the diagram below) which should implement
|
---|
64 | the {@link org.apache.commons.math.ode.FirstOrderDifferentialEquations
|
---|
65 | FirstOrderDifferentialEquations} interface. Then he should pass it to
|
---|
66 | the integrator he prefers among all the classes that implement the
|
---|
67 | {@link org.apache.commons.math.ode.FirstOrderIntegrator
|
---|
68 | FirstOrderIntegrator} interface.
|
---|
69 | </p>
|
---|
70 |
|
---|
71 | <p>
|
---|
72 | The solution of the integration problem is provided by two means. The
|
---|
73 | first one is aimed towards simple use: the state vector at the end of
|
---|
74 | the integration process is copied in the <code>y</code> array of the
|
---|
75 | {@link org.apache.commons.math.ode.FirstOrderIntegrator#integrate
|
---|
76 | FirstOrderIntegrator.integrate} method. The second one should be used
|
---|
77 | when more in-depth information is needed throughout the integration
|
---|
78 | process. The user can register an object implementing the {@link
|
---|
79 | org.apache.commons.math.ode.sampling.StepHandler StepHandler} interface or a
|
---|
80 | {@link org.apache.commons.math.ode.sampling.StepNormalizer StepNormalizer}
|
---|
81 | object wrapping a user-specified object implementing the {@link
|
---|
82 | org.apache.commons.math.ode.sampling.FixedStepHandler FixedStepHandler}
|
---|
83 | interface into the integrator before calling the {@link
|
---|
84 | org.apache.commons.math.ode.FirstOrderIntegrator#integrate
|
---|
85 | FirstOrderIntegrator.integrate} method. The user object will be called
|
---|
86 | appropriately during the integration process, allowing the user to
|
---|
87 | process intermediate results. The default step handler does nothing.
|
---|
88 | </p>
|
---|
89 |
|
---|
90 | <p>
|
---|
91 | {@link org.apache.commons.math.ode.ContinuousOutputModel
|
---|
92 | ContinuousOutputModel} is a special-purpose step handler that is able
|
---|
93 | to store all steps and to provide transparent access to any
|
---|
94 | intermediate result once the integration is over. An important feature
|
---|
95 | of this class is that it implements the <code>Serializable</code>
|
---|
96 | interface. This means that a complete continuous model of the
|
---|
97 | integrated function throughout the integration range can be serialized
|
---|
98 | and reused later (if stored into a persistent medium like a filesystem
|
---|
99 | or a database) or elsewhere (if sent to another application). Only the
|
---|
100 | result of the integration is stored, there is no reference to the
|
---|
101 | integrated problem by itself.
|
---|
102 | </p>
|
---|
103 |
|
---|
104 | <p>
|
---|
105 | Other default implementations of the {@link
|
---|
106 | org.apache.commons.math.ode.sampling.StepHandler StepHandler} interface are
|
---|
107 | available for general needs ({@link
|
---|
108 | org.apache.commons.math.ode.sampling.DummyStepHandler DummyStepHandler}, {@link
|
---|
109 | org.apache.commons.math.ode.sampling.StepNormalizer StepNormalizer}) and custom
|
---|
110 | implementations can be developed for specific needs. As an example,
|
---|
111 | if an application is to be completely driven by the integration
|
---|
112 | process, then most of the application code will be run inside a step
|
---|
113 | handler specific to this application.
|
---|
114 | </p>
|
---|
115 |
|
---|
116 | <p>
|
---|
117 | Some integrators (the simple ones) use fixed steps that are set at
|
---|
118 | creation time. The more efficient integrators use variable steps that
|
---|
119 | are handled internally in order to control the integration error with
|
---|
120 | respect to a specified accuracy (these integrators extend the {@link
|
---|
121 | org.apache.commons.math.ode.nonstiff.AdaptiveStepsizeIntegrator
|
---|
122 | AdaptiveStepsizeIntegrator} abstract class). In this case, the step
|
---|
123 | handler which is called after each successful step shows up the
|
---|
124 | variable stepsize. The {@link
|
---|
125 | org.apache.commons.math.ode.sampling.StepNormalizer StepNormalizer} class can
|
---|
126 | be used to convert the variable stepsize into a fixed stepsize that
|
---|
127 | can be handled by classes implementing the {@link
|
---|
128 | org.apache.commons.math.ode.sampling.FixedStepHandler FixedStepHandler}
|
---|
129 | interface. Adaptive stepsize integrators can automatically compute the
|
---|
130 | initial stepsize by themselves, however the user can specify it if he
|
---|
131 | prefers to retain full control over the integration or if the
|
---|
132 | automatic guess is wrong.
|
---|
133 | </p>
|
---|
134 |
|
---|
135 | <p>
|
---|
136 | <table border="1" align="center">
|
---|
137 | <tr BGCOLOR="#CCCCFF"><td colspan=2><font size="+2">Fixed Step Integrators</font></td></tr>
|
---|
138 | <tr BGCOLOR="#EEEEFF"><font size="+1"><td>Name</td><td>Order</td></font></tr>
|
---|
139 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.EulerIntegrator Euler}</td><td>1</td></tr>
|
---|
140 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.MidpointIntegrator Midpoint}</td><td>2</td></tr>
|
---|
141 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.ClassicalRungeKuttaIntegrator Classical Runge-Kutta}</td><td>4</td></tr>
|
---|
142 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.GillIntegrator Gill}</td><td>4</td></tr>
|
---|
143 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.ThreeEighthesIntegrator 3/8}</td><td>4</td></tr>
|
---|
144 | </table>
|
---|
145 | </p>
|
---|
146 |
|
---|
147 | <table border="1" align="center">
|
---|
148 | <tr BGCOLOR="#CCCCFF"><td colspan=3><font size="+2">Adaptive Stepsize Integrators</font></td></tr>
|
---|
149 | <tr BGCOLOR="#EEEEFF"><font size="+1"><td>Name</td><td>Integration Order</td><td>Error Estimation Order</td></font></tr>
|
---|
150 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.HighamHall54Integrator Higham and Hall}</td><td>5</td><td>4</td></tr>
|
---|
151 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.DormandPrince54Integrator Dormand-Prince 5(4)}</td><td>5</td><td>4</td></tr>
|
---|
152 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.DormandPrince853Integrator Dormand-Prince 8(5,3)}</td><td>8</td><td>5 and 3</td></tr>
|
---|
153 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.GraggBulirschStoerIntegrator Gragg-Bulirsch-Stoer}</td><td>variable (up to 18 by default)</td><td>variable</td></tr>
|
---|
154 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.AdamsBashforthIntegrator Adams-Bashforth}</td><td>variable</td><td>variable</td></tr>
|
---|
155 | <tr><td>{@link org.apache.commons.math.ode.nonstiff.AdamsMoultonIntegrator Adams-Moulton}</td><td>variable</td><td>variable</td></tr>
|
---|
156 | </table>
|
---|
157 | </p>
|
---|
158 |
|
---|
159 | <p>
|
---|
160 | In the table above, the {@link org.apache.commons.math.ode.nonstiff.AdamsBashforthIntegrator
|
---|
161 | Adams-Bashforth} and {@link org.apache.commons.math.ode.nonstiff.AdamsMoultonIntegrator
|
---|
162 | Adams-Moulton} integrators appear as variable-step ones. This is an experimental extension
|
---|
163 | to the classical algorithms using the Nordsieck vector representation.
|
---|
164 | </p>
|
---|
165 |
|
---|
166 | </body>
|
---|
167 | </html>
|
---|