Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
Accelerated Runge-Kutta methods and non-slip rolling
(USC Thesis Other)
Accelerated Runge-Kutta methods and non-slip rolling
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
ACCELERATED RUNGE-KUTTA METHODS
AND NON-SLIP ROLLING
by
Artin Farahani
A Dissertation Presented to the
FACULTY OF THE USC GRADUATE SCHOOL
UNIVERSITY OF SOUTHERN CALIFORNIA
In Partial Fulfillment of the
Requirement for the Degree
DOCTOR OF PHILOSOPHY
(MECHANICAL ENGINEERING)
December 2010
Copyright 2010 Artin Farahani
ii
DEDICATION
Dedicated to my dad, brother, and mom, who was pregnant with me when she was
writing her thesis. This was inevitable.
iii
TABLE OF CONTENTS
DEDICATION ii
LIST OF TABLES vi
LIST OF FIGURES ix
ABSTRACT xix
CHAPTER 1 - INTRODUCTION 1
1.1 Background 1
1.2 Outline 7
CHAPTER 2 - CONSTANT STEP SIZE AUTONOMOUS ARK METHODS 9
2.1 Introduction 9
2.2 Central Idea of ARK Methods 13
2.3 Derivation 16
2.3.1 ARK3 19
2.3.2 ARK4 22
2.3.3 ARK4-4 24
2.3.4 ARK5 29
2.4 Standard Test Problems 32
2.5 Accuracy 34
2.6 Speed 43
2.7 Stability 49
2.7.1 D-stability 52
2.7.1.1 Lemma 2.1 54
2.7.1.2 Lemma 2.2 56
2.7.1.3 Theorem 2.1 60
2.7.1.4 Theorem 2.2 66
2.7.2 A-stability 69
2.8 Summary 74
CHAPTER 3 - CONSTANT STEP SIZE NON-AUTONOMOUS ARK
METHODS 76
3.1 Introduction 76
3.2 Derivation 78
3.3 Standard Test Problems 85
3.4 Accuracy 86
3.5 Speed 89
3.6 Stability 92
iv
3.6.1 D-stability 93
3.6.1.1 Theorem 3.1 93
3.6.1.2 Theorem 3.2 98
3.6.2 A-stability 100
3.7 Summary 100
CHAPTER 4 - VARIABLE STEP SIZE ARK METHODS 102
4.1 Introduction 102
4.2 Derivation 104
4.2.1 ARK3 107
4.2.2 ARK4 108
4.2.3 Parameter Selection 110
4.3 Error Control and Step Size Selection 112
4.3.1 Error Control 113
4.3.2 Step Size Selection 118
4.4 Basis of Comparison 122
4.5 Standard Test Problems 123
4.6 Solver Structure and Syntax 124
4.7 Accuracy 126
4.8 Limiting Precision 136
4.9 Stiffness 141
4.10 Speed 143
4.11 Interpolation 149
4.12 Stability 160
4.12.1 D-stability 160
4.12.1.1 Lemma 4.1 162
4.12.1.2 Theorem 4.1 165
4.12.1.3 Theorem 4.2 169
4.12.2 A-Stability 173
4.13 Summary 177
CHAPTER 5 - NON-SLIP ROLLING ON ARBITRARY SURFACE 180
5.1 Modeling 181
5.2 Derivation Step 1: Unconstrained System 186
5.2.1 Alternate Formulation 189
5.3 Derivation Step 2: Constraints 192
5.3.1 Surface Contact 192
5.3.2 Tangency 192
5.3.3 Non-Slip Rolling 193
5.3.4 Euler Parameters 194
5.3.5 Constraint Form Aq b 194
5.3.6 Constraints For The Cylindrical Surface 195
v
5.4 Simulation 196
5.5 Experiments 202
5.5.1 Experiment 1: Zero Initial Velocity 204
5.5.2 Experiment 2: Non-zero Initial Velocity 207
5.6 Sensitivity to Initial Conditions 210
5.7 Summary 219
CHAPTER 6 - CONCLUSIONS 221
6.1 Constant Step Size Autonomous ARK Methods 221
6.2 Constant Step Size Non-autonomous ARK Methods 222
6.3 Variable Step Size ARK methods 223
6.4 Non-slip Rolling 225
BIBLIOGRAPHY 227
APPENDICES 230
Appendix A: Standard Initial Value Problems 231
Appendix B: Speed Data for Autonomous Constant Step Size ARK Methods 237
Appendix C: Maple Code for Constant Step Size Autonomous ARK5 239
Appendix D: Flowchart of the ARK34 Program 264
Appendix E: Performance Statistics For ARK34 270
Appendix F: Brief Description of Other Multi-step Methods 276
Appendix G: End of Integration Accuracy Plots for Variable Step Size Methods 281
Appendix H: System Used in Rolling Simulations and Experiments 287
vi
LIST OF TABLES
Table 2.1: Selected parameters for ARK3. These are the three parameter
sets found that lead to the most accurate ARK methods (in
order) in solving the standard problems considered here. 22
Table 2.2: Selected parameters for ARK4. These are the three parameter
sets found that lead to the most accurate ARK methods (in
order) in solving the standard problems considered here. 24
Table 2.3: Selected parameters for ARK4-4. These are the three parameter
sets found that lead to the most accurate ARK methods (in
order) in solving the standard problems considered here.
Continued to the next table. 26
Table 2.4: Continued from previous table. 27
Table 2.5: Selected parameters for ARK5. These are the three parameter
sets found that lead to the most accurate ARK methods (in
order) in solving the standard problems considered here.
Continued to the next table. 31
Table 2.6: Continued from previous table. 32
Table 2.7: Parameters for (a) RK2, (b) RK3, and (c) RK4 in Butcher's
notation [10]. These RK methods are used as a reference to
gauge the performance of ARK methods. Continued to the next
table. 35
Table 2.8: Continued from the previous table. 35
Table 2.9: Order of accuracy and number of function evaluations per time
step for RK and ARK methods. This table shows that ARK
methods are more efficient than RK methods (in most cases). 42
Table 3.1: An example of error produced by non-autonomous and
autonomous ARK methods. This table shows that these errors
are slightly different, which is due to numerical rounding error. 89
Table 4.1: An example illustrating that at any step of integration, either
absolute or relative error control are applied, not both. 117
vii
Table 5.1: Physical constants of the rolling ball experiment. 203
Table 5.2: Initial conditions (rounded to 4 significant figures) for
experiment 1. 204
Table 5.3: Initial conditions (rounded to 4 significant figures) for
experiment 2. 207
Table 5.4: The bounds on the measured initial conditions (rounded to 4
significant figures) based on measurement errors under the
experimental conditions. 214
Table B.1: Speed and accuracy data for P1 (scalar problem). 237
Table B.2: Speed and accuracy data for P4 (Euler problem). 237
Table B.3: Speed and accuracy data for P6 (2 body problem eccentricity 0). 237
Table B.4: Speed and accuracy data for P7 (2 body problem eccentricity
0.9). 238
Table B.5: Speed and accuracy data for P9 (radioactive problem). 238
Table E.1: The number of successful steps taken by the ODE23, ODE45,
and ARK34 (parameter sets 1 and 2) methods for three different
relative tolerances (continued to next table). This table shows
that higher order methods generally take fewer steps. 270
Table E.2: Continued from previous table. 271
Table E.3: The number of failed attempts made by the ODE23, ODE45,
and ARK34 (parameter sets 1 and 2) methods for three different
relative tolerances (continued to next table). This table shows
that ARK34 generally does not make any more failed attempts
than ODE23 or ODE45. 272
Table E.4: Continued from previous table. 273
viii
Table E.5: The number of function evaluations performed by the ODE23,
ODE45, and ARK34 (parameter sets 1 and 2) methods for three
different relative tolerances (continued to next table). This table
shows that higher order methods generally perform fewer
function evaluations. 274
Table E.6: Continued from previous table. 275
ix
LIST OF FIGURES
Figure 2.1: The central idea of ARK methods is illustrated here by an
example of ARK3. Approximating the solution
1 n
y at
1 n
t
requires 2 function evaluations
1
k and
2
k (shown in red) and
two reused values
1
k and
2
k (shown in blue) from the
previous step‟s
1
k and
2
k . This process repeats for the next
step (approximating the solution at
2 n
t
). 14
Figure 2.2: Accuracy plot for P1 (scalar non-autonomous problem) using
log-log scale. The term ANGE is defined in equation (2.56).
The RK methods are shown by lines with circles, and the ARK
methods by lines with squares. Lines of the same color
correspond to methods with the same number of function
evaluations per time step. This plot shows that generally ARK
methods are more accurate than RK methods of equal number
of function evaluations (see Table 2.9). 37
Figure 2.3: Accuracy plot for P4 (Euler rigid body problem). See caption
of Figure 2.2. 38
Figure 2.4: Accuracy plot for component
1
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See
caption of Figure 2.2. 38
Figure 2.5: Accuracy plot for component
2
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See
caption of Figure 2.2. 39
Figure 2.6: Accuracy plot for component
3
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See
caption of Figure 2.2. 39
Figure 2.7: Accuracy plot for component
4
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See
caption of Figure 2.2. 40
Figure 2.8: Accuracy plot for P7 (2 body problem with eccentricity 0.9).
See caption of Figure 2.2. 40
x
Figure 2.9: Accuracy plot for P9 (radioactive problem (10 dimensional)).
See caption of Figure 2.2. 41
Figure 2.10: Accuracy plot for P12 (5 planet problem (30 dimensional)). See
caption of Figure 2.2. 41
Figure 2.11: The accuracy and execution time of ARK and RK methods in
solving P1 (scalar non-autonomous problem) are compared
here. This plot shows that for a little more time, ARK methods
are much more accurate. 44
Figure 2.12: The accuracy and execution time of ARK and RK methods in
solving P4 (Euler problem) are compared here. This plot shows
that for a little more time, ARK methods are much more
accurate. 45
Figure 2.13: The accuracy and execution time of ARK and RK methods in
solving P6 (2 body problem with eccentricity 0) are compared
here. This plot shows that for a little more time, ARK methods
are much more accurate. 45
Figure 2.14: The accuracy and execution time of ARK and RK methods in
solving P7 (2 body problem with eccentricity 0.9) are compared
here. This plot shows that for a little more time, ARK methods
are much more accurate. 46
Figure 2.15: The accuracy and execution time of ARK and RK methods in
solving P9 (radioactive problem) are compared here. This plot
shows that for a little more time, ARK methods are much more
accurate. 46
Figure 2.16: Stability region of ARK3 (with parameter sets of Table 2.1),
and RK2. This plot shows that ARK3‟s stability region is
practically the same size as RK2‟s. 72
Figure 2.17: Stability region of ARK4 (with parameter sets of Table 2.2),
and RK3. This plot shows that ARK4‟s stability region is
smaller than but comparable to RK3‟s. 72
Figure 2.18: Stability region of ARK4-4 (with parameter sets of Table 2.3),
and RK4. This plot shows that ARK4-4‟s stability region is
smaller than but comparable to RK4‟s. 73
xi
Figure 2.19: Stability region of ARK5 (with parameter sets of Table 2.5),
and RK5 (with parameter set of Table 2.8). This plot shows
that ARK5‟s stability region is smaller than but comparable to
RK5‟s. 73
Figure 3.1: Accuracy plot for P2 (oscillatory problem) solved in
autonomous form. The RK methods are designated by circles
while ARK methods are designated by squares. Lines of the
same color denote methods with the same number of function
evaluations per time step. These plots show that the non-
autonomous and autonomous methods‟ solutions are virtually
the same. 86
Figure 3.2: Accuracy plot for P2 (oscillatory problem) solved in non-
autonomous form. See caption of Figure 3.2. 87
Figure 3.3: Accuracy plot for P3 (Duffing‟s problem) solved in autonomous
form. See caption of Figure 3.2. 87
Figure 3.4: Accuracy plot for P3 (Duffing‟s problem) solved in non-
autonomous form. See caption of Figure 3.2. 88
Figure 3.5: The accuracy and execution time of non-autonomous ARK and
RK methods in solving P1 (scalar non-autonomous problem)
are compared here. Here, (A) denotes autonomous and (NA)
denotes non-autonomous methods. This plot shows that for
little more time, the non-autonomous ARK methods are much
more accurate than RK methods. See Appendix A for definition
of problem. 90
Figure 3.6: The accuracy and execution time of non-autonomous ARK and
RK methods in solving P2 (oscillatory problem) are compared
here. See caption of Figure 3.5. 90
Figure 3.7: The accuracy and execution time of non-autonomous ARK and
RK methods in solving P3 (Duffing problem) are compared
here. See caption of Figure 3.5. 91
Figure 3.8: The accuracy and execution time of non-autonomous ARK and
RK methods in solving P10 (radioactive problem) are compared
here. See caption of Figure 3.5. 91
xii
Figure 4.1: This diagram illustrates the central idea of the ARK methods
similar to Figure 2.1 but for the variable step size case. 106
Figure 4.2: Accuracy plot of P1 (scalar non-autonomous problem) for the
variable step size methods. This plot shows that the lower order
methods like ARK34 and ODE23 can be more accurate than
ODE45. 129
Figure 4.3: Accuracy plot of P3 (Duffing problem) for the variable step size
methods. This plot shows that ARK34 can more accurate than
ODE23 and ODE45. 129
Figure 4.4: Accuracy plot of P4 (Euler problem) for the variable step size
methods. This plot shows that ARK34 can be more than 10
times more accurate than ODE23 and ODE45. 130
Figure 4.5: Accuracy plot of P5 (stiff Robertson problem) for the variable
step size methods. This plot shows that ARK34, ODE23, and
ODE45 have similar accuracy when solving an example stiff
problem. 130
Figure 4.6: Accuracy plot of P6 (2 body eccentricity 0 problem) for the
variable step size methods. This plot shows that ARK34 can be
more accurate than ODE23 and ODE45. 131
Figure 4.7: Accuracy plot of P7 (2 body eccentricity 0.9 problem) for the
variable step size methods. This plot shows that ARK34 can be
10 times more accurate than ODE23 and ODE45. 131
Figure 4.8: Accuracy plot of P8 (2 body eccentricity 0.99 problem) for the
variable step size methods. This plot shows that ARK34 can be
more accurate than ODE23 and ODE45. The errors for ARK34
with parameter set 1 at
11 10
10 ,10
r
are not included because
it reaches limiting precision (see Section 4.8). 132
Figure 4.9: Accuracy plot of P9 (radioactive problem) for the variable step
size methods. This plot shows that ARK34 can be 10 times
more accurate than ODE23. 132
xiii
Figure 4.10: Accuracy plot of P11 (rolling problem) for the variable step size
methods. For this problem ARK34, ODE23, and ODE45 have
similar accuracy for most tolerances. The error for ARK34 with
parameter set 1 at
11
10
r
is not included because ARK34
reaches limiting precision (see Section 4.8). 133
Figure 4.11: Accuracy plot of P12 (5 planet problem) for the variable step
size methods. This problem shows that ARK34 can be more
accurate than ODE23 and ODE45. 133
Figure 4.12: The accuracy plot of component x for P7 (2 body eccentricity
0.9 problem) over time. This plot shows clearly how the
ARK34 solution (motion of the revolving body) can be much
more accurate than that of ODE23 and ODE45. 134
Figure 4.13: The accuracy plot of component y for P7 (2 body eccentricity
0.9 problem) over time. This plot shows the higher accuracy of
ARK34. 135
Figure 4.14: The accuracy plot of component x for P7 (2 body eccentricity
0.9 problem) over time. This plot shows the higher accuracy of
ARK34. 135
Figure 4.15: The accuracy plot of component y for P7 (2 body eccentricity
0.9 problem) over time. This plot shows the higher accuracy of
ARK34. 136
Figure 4.16: Magnitude of the real eigenvalues of P8 (2 body problem
eccentricity 0.99) solved by ODE45 at relative tolerance
11
10
.
This plot shows the great range of magnitude of the real
eigenvalue which can make numerical integration difficult. 138
Figure 4.17: Local error per step size of P8 (2 body problem eccentricity
0.99) at relative tolerance
11
10
. This plot shows that ARK34
with parameter set 1 loses its accuracy more than other solvers
near the point where the revolving body passes by the stationary
body. 140
Figure 4.18: The ratio of the execution speed of ARK34 with parameter set 1
over that of ODE23 for the standard problems considered here.
(The ratio for P11 at
11
10
r
is not included because of very
lengthy execution time.) 144
xiv
Figure 4.19: The ratio of the execution speed of ARK34 with parameter set 2
over that of ODE23 for the standard problems considered here.
(The ratio for P11 for
11
10
r
is not included because of very
lengthy execution time.) 145
Figure 4.20: The ratio of the number of successful steps of ODE23 over that
of ARK34 (parameter set 1). This plot shows that ODE23 takes
many more steps than ARK34 as tolerance decreases. This is
the reason for ARK34‟s higher speed. 146
Figure 4.21: The ratio of execution speed of ARK34 (parameter set 1) over
that of ODE23 for all problems is plotted here against the
corresponding ratio of number of successful steps. A least
square line that goes through the origin is also plotted. This line
is extended to the origin for convenience only, as the speed and
step ratios are not defined there. This plot shows that ARK34 is
slower than ODE23 per step. 148
Figure 4.22: Accuracy plot of interpolated solutions for P3 (Duffing
problem) for the variable step size methods using case (a). The
accuracy of solutions here is virtually the same as that of Figure
4.3. 153
Figure 4.23: Ratio of error of interpolated solutions over non-interpolated
solutions for P3 (Duffing problem) using case (a). The error of
interpolated solutions here is slightly larger than that of non-
interpolated solutions. 154
Figure 4.24: Ratio of error of interpolated solutions over non-interpolated
solutions for P7 (2 body problem with eccentricity 0.9) using
case (a). The accuracy of interpolated solutions here are
surprisingly 10 times higher than non-interpolated solutions. 155
Figure 4.25: Ratio of error of interpolated solutions over non-interpolated
solutions for P7 (2 body problem with eccentricity 0.9) using
case (b). The interpolated solutions are more than six times
more accurate than non-interpolated solutions. 156
Figure 4.26: Ratio of error of interpolated solutions over non-interpolated
solutions for P7 (2 body problem with eccentricity 0.9) using
case (c). The interpolated solutions are virtually as accurate as
non-interpolated solutions. 157
xv
Figure 4.27: Norm of the Global Error for P7 (2 body problem with
eccentricity 0.9) over time solved using ARK34 (with parameter
set 1) with
5
10
r
. (Scale of y axis is limited to
82
10 10
.)
This plot shows that global error is about 100 times larger when
revolving body is passing close to the stationary body than it is
for the rest of the orbit. 158
Figure 4.28: Ratio of error of interpolated solutions over non-interpolated
solutions for P1 (scalar problem) using case (c). This plot
shows that the interpolated solution of ODE45 can be very
inaccurate for some tolerances for this problem. 159
Figure 4.29: Ratio of error of interpolated solutions over non-interpolated
solutions for P4 (Euler problem) using case (c). ODE45‟s
interpolation is slightly more accurate compared to other
solvers. 159
Figure 4.30: A-stability region of the ARK3 method (parameter set 1 and 2)
is compared with that of RK2. These plots show that at 1
n
r ,
the stability region of ARK methods is smaller than but
comparable to RK methods. However, the ARK stability region
shrinks as
n
r increases. 175
Figure 4.31: A-stability region of the ARK4 (parameter set 1) method is
compared with that of RK3. This plot shows that at 1
n
r , the
stability region of ARK4 is smaller than that of RK3. The ARK
stability region shrinks as
n
r increases. 176
Figure 4.32: A-stability region of the ARK4 (parameter set 2) method is
compared with that of RK3. This plot shows that at 1
n
r , the
stability region of ARK4 is smaller than that of RK3. The ARK
stability region shrinks as
n
r increases. 176
Figure 5.1: Diagram of a spherical ball rolling on a surface (not to scale). 181
Figure 5.2: Error in satisfaction of the surface constraint (4.68) solved using
ARK34 parameter set 2 (solid line) and ODE23 (dashed line).
This plot shows that the constraint is satisfied within numerical
error better by ARK34. 198
xvi
Figure 5.3: Error in satisfaction of the tangency constraint (4.69) solved
using ARK34 parameter set 2 (solid lines) and ODE23 (dashed
lines). This plot shows that the constraint is satisfied within
numerical error better by ARK34. 198
Figure 5.4: Error in satisfaction of the no-slip constraint (4.70) solved using
ARK34 parameter set 2 (solid lines) and ODE23 (dashed lines).
This plot shows that the constraint is satisfied within numerical
error better by ARK34. 199
Figure 5.5: Error in satisfaction of the Euler parameter constraint (4.71)
solved using ARK34 parameter set 2 (solid line) and ODE23
(dashed line). This plot shows that the constraint is satisfied
within numerical error better by ARK34. 199
Figure 5.6: The coordinates of the center of the simulation ball with respect
to the inertial frame in simulation of experiment 2. 200
Figure 5.7: The coordinates of the path traced by the point of contact in
simulation with respect to the inertial frame in simulation of
experiment 2. 201
Figure 5.8: The rotation of the simulation ball (as Euler parameters) with
respect to the inertial frame in simulation of experiment 2. 201
Figure 5.9: Diagram of the Matlab interface for comparing simulation and
experiment results. 202
Figure 5.10: Diagram of experiment setup (not to scale). 203
Figure 5.11: Simulation of the path taken by the center of the ball (blue) and
the path taken by the motion of point of contact (red) on the
surface when starting with the initial conditions of Table 5.2. 205
Figure 5.12: Frame 185 of simulation (bottom) and experiment (top). The
simulation grid lines correspond to the experiment minor gird
lines. This figure shows that the simulation and experiment do
not match exactly. 206
Figure 5.13: The path taken by the center of the ball (blue) and the path of
the motion of point of contact (red) on the surface when starting
with the initial conditions of Table 5.3. 207
xvii
Figure 5.14: Frame 27 of experiment (bottom) and simulation (top). The
simulation grid lines correspond to the experiment minor gird
lines. This figure shows that the simulation and experiment do
not match exactly. 208
Figure 5.15: The x and y positions of the center of the ball in experiment
minus those in simulation. 209
Figure 5.16: Frame 1 of experiment 2. This figure is used for initial
condition measurements. 211
Figure 5.17: Diagram of frame 1 (Figure 5.16). It is used for measuring
initial conditions (not to scale). 212
Figure 5.18: Frame 27 of experiment 2 simulation given nominal initial
conditions of Table 5.3. Compare with the next four figures to
see the effect of sensitivity to changes in the initial conditions. 216
Figure 5.19: Frame 27 of experiment 2 simulation given perturbed initial
conditions based on equations (4.74) and 0.3 . Compare
with Figure 5.18 to see the effect of sensitivity to changes in the
initial conditions. 216
Figure 5.20: Frame 27 of experiment 2 simulation given perturbed initial
conditions based on equations (4.74) and random ‟s. This is
the first of three simulations with random ‟s. Compare with
Figure 5.18 to see the effect of sensitivity to changes in the
initial conditions. 217
Figure 5.21: Frame 27 of experiment 2 simulation given perturbed initial
conditions based on equations (4.74) and random ‟s. This is
the second of three simulations with random ‟s. Compare
with Figure 5.18 to see the effect of sensitivity to changes in the
initial conditions. 217
Figure 5.22: Frame 27 of experiment 2 simulation given perturbed initial
conditions based on equations (4.74) and random ‟s. This is
the third of three simulations with random ‟s. Compare with
Figure 5.18 to see the effect of sensitivity to changes in the
initial conditions. 218
Figure D.1: Flowchart of the ARK34 variable step size numerical solver
(part 1 of 5). 265
xviii
Figure D.2: Flowchart of the ARK34 variable step size numerical solver
(part 2 of 5). 266
Figure D.3: Flowchart of the ARK34 variable step size numerical solver
(part 3 of 5). 267
Figure D.4: Flowchart of the ARK34 variable step size numerical solver
(part 4 of 5). 268
Figure D.5: Flowchart of the ARK34 variable step size numerical solver
(part 5 of 5). 269
Figure G.1: Accuracy plot for P1 (scalar non-autonomous problem) based
on error at end of time span. 281
Figure G.2: Accuracy plot for P3 (Duffing problem) based on error at end of
time span. 282
Figure G.3: Accuracy plot for P4 (Euler problem) based on error at end of
time span. 282
Figure G.4: Accuracy plot for P5 (Robertson problem) based on error at end
of time span. 283
Figure G.5: Accuracy plot for P6 (2 body eccentricity 0 problem) based on
error at end of time span. 283
Figure G.6: Accuracy plot for P7 (2 body eccentricity 0.9 problem) based on
error at end of time span. 284
Figure G.7: Accuracy plot for P8 (2 body eccentricity 0.99 problem) based
on error at end of time span. 284
Figure G.8: Accuracy plot for P9 (radioactive decay chain problem) based
on error at end of time span. 285
Figure G.9: Accuracy plot for P11 (rolling ball problem) based on error at
end of time span (the smallest tolerance is not used for this
problem because of insufficient memory). 285
Figure G.10: Accuracy plot for P12 (5 planet problem) based on error at end
of time span. 286
xix
ABSTRACT
Presented here are the new Accelerated Runge-Kutta (ARK) numerical integration
methods for the solution of initial value problems described by ordinary differential
equations. A thorough analysis of these methods is given that includes motivation,
derivation, parameter selection, accuracy, speed, stability and convergence studies. Also
presented, is a new methodology for modeling the dynamics of non-slip rolling of a
spherical ball and the path traced on an arbitrary smooth surface along with a comparison
of simulation and experimental results.
This study begins with the constant step size autonomous ARK methods. These methods
are derived using simple mathematical tools, and they benefit from a precise parameter
selection technique that increases their order of accuracy for some problems. These
constant step size ARK methods are proved to be convergent and stable given certain
conditions, and their stability regions are presented. Numerical examples show that in
general for a small increase in execution time, the 3rd and 4th order ARK methods give
solutions that are many times more accurate than those of the 2nd and 3rd order Runge-
Kutta methods, respectively.
These constant step size methods are extended to the more general non-autonomous
form, which can solve non-autonomous problems directly. The conditions of stability
and convergence as well as the stability regions of these methods are the same as those of
xx
autonomous ARK methods. These methods are as accurate yet faster than the
autonomous ARK methods.
The main result of this study, the new variable step size method, ARK34, which controls
the integration error through automatic step size selection is presented. Variable step size
ARK methods are proved to be stable and convergent given certain conditions, and their
stability regions are also presented. An interpolation scheme is developed for ARK34
that allows it to give solutions at any desired time. Numerical experiments show that the
ARK34 solver can be simultaneously as much as ten times more accurate and up to four
times faster than the ODE23 solver of Matlab. ARK34 can even be ten times more
accurate than the ODE45 solver of Matlab (although not as fast).
A new method is developed for modeling complex nonlinear mechanical systems. This
method allows development of the equations of motion for non-slip rolling of a spherical
ball on an arbitrary smooth surface and finding the path of motion traced by the point of
contact. A novel approach is used to model the surface traced path through a massless
point that is included in the system coordinates. This approach utilizes the fundamental
equation in a systematic way and produces the path directly upon solution of the
equations of motion. The methodology is applied to the motion of a spherical ball
rolling non-slip on a cylindrical surface. Simulations and experiments are performed and
the results are compared. Sensitivity to initial conditions appear to in large measure
explain the difference seen between simulations and experiments.
1
CHAPTER 1 - INTRODUCTION
1.1 Background
The majority of dynamic systems in nature and society are described by differential
equations. These equations are often too complex to be solved (integrated) analytically
by today‟s mathematical tools. In such cases, numerical integration is the only way to get
an understanding of their solution.
Numerical integrators, implemented as computer programs, approximate the solution of
these problems at a finite number of points in the independent variable (often time). Two
main factors determine their performance: accuracy and speed. Accuracy indicates how
close the approximated solution is to the exact solution. Speed indicates how quickly a
solver can integrate a problem. Generally, for a specific structure of a numerical
integrator, higher accuracy methods have lower speeds and vice versa. It has been the
goal of researchers to increase either accuracy at a certain speed or increase the speed at a
certain accuracy through the creation of new integrators or modification of existing ones.
A new set of numerical integrators named the Accelerated Runge-Kutta (ARK) methods
are proposed here for the solution of non-stiff initial value problems described by
ordinary differential equations. A low order example of ARK methods is introduced in
[40]. In this study, the general form of these methods are derived and fully analyzed.
They are shown to be more efficient than RK methods, such as the Matlab solvers,
2
through numerical experiments. In contrast to existing methods, the ARK methods
presented here benefit from a simpler construction that not only reduces computational
cost but also leads to a simpler and more elegant set of order equations that can be
analyzed more precisely. The ARK methods also benefit from a more precise and
effective parameter selection technique which transforms them into a higher order
method for some problems. In addition, a complete analysis of all aspects of the ARK
methods, their derivation, accuracy, speed, and stability, is presented here which is
lacking in previous studies.
The well-established numerical integrators, the standard Runge-Kutta methods, are first
proposed by Carl Runge in 1895 who presents methods of upto order 3 [43], and
expanded by Wilhelm Kutta in 1901 who presents methods of upto order 5 [34]. The
original standard Runge-Kutta methods, which are referred to here simply as Runge-
Kutta (RK) methods, create multiple approximate solutions inside an integration step.
Consequently, these low accuracy solutions are combined to give a higher accuracy
solution at the end of the step.
RK methods are tuned for accuracy and restructured for speed by numerous authors such
as follows (see Appendix F). Byrne and Lambert [12] are the first to expand RK methods
to the two-step mode, and give examples of 3rd and 4th order methods. These two-step
RK methods use information from the previous step as well as the current step of
integration. Byrne [11] later selects a set of parameter for these methods by minimizing a
3
conservative bound on the local error. Gruttke extends their work by developing a 5th
order two-step method [26]. Costabile [18] introduces variations of two-step and three-
step RK methods of order three and four. Jackiewicz and Tracogna [32] consider a more
general class of two-step Runge-Kutta methods with less computational cost. Tracogna
and Welfert [48] study the error behavior for these methods using the theory of B-series.
Gear [23] introduces the hybrid methods which combine traits of one-step RK methods
with those of multi-step methods. Goeken et. al. [25] introduce multi-step RK methods
which replace function evaluations with approximations of its derivative. Butcher [8]
introduces the multivalue “almost Runge-Kutta” methods, and Caira et. al. [13] present a
class of pseudo Runge-Kutta methods. Furthermore, the multi-step Adams and BDF
numerical methods use interpolation based on previously calculated results to produce the
numerical solution (see Appendix F).
Of notable interest are the go-to solvers of the popular Matlab computation environment
that are based on RK methods. They are ODE23 which is based on a Bogacki and
Shampine RK method [6], and ODE45 which is based on a Dormand and Prince RK
method [19] (as reported in [46]). These solvers are widely used by many scientists and
engineers. Therefore, a small improvement in their accuracy or speed can be quite
productive.
Numerical integration if of interest because it is often needed in the study of mechanical
systems. Non-slip rolling of a spherical ball on a surface is a commonly encountered
4
dynamical system in science and engineering. Developing the equations of motion of the
ball and the path traced by the point of contact on the surface is not a simple task for
three reasons. There appears to be no unified methodology for finding the equations of
motion for a general non-linear surface; the methodologies for a specific non-linear
surface are complex; and it may not be clear how to model the dynamics of the massless
point that traces the path of motion on the surface.
In this study, a new methodology is presented to derive the equations of motion for non-
slip rolling of a spherical ball on an arbitrary smooth surface. The generality and novelty
of the approach here stems from the inclusion of an arbitrary massless point in space that
is constrained to trace the path of contact. This greatly simplifies the derivation of
equations of motion and gives the path traced on the surface directly, but leads to a
singular mass matrix which is handled by a form of the fundamental equation that can
deal with singular mass matrices. Unlike previous work, the approach used here to derive
the equations of motion is simple, systematic, and straightforward; it does not require
advanced mathematical tools, and can be applied to any nonlinear surface. Furthermore,
to the authors‟ knowledge, the experiments, simulations, and a study of the sensitivity to
initial conditions of the ensuing motion presented here have not been done before.
The nonslip constraint on rolling motion is a nonholonomic constraint. A well known
method of finding the equations of motion for a system with nonholonomic constraints is
the Lagrange multiplier method. In this method, a set of unknown variables (multipliers),
5
which help to represent the constraint forces, can be introduced to the Lagrange equations
through the virtual work term. Subsequently, the multipliers can be eliminated from the
equations of motion analytically if possible, or the equations of motion can be solved for
the generalised coordinates and the mulipliers altogether. Furthermore, if the
nonholonomic constraints can be eliminated from the equations of motion, the Newton-
Euler equations can be used. This is made possible for an inertially symmetric body, by
the modified Euler equations which are based on writing the equations of motion with
respect to a reference frame other than the body frame. In addition, the Boltzmann-
Hamel equations, which give the moment balance equations about an arbitrary point, can
be used in deriving the equations of motin of a system with nonholonomic constraints.
Lastly, the Gibbs-Appell or Kane equations can be used to derive the equations of motion
for nonholonomic systems. The use of all these methods in deriving the equations of
motion of a disk rolling non-slip on a horizontal surface is illustrated clearly in [3]. The
case of a conical surface is studied using Lagrange multipliers in [14]. Benenti also
shows that the equations of motion for a nonholonomic system can be found using
Gauss‟s principle of least constraint [4].
Much research on this system has focused on properties of the problem (such as
integrability and invariant measures) for particular surfaces. Often complex
mathematical tools including differential geometry is employed. Chaplygin considers a
symmetric ball on a horizontal plane [15]. Kinematic relations are written for the
velocity of the center of the ball and projections of the principal moment on the body
6
axes in terms of cosines of angles between vertical and body axes, angular velocity, and
moment of inertia. The conditions under which the principal moment is invariant lead to
equations of motion. Hermans derives equations of unconstrained motion using the
Lagrange method for a sphere rolling on a surface of revolution [29]. One holonomic
contact constraint, and two non-holonomic non-slip constraints along with d‟Alembert‟s
principle are used to derive a vector field in terms of the position of the center of the
sphere, its moment of inertia, surface equation, and rotation of the sphere. Algebraic
manipulations on this vector field lead to equations of motion. To find invariant
measures and integrals of motion, Borisov and Mamaev express the moment about the
center of mass in terms of angular velocity and the surface normal vector for a ball rolling
on a sphere [7]. Through reduced variables they give the equations of motion in terms of
the surface equation, normal vector, moment of inertia, and the position of the
geometrical center of ball. Montana gives kinematic relations for the motion of point of
contact between two rolling objects [36]. This work seems to be the most general attempt
at describing the motion of path of contact.
Two works represent the major effort in physical experimentation. Bhattacharya et. al.
install two motors inside of a sphere rolling on a flat surface, which drive rotation around
horizontal and vertical axes [5]. The theoretical and experimental results are reported to
agree for simple straight (one motor driven) and circular motions (both motors driven at
the same rate), but not for more complex inputs. Virgin et. al. [53] illustrate that if only
the position of the center of the ball is of interest (not its rotation), the nonholonomic
7
constraint needs not be modeled, and the equations of motion can be derived very easily
using the Lagrange equations. They also perform experiments using a nonlinear surface,
and find the basins of attraction numerically and experimentally.
1.2 Outline
In Chapter 2, the constant step size autonomous ARK methods are introduced. The main
focus is variable step size methods because they include error control and therefore are
more effective than constant step size methods in solving problems. However, this study
begins with the simpler constant step size methods for two reasons. One, their simplicity
allows a better understanding of the intricacies of numerical integration. Two, they show
the possible potential of the variable step size methods. The central idea of these
methods is explained, and their general form is given. Their equations are given, and
their parameters are selected. Numerical examples are used to compare their accuracy
and execution speed with that of RK methods. These methods are proved to be
convergent and stable under certain conditions and their stability regions are given.
In Chapter 3, the ARK methods are extended to the non-autonomous form. They are
shown to be equivalent in accuracy within rounding error to the autonomous form of
ARK methods, but run faster. Numerical examples are used to confirm this. Their
stability properties are also shown to be the same as those of the autonomous ARK
methods.
8
In Chapter 4, the variable step size ARK methods are introduced. Their equations are
derived, and their parameters are chosen. Their error estimation and step size selection
schemes are described, and an interpolation scheme that is capable of giving solutions at
any desired time points is developed. Various standard problems are used to compare the
accuracy and speed of these methods with the RK solvers of Matlab. The difficulties
encountered in solving some problems are analyzed. A proof of stability and
convergence is given, and the regions of stability are also presented.
In Chapter 5, the methodology for getting the equations of motion of non-slip rolling on
an arbitrary smooth surface is given and the path traced by the point of contact is
produced directly using the fundamental equation. This methodology is applied to a ball
rolling on a cylindrical surface, and simulations and experiments are performed and
compared. A study on the sensitivity of the motion to initial conditions is also
performed.
In Chapter 6, the main conclusions of this study are listed. The appendix contains a
description of the standard problems used, accuracy versus speed data for constant step
size ARK methods, the Maple code that derives the constant step size ARK methods, the
flowchart and detailed statistics of the variable step size ARK program, a brief
description of other multi-step methods, accuracy of variable step size ARK methods
measured using error at the end of integration time span, and matrices used in the study
of the rolling ball problem along with the rank of two of the matrices.
9
CHAPTER 2 - CONSTANT STEP SIZE AUTONOMOUS ARK METHODS
This chapter introduces the new and simple constant step size autonomous Accelerated-
Runge-Kutta (ARK) methods. The process of derivation and the ensuing order equations
are given and their parameter selection technique is explained. Also included, is the
proof of convergence and stability under certain conditions as well as a description of the
stability regions. Several numerical examples are provided to illustrate the accuracy and
speed of ARK methods, particularly of 3rd and 4th order ARK methods compared with
the 2nd and 3rd order RK methods. The study of these constant step size methods is a
prelude to the study of variable step size methods, which are the main focus of this study
(see Chapter 4). Constant step size methods are studied first because their simplicity
allows a better understanding of the ARK methods and their potential.
2.1 Introduction
An important class of differential equations, named the Initial Value Problem (IVP), are
solved here, which in general are written as
0
00
d ( )
( , ( )),
d
( ) ,
N
t
t t t t t
t
t
y
fy
yy
(2.1)
10
where y ,
0
y , and f are ( 1 l )-dimensional vectors, and t denotes the independent
variable, time. In numerical integration, the time span
0 N
t t t is divided into a finite
number of points,
12
, , ,
N
t t t . The exact solution of IVP (2.1) at these points,
12
( ), ( ), , ( )
N
t t t y y y , is approximated by
12
, , ,
N
y y y at successive “steps”. For
instance, at step 1 n , the solution
1
()
n
t
y at time
1 n
t
is approximated by
1 n
y . For a
constant step size numerical integrator, the step size
1
, (0 1)
nn
h t t n N
is
constant. In this chapter, constant step size Acceleralte Runge-Kutta methods are looked
at.
If the numerical method‟s formula for computing
1 n
y is not a function of
1 n
y itself, the
method is called explicit. On the other hand, if it is a function of
1 n
y itself, the method
is called implicit. In that case the method‟s formula must be solved algebraically at every
step of integration (usually through iteration) to find the value of
1 n
y . In this study, only
explicit methods are dealt with.
In approximating the solution, the numerical integrator produces an error in every step.
So, the solver deviates from the exact solution a little bit at every step. Therefore, at any
step, say step 1 n , the numerical integrator does not approximate the solution of IVP
(2.1), but it approximates the solution of the local problem,
11
1
d ( )
( , ( )),
d
( ) ,
nn
nn
t
t t t t t
t
t
u
fu
uy
(2.2)
where
1
()
n
t
u is called the local solution, and the initial condition is the numerical
solution computed in the previous step. The local error is the error made in this
approximation, i.e.,
11
()
n n n
t
le u y ,
while the global error is the cumulative effect of the local error up to step 1 n , i.e.,
11
()
n n n
t
ge y y .
A set of new numerical integrators named the Accelerated-Runge-Kutta (ARK) methods
are proposed here. To simplify their derivation, they are developed in autonomous form.
These autonomous ARK methods solve the autonomous version of equation (2.1) given
by
0
00
d ( )
( ( )),
d
( ) ,
N
t
t t t t
t
t
y
fy
yy
(2.3)
where y ,
0
y , and f
are l -dimensional vectors. f is assumed to be a Lipschitz
continuous function to ensure that a solution exists and is unique [44]. Developing ARK
12
methods in autonomous form does not cause a loss in generality. The non-autonomous
problem (2.1) can be readily converted to autonomous form (2.3) by adding a dependent
variable
l
yt and a differential equation 1
l
y
with the initial condition
00
()
l
y t t to
the problem (see Section 3.2 for details). Here, the superscript l denotes an index, not
power.
The ARK methods‟ main computational cost is multiple evaluations of () fy , called
“function evaluations”, or “stages” in every step. ARKp denotes an ARK method whose
local error is of
1
()
p
Oh
. The ARK methods are two-step methods, meaning they
calculate
1 n
y based on information from the current step and the previous step. It is seen
in the next section that ARK3, ARK4, and ARK5 require 2, 3, and 5 function evaluations
per time step of integration, respectively.
The one-step standard Runge-Kutta (RK) methods calculate
1 n
y based on information
from the current step only. An RK method that has a local error of
1
()
p
Oh
is said to be
of order p and is denoted RKp. RK3, RK4, and RK5 require 3, 4, and 6 function
evaluations per time step of integration, respectively [10]. Since function evaluations are
often the most computationally expensive part of numerically solving differential
equations (see Section 2.6 for further details), ARK methods are expected to be more
computationally efficient than RK methods.
13
In the next section, the central idea of ARK methods is explained followed by a
description of how to derive and select parameters for ARK3, ARK4, a more accurate
ARK4 named ARK4-4, and ARK5 in Sections 2.3.1, 2.3.2, 2.3.3, and 2.3.4, respectively.
In Section 2.5, standard initial value problems are used to illustrate the accuracy of ARK
methods (im comparison to RK methods). In Section 2.6, the speed of ARK methods are
shown (in comparison with RK methods) using some of the same standard problems.
Section 2.7 gives a proof of stability and convergence of ARK methods, and compares
the stability region of ARK and RK methods. The chapter ends with a summary of
findings. Appendices A, B, and F contain the description of the initial value problems
used in numerical comparisons, speed data, and the Maple code that derives the ARK5
method, respectively.
2.2 Central Idea of ARK Methods
An example of the Accelerated-RK3 (ARK3) method solving IVP (2.3) is given by
1 1 1 2 2
11
22
nn
y y k k k k , (2.4)
where
1 1 1
11
2 1 2 1 1 33
,,
,.
nn
nn
hh
hh
k f y k f y
k f y k k f y k
14
The approximate solution
1 n
y at time
1 n
t
is calculated based on the approximate
solutions
n
y and
1 n
y at times
n
t and
1 n
t
, respectively, along with 2 function evaluations
1
k and
2
k in the current step and 2 reused function evaluations
1
k and
2
k that are
obtained in the previous step. Hence, ARK3 is a two-step method. In each step of
integration, only
1
k and
2
k are calculated, while
1
k and
2
k are reused from the
previous step‟s
1
k and
2
k . Figure 2.1 illustrates this idea. Hence, ARK3 costs 2
function evaluations per step of integration, just like RK2. However, it is a two-step
method.
Figure 2.1: The central idea of ARK methods is illustrated here by an example of
ARK3. Approximating the solution
1 n
y at
1 n
t
requires 2 function evaluations
1
k
and
2
k (shown in red) and two reused values
1
k and
2
k (shown in blue) from the
previous step‟s
1
k and
2
k . This process repeats for the next step (approximating
the solution at
2 n
t
).
y
t
n-2
t
n-1
t
n
t
n+1
t
n+2
k
-1
k
-2
k
1
k
2
k
-1
k
-2
k
1
k
2
k
-1
k
-2
k
1
k
2
step n
step n+1
step n+2
y
n+2
y
n+1
y
n
y
n-1
y
n-2
15
In comparison, an example of an RK2 method for solving IVP (2.1) is
1 1 2
11
22
nn
y y k k , (2.5)
where
1
11
21 22
,,
,.
nn
nn
ht
h t h
k f y
k f y k
The approximate solution
1 n
y at
1 n
t
is calculated based on the approximate solution
n
y
at
n
t along with 2 function evaluations
1
k and
2
k in the current step (step 1 n ). Hence,
RK2 is a one-step method with a computational cost of 2 function evaluations per time
step.
The reuse of previously calculated data allows the ARK methods to achieve 3rd order
accuracy with 2 function evaluations, while RK methods can only achieve 2nd order
accuracy with 2 function evaluations. This increased efficiency also applies to ARK4
when compared to RK3, and is the central idea of ARK methods.
At the first step of integration, there is no previous step. Therefore, ARK methods are
not self-starting. A one-step method (such as RK) must supply the approximate solution
1
y at the end of the first step
1
t . To maintain the convergence order of an ARKp method,
16
the starting one-step method must be at least of order 1 p (see Theorem 2.7.1.4).
However, in this work, ARK methods are started with an RK method of equal order. The
reason is that the accuracy of step one can affect the accuracy of the entire integration.
The extra computation of ARK startup occurs only in the first step of integration.
2.3 Derivation
The general form of the ARK methods presented here is
1 0 0 1 1 1 1 1
2
n n n i i i
i
c c c c c
y y y k k k k (2.6)
for 11 nN , where
1 1 1
2 1 1 2 1 1 1
5 4 4 5 1 4 4
,,
,,
,.
nn
nn
nn
hh
h a h a
h a h a
k f y k f y
k f y k k f y k
k f y k k f y k
Here, denotes the number of function evaluations performed at each time step and
increases with the order of accuracy of the ARK method. In each step of integration,
only
1
k ,
2
k , … are evaluated, while
1
k ,
2
k , … are reused from the previous step.
To determine the appropriate values of the parameters c ‟s and a ‟s, a three part
derivation process is performed. First, the ARK expression (2.6) is expanded using the
17
Taylor series expansion. Second, after some algebraic manipulation, this expansion is
equated to the local solution
1
()
n
t
u at
1 n
t
given by the Taylor series expansion
1
23
23
( ) ( )
( ) ( ) ( ) ( )
2! 3!
.
2! 3!
nn
n n n n
n n n n
t t h
hh
t h t t t
hh
h
uu
u u u u
y y y y
This results in a system of non-linear algebraic order equations: for 2 function
evaluations (2.7)-(2.12), for 3 function evaluations (2.15)-(2.24), for 4 function
evaluations (2.25)-(2.34), and for 5 function evaluations (2.38)-(2.55). Third, an attempt
is made to solve as many order equations as possible because the highest power of h
(step size) for which all of the order equations are satisfied is the order of accuracy of the
resulting ARK method. The above process requires a great deal of algebraic and numeric
calculations which are mainly performed using Maple (see Appendix C). The first and
second parts of this process are shown in detail for ARK3 in [40].
In the following, it is shown what order of accuracy an ARK method can achieve with a
given number of function evaluations . For 1 , a second order method ARK2 is
possible. It is, however, omitted here because such a low order of accuracy is of limited
use in accurately solving differential equations. The cases 2, ,5 are studied here.
18
For 5 , ARK5 can be created. This is the highest order possible given the form of
equations (2.6). The reason is that the number of order equations outgrows the number of
parameters when 6 function evaluations or higher are reached. Therefore, it is not
possible to satisfy all the order equations. To get around this limitation, other forms of
ARK methods are investigated. The purpose is to increase the number of parameters in
the ARK form (2.6). To see the other proposed forms, the
i
a parameters of equations
(2.6) are displayed for 6 in Butcher notation [10],
1
2
3
4
5
0
0
a
a
a
a
a
The two proposed forms are to (a) add parameters to the first column, or (b) add
parameters to the second diagonal as
1
21 2
31 3
41 4
51 5
0
0
a
aa
aa
aa
aa
, and
1
21 2
32 3
43 4
54 5
0
0
a
aa
aa
aa
aa
.
19
Unfortunately, in both cases adding parameters increases the number of order equations.
The result is that the number of order equations still surpasses the number of parameters.
Therefore, a 6th order ARK method cannot be derived with the above forms either.
2.3.1 ARK3
For 2 (function evaluations), equation (2.6) gives the 6 parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c , and
1
a . The derived order equations up to
4
() Oh
are
0
00
( ) 1, O h c c
(2.7)
1
0 1 1
( ) 1, O h c c c
(2.8)
2
0 1 2
11
( ) ,
22
O h c c c
(2.9)
3
0 2 1
15
( ) ,
12 12
O h c c a
(2.10)
42
21
1
( ) ,
3
O h c a (2.11)
42
21
( ) 0, O h c a (2.12)
Clearly, equations (2.11) and (2.12) cannot both be satisfied, so it is impossible to
achieve a 4th order method (with 2 function evaluations per time step). It is, however,
possible to achieve a 3rd order method ARK3 by satisfying equations (2.7)-(2.10). These
20
equations are solved in terms of
0
c ,
0
c
,
1
c , and
1
c
and the remaining two parameters
2
c
and
1
a become free parameters.
Free parameters of an ARK method are selected in consideration of its local error. The
local error is represented by the unsatisfied order equations. In case of ARK3, that is the
4th order equations (2.11)-(2.12), the 5th order equations (2.13)-(2.14), and higher order
ones (not included here). The closer these order equations are satisfied, the smaller the
local error. Therefore, the difference between the left and right hand sides of these order
equations is minimized if possible. This can be done in several ways. One technique is
to minimize the norm of the error of the higher order equations [19]. Another is to
minimize a bound on the error of the higher order equations [11]. A third technique is to
satisfy as many individual higher order equations as possible (hinted to by [44]).
It is not possible to know which technique yields the most accurate ARK method without
knowing the initial value problem being solved. The last technique is chosen here for
two reasons. One, it is straightforward to implement exactly. Two, for some classes of
problems, the differential term multiplying the unsolved higher order equations may
vanish, and increase the order of the method. For instance, the differential term
multiplying equation (2.12) may vanish, and provided that equation (2.11) is satisfied
using the free parameters, the resulting ARK method (with 2 function evaluations)
becomes a 4th order method.
21
Finding parameter sets that satisfy higher order equations constitutes the first level of
parameter selection employed here. In the second level of parameter selection, the sets
found in the first level are used to solve a group of standard initial value problems (see
Section 2.4). Among these sets, those that produce the most accuracte and stable ARK
methods are chosen and presented here, starting with Table 2.1, and continued in the next
three sections for ARK4, ARK4-4 and ARK5.
Using the two free parameters
2
c and
1
a , two higher order equations can be solved.
Solving (2.12) leads to an unstable or inaccurate ARK3 method. So, equation (2.11) and
one of the two 5th order equations are solved,
53
0 2 1
1 31
( ) ,
120 120
O h c c a
(2.13)
5
0
( ) 31 O h c
. (2.14)
Of the above equations, equation (2.14) cannot be chosen because to prove stability,
0
11 c
is needed (see condition (2.69)). Therefore, equations (2.13) and (2.11) are
solved, which leads to Set 2 of Table 2.1. Two sets are also presented in which
0
0 c
because doing so can increase the stability (see Section 2.7) and speed (fewer arithmetic
operations) of an ARK method. Setting
0
0 c
and solving equations (2.7)-(2.11) leads
to Set 3 of Table 2.1. Set 1 of Table 2.1 is the only set of parameters here that is not
found by solving all possible higher order equations. It is found by setting
0
0 c
,
22
solving equations (2.7)-(2.10) for
1
c ,
1
c
, and
2
c , and searching for a value of
1
a that
leads to a highly accurate ARK method in solving standard initial value problems (see
Section 2.5).
Set 1 Set 2 Set 3
0
c
1 14 2 41 1
0
c
0
13 2 41
0
1
c
1
2
91 5
62
41
47
48
1
c
1
2
19 1
62
41
1
48
2
c
1
61 3
62
41
25
48
1
a
5
12
9 1
20 20
41
4
5
Table 2.1: Selected parameters for ARK3. These are the three parameter sets found
that lead to the most accurate ARK methods (in order) in solving the standard
problems considered here.
2.3.2 ARK4
For 3 , the 8 parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c ,
3
c , and
1
a ,
2
a are given along with order
equations up to
5
() Oh which are
0
00
( ) 1, O h c c
(2.15)
1
0 1 1
( ) 1, O h c c c
(2.16)
2
0 1 2 3
11
( ) ,
22
O h c c c c
(2.17)
3
0 2 1 3 2
15
( ) ,
12 12
O h c c a c a
(2.18)
23
4 2 2
2 1 3 2
1
( ) ,
3
O h c a c a (2.19)
4
3 1 2
1
( ) ,
6
O h c a a (2.20)
5 3 3
0 2 1 3 2
1 31
( ) ,
120 120
O h c c a c a
(2.21)
52
0 3 1 2
1 31
( ) ,
240 240
O h c c a a
(2.22)
52
0 3 1 2
1 31
( ) ,
360 360
O h c c a a
(2.23)
5
0
( ) 31, O h c
(2.24)
Since there are 10 order equations up to
5
() Oh , a 5th order method cannot be achieved.
However, a 4th order method, ARK4, can be achieved by solving the first 6 order
equations (2.15)-(2.20). Therefore, ARK4 requires 3 function evaluations per time step.
These equations are solved for the c ‟s while keeping
1
a and
2
a as free parameters
because all order equations are linear in terms of the c ‟s which makes it straightforward
to solve for them. (Solving in terms of a ‟s is also attempted but does not lead to new
parameters sets.)
1
a and
2
a are used to solve two of the
5
() Oh equations for ARK4. Set 2 and Set 3 of
Table 2.2 are the two solutions when solving equations (2.21) and (2.22). Set 1 of Table
2.2 is a set in which
0
0 c
and is produced by solving equations (2.15) to (2.21).
24
Set 1 Set 2 Set 3
0
c 1.0
14 2 41 14 2 41
0
c
0.0
13 2 41 13 2 41
1
c 1.017627673204495246749635
91 5
62
41
91 5
62
41
1
c
0.01762767320449524674963508
19 1
62
41
19 1
62
41
2
c -0.1330037778097525280771293 0
61 3
12 4
41
3
c
0.6153761046052572813274942
61 9
22
41
61 3
12 4
41
1
a 0.3588861139198819376595942
9 1
40 40
41
9 1
20 20
41
2
a
0.7546602348483596232355257
9 1
20 20
41
9 1
20 20
41
Table 2.2: Selected parameters for ARK4. These are the three parameter sets found
that lead to the most accurate ARK methods (in order) in solving the standard
problems considered here.
Set 1 is a set of approximate values calculated in Maple using 25 significant digits. This
precision suffices for the accuracy tests (Section 2.5), in which the global error reaches
22
10
. If a more accurate integration is desired, the precision of the parameters should
and can easily be increased using an arbitrary-precision mathematics software such as
Maple.
2.3.3 ARK4-4
For 4 , the 10 parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c ,
3
c ,
4
c and
1
a ,
2
a ,
3
a are given. The
order equations up to
5
() Oh are
0
00
( ) 1, O h c c
(2.25)
1
0 1 1
( ) 1, O h c c c
(2.26)
25
2
0 1 2 3 4
11
( ) ,
22
O h c c c c c
(2.27)
3
0 2 1 3 2 4 3
15
( ) ,
12 12
O h c c a c a c a
(2.28)
4 2 2 2
2 1 3 2 4 3
1
( ) ,
3
O h c a c a c a (2.29)
4
3 1 2 4 2 3
1
( ) ,
6
O h c a a c a a (2.30)
5 3 3 3
0 2 1 3 2 4 3
1 31
( ) ,
120 120
O h c c a c a c a
(2.31)
5 2 2
0 3 1 2 4 2 3
1 31
( ) ,
240 240
O h c c a a c a a
(2.32)
5 2 2
0 3 1 2 4 2 3
1 31
( ) ,
360 360
O h c c a a c a a
(2.33)
5
0 4 1 2 3
1 31
()
720 720
O h c c a a a
. (2.34)
Since there are exactly 10 order equations up to
5
() Oh , it seems that a 5th order method
can be achieved. However, the only two solutions of the above order equations have
0
1 c
and
0
25 c
, both of which produce unstable methods (see condition (2.69)).
Therefore,
0
c
is set to zero which leaves the 8 parameters
1
c ,
1
c
,
2
c ,
3
c ,
4
c and
1
a ,
2
a ,
3
a . Equations (2.25)-(2.30) are solved for the c ‟s, and three of the four
5
() Oh order
equations are solved using the free parameters
1
a ,
2
a ,
3
a . The result is a 4th order
26
method called ARK4-4. Because this method satisfies more 5th order equations than
ARK4, it is expected in general to be more accurate. The „-4‟ indicates that this 4th order
method requires 4 function evaluations, unlike ARK4 which requires only 3.
Set 1 of Table 2.3 satisfies the higher order equations (2.31), (2.32), and (2.34). Set 3 of
Table 2.4 satisfies the higher order equations (2.31), (2.32), and (2.33). Set 2 of Table
2.3 satisfies the higher order equations (2.31), (2.34) and (2.36). To understand where
equation (2.36) comes from, a unique property of the
5
() Oh order equations must be
explained.
Set 1 Set 2
0
c 1.0 1.0
0
c
0.0 0.0
1
c 1.022831928839203211581411 0.9599983629740523357761292
1
c
0.02283192883920321158141016 -0.04000163702594766422386892
2
c -0.04515830188318023164196973 0.2483344505743049392964305
3
c -0.08618700613581317473462200
-0.4400290588051227299292791
4
c 0.6085133791797901947951855 0.7316962452567654548567152
1
a 0.2464189848045352027663988 0.2128076184231448037007275
2
a 0.3794276070851120107016269
0.3807586896791479391397741
3
a 0.7567561779707407028536669 0.7262085803548857317347352
Table 2.3: Selected parameters for ARK4-4. These are the three parameter sets
found that lead to the most accurate ARK methods (in order) in solving the standard
problems considered here. Continued to the next table.
27
Set 3
0
c 1.0
0
c
0.0
1
c 1.038087495003156301209584
1
c
0.03808749500315630120958582
2
c -0.1206952296752875905594747
3
c
0.4307688535040614391640197
4
c
0.1518388811680698501858681
1
a 0.2340555618293773386595766
2
a
0.7532489015566390666145791
3
a
0.7932084970935761571360267
Table 2.4: Continued from previous table.
The
5
() Oh order equations are fundamentally different than lower order equations. If the
order equations for ARK4-4 are derived with a two-dimensional coupled ODE system,
the four
5
() Oh order equations presented above are produced, i.e., equations (2.31)-
(2.34). However, if the derivation is done with a one-dimensional ODE or with a two-
dimensional un-coupled ODE system, the three
5
() Oh equations
5 3 3 3
0 2 1 3 2 4 3
1 31
( ) ,
120 120
O h c c a c a c a
(2.35)
5
0 3 1 2 1 2 4 2 3 2 3
1 31
( ) ( 2 ) ( 2 ) ,
90 90
O h c c a a a a c a a a a
(2.36)
5
0 4 1 2 3
1 31
()
720 720
O h c c a a a
, (2.37)
28
are produced. Hence, coupling of the ODE system changes the
5
() Oh order equations.
The lower order equations
0
() Oh , …,
4
() Oh don‟t change however. The difference
between the two sets of order equations is that equations (2.32) and (2.33) are replaced by
Equ. (2.36) = 2 × Equ. (2.32) + Equ. (2.33).
Therefore, a parameter set that satisfies equations (2.32) and (2.33) also automatically
satisfies equation (2.36), but not vice versa. To ensure that the order equations are valid
for all ODE systems, a two-dimensional coupled ODE system is considered in
derivations here.
Although the order equations are not derived based on a 3 or higher dimensional coupled
ODE system, it is hypothesized that the order equations would be the same as equations
(2.31)-(2.34). This hypothesis is based on two observations. One, unlike moving from a
one-dimensional system to a two-dimensional system where the coupling property
emerges, no property emerges when moving from a two-dimensional system to a three-
dimensional system, so there is no perceivable reason for the order equations to change.
Two, using a two-dimensional coupled ODE system, the same RK order equations that
others have reported are derived [19].
With that explanation it might seem counter-intuitive to use Set 2 of Table 2.3, which
satisfies equation (2.36). After all, this equation only applies to uncoupled systems.
29
However, the thinking is that for uncoupled systems, the resulting ARK4-4 becomes a
5th order method. While for coupled systems, the resulting method yields a very accurate
4th order method because it satisfies two of the four
5
() Oh equations as well as a
weighted average of the other two order equations. This is confirmed by the numerical
examples; in solving standard problems (see Section 2.5), the accuracy of Set 2 is
comparable to that of Set 1 and Set 3.
2.3.4 ARK5
For 5 , the 12 parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c ,
3
c ,
4
c ,
5
c and
1
a ,
2
a ,
3
a ,
4
a are given.
The 18 order equations up to
6
() Oh are
0
00
( ) 1, O h c c
(2.38)
1
0 1 1
( ) 1, O h c c c
(2.39)
2
0 1 2 3 4 5
11
( ) ,
22
O h c c c c c c
(2.40)
3
0 2 1 3 2 4 3 5 4
15
( ) ,
12 12
O h c c a c a c a c a
(2.41)
4 2 2 2 2
2 1 3 2 4 3 5 4
1
( ) ,
3
O h c a c a c a c a (2.42)
4
3 1 2 4 2 3 5 3 4
1
( ) ,
6
O h c a a c a a c a a (2.43)
5 3 3 3 3
0 2 1 3 2 4 3 5 4
1 31
( ) ,
120 120
O h c c a c a c a c a
(2.44)
30
5 2 2 2
0 3 1 2 4 2 3 5 3 4
1 31
( ) ,
240 240
O h c c a a c a a c a a
(2.45)
5 2 2 2
0 3 1 2 4 2 3 5 3 4
1 31
( ) ,
360 360
O h c c a a c a a c a a
(2.46)
5
0 4 1 2 3 5 2 3 4
1 31
( ) ,
720 720
O h c c a a a c a a a
(2.47)
6 4 4 4 4
2 1 3 2 4 3 5 4
1
( ) ,
5
O h c a c a c a c a (2.48)
6 3 3 3
3 1 2 4 2 3 5 3 4
1
( ) ,
10
O h c a a c a a c a a (2.49)
6 3 3 3
3 1 2 4 2 3 5 3 4
1
( ) ,
20
O h c a a c a a c a a (2.50)
6 2 2 2 2 2 2
3 1 2 4 2 3 5 3 4
1
( ) ,
15
O h c a a c a a c a a (2.51)
6 2 2
4 1 2 3 5 2 3 4
1
( ) ,
40
O h c a a a c a a a (2.52)
6 2 2
4 1 2 3 5 2 3 4
1
( ) ,
60
O h c a a a c a a a (2.53)
6 2 2
4 1 2 3 5 2 3 4
1
( ) ,
30
O h c a a a c a a a (2.54)
6
5 1 2 3 4
1
( ) ,
120
O h c a a a a (2.55)
Solving the first 10 equations (2.38)-(2.47) gives a 5th order method ARK5 which
requires 5 function evaluations per time step. The first 8 equations are solved for the c ‟s
and equations (2.46)-(2.49) are solved for
1
a , …,
4
a . Among the multiple solutions of
31
this system, Set 3 in Table 2.6 is found to be the most accurate in solving the standard
problems considered here (see Section 2.5). Setting
0
0 c
results in 10 parameters and
9 equations of order up to
5
() Oh . The one free parameter is used to solve equation
(2.48) which leads to numerous solutions. Among them, Set 1 and Set 2 in Table 2.5 are
the most accurate in solving the standard problems.
Set 1 Set 2
0
c 1.0 1.0
0
c
0.0 0.0
1
c 1.055562151371698936588996 0.8478186116157917768882525
1
c
0.05556215137169893658900796 -0.1521813883842082231117544
2
c -0.1550782654901811342349442 0.6342482224050582872925060
3
c
0.4259247085606290911168454
0.05195876382507141388229794
4
c
0.1103009310583581269934950 -0.2591900995514652090764061
5
c
0.06329047449949497953556305 0.2251645017055437310133241
1
a 0.2163443321009561697260889 0.9710149514386938952585686
2
a
0.7355421089142943499801371
-0.2556103146331869004586566
3
a
0.7046395852850716386939335 1.094599542270692490195102
4
a
0.9355121795946884014328140 0.4343167743876224145420328
Table 2.5: Selected parameters for ARK5. These are the three parameter sets found
that lead to the most accurate ARK methods (in order) in solving the standard
problems considered here. Continued to the next table.
32
Set 3
0
c 1.871204587171582065174140
0
c
0.8712045871715820651713061
1
c 0.2696466886663821637128020
1
c
0.1408512758379642288874380
2
c 0.3158759465556997630808750
3
c
0.3212830748049407866018770
4
c
0.1591061035393050004573704
5
c
-0.001514107152118746437838297
1
a 0.5094586945643958664798805
2
a
0.5161588401001171574027862
3
a
1.041695566100089398625120
4
a
2.134538676833492640695294
Table 2.6: Continued from previous table.
2.4 Standard Test Problems
In the next two sections, the accuracy and speed of the ARK methods are demonstrated
by solving a set of standard initial value problems. The problem definitions are given in
Appendix A. How these problems are chosen is described below.
Ideally, the test problems should come from a published source in the numerical
integration literature and used by authors for testing their methods. The only major
attempt at this seems to be Hull et. al. [30]. This test framework is updated as [21] and
[22], which keeps the same problems, but adds some stiff and discontinuous problems.
This set, often called the DETEST set, has been used as a standard set by the numerical
integration community. Krogh [33] also proposes a set a year later, but it has not been
33
used by nearly as many authors. There does not seem to be any other new non-stiff
problem set available, and to this day, most authors such as [45], [1], [41], [17], and [38]
use the set in [21]. The question of whether a new set of non-stiff test problems exits is
posed in the NA Digest mailing list [37]. The respondents who include researchers in the
field of numerical analysis name only the two sets [31] and [33] which are already known
to the author.
The recent sets such as [31], and [27] exist for stiff problems. However, they are not
used here because explicit methods, such as ARK, are not suitable for solving stiff
problems. Implicit methods are nearly always preferred. The Indam set [31] contains
one non-stiff problem, but it is a gravitational problem, and four gravitational problems
are included in the set of test problems.
For these reasons, most of the problems used here are from Hull et. al. [21]. Two of them
(P4 and P7) are also used in the paper that introduces the Matlab RK solvers [46]. In the
original paper, Hull et. al. [30] state their criteria for choosing their problems as:
1. A broad spectrum of problem types.
2. Non-stiff problems which pose no major difficulty such as discontinuity, round-
off, and startup.
3. Reasonably realistic and representative problems.
34
These criteria are adopted to add two problems here. One is a non-autonomous problem
used in the paper that introduces the ARK methods [40]. The other is the same as the 2
body problem of [21] but with zero eccentricity. This problem is included because its
stability does not change throughout the orbit of its solution. In comparison, the two
body problem with 0.9 eccentricity (which is included in the set), has varying stability
throughout the orbit. This difference in stability characteristics of the two problems
causes a visible difference in the accuracy of their numerical solution given by constant
step size integrators, and is presented in the next section.
2.5 Accuracy
In this section, six standard (see previous section) non-stiff Initial Value Problems (IVP)
are solved to illustrate the accuracy of the ARK methods. These problems are named P1,
P4, P6, P7, P9, and P12, and are listed in Appendix A. Their dimensions range from 1 to
30. One problem is non-autonomous (P1), and one is linear (P9). The rest are
autonomous non-linear problems.
The ARK3, ARK4, ARK4-4, and ARK5 methods are used to solve each problem. For
comparison, the RK2, RK3, RK4, and RK5 methods are also used to solve these
problems. These solutions are referred to as the “approximate” solution. The integration
is done for 0 20 t [21], at seven different step sizes, 0.001, 0.0025, 0.005, 0.01,
0.025, 0.05, and 0.1. Each ARK method is started with an RK method of the same order.
35
For ARK methods, Set 1 parameter values of Table 2.1 through Table 2.6 are used, and
for RK methods, the parameter values in Table 2.7 and Table 2.8 are used.
0
0
1
3
1
3
0
1
2
1
2
2
3
1
3
1
1
2
1
2
3
4
0
3
4
1 1 -1 1
0 1
2
9
1
3
4
9
1
8
3
8
3
8
1
8
(a) (b) (c)
Table 2.7: Parameters for (a) RK2, (b) RK3, and (c) RK4 in Butcher's notation [10].
These RK methods are used as a reference to gauge the performance of ARK
methods. Continued to the next table.
0
1
4
1
4
1
4
1
8
1
8
1
2
0
1
2
1
3
4
3
16
0 0
9
16
1
3
7
2
7
12
7
12
7
8
7
7
90
0
32
90
12
90
32
90
7
90
Table 2.8: Continued from the previous table.
To find the integration error, the exact solution of the problems is needed. For some of
the problems considered here a closed form solution exists and is used to calculate the
exact solution. For the rest of the IVPs the solution of RK6 with a step size of 0.0001 is
used as the “exact” solution.
The accuracy plots are given in Figure 2.2 through Figure 2.10. The Average of the 2-
Norm of the Global Error for each problem (except P6), given by
36
2
1
1
()
N
nn
n
ANGE t
N
yy (2.56)
is plotted along the ordinate. Note that the error in the initial point is not included
because the error is zero. For P6 (2 body problem with eccentricity 0), the Averaged
Absolute value of Global Error is plotted for each component separately, i.e.,
1
1
()
N
i i i
nn
n
AAGE y y t
N
for 1, ,4 i , (2.57)
which gives a more detailed look at the error.
In addition to the accuracy measurements above, measurements with a different set of
integration parameters are also performed. The changes are as follows. An integration
time span of 0 15 t is used. The average of the error is taken in 10 15 t . The
ARK methods‟ startup procedure is done with 10 steps of RK methods with 1/10th the
step size. (This gives a more accurate starting value for ARK methods at a small
additional computational cost). The resulting accuracy plots are similar to the plots
presented below.
In the case of small step sizes (such as 0.001) and high order methods (such as ARK5),
the integration error falls below
16
10
. This is beyond Matlab‟s precision ability because
it provides at most 16 significant digits of precision (for double precision arithmetic).
This causes the plot lines produced by Matlab to be erroneous; they are jagged lines with
37
slopes different than the order of the method. That is why the PARI mathematics
environment [39], which provides 28 digits of precision, is used for all calculations in this
section.
Figure 2.2: Accuracy plot for P1 (scalar non-autonomous problem) using log-log
scale. The term ANGE is defined in equation (2.56). The RK methods are shown
by lines with circles, and the ARK methods by lines with squares. Lines of the same
color correspond to methods with the same number of function evaluations per time
step. This plot shows that generally ARK methods are more accurate than RK
methods of equal number of function evaluations (see Table 2.9).
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-20
10
-16
10
-12
10
-8
10
-4
Time Step Size, h
ANGE
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
38
Figure 2.3: Accuracy plot for P4 (Euler rigid body problem). See caption of Figure
2.2.
Figure 2.4: Accuracy plot for component
1
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See caption of Figure 2.2.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-17
10
-13
10
-9
10
-5
10
-1
Time Step Size, h
ANGE
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-17
10
-13
10
-9
10
-5
10
-1
Time Step Size, h
AAGE y
1
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
39
Figure 2.5: Accuracy plot for component
2
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See caption of Figure 2.2.
Figure 2.6: Accuracy plot for component
3
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See caption of Figure 2.2.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-17
10
-13
10
-9
10
-5
10
-1
Time Step Size, h
AAGE y
2
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-17
10
-13
10
-9
10
-5
10
-1
Time Step Size, h
AAGE y
3
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
40
Figure 2.7: Accuracy plot for component
4
y of P6 (2 body problem with
eccentricity 0). AAGE is defined in equation (2.57). See caption of Figure 2.2.
Figure 2.8: Accuracy plot for P7 (2 body problem with eccentricity 0.9). See
caption of Figure 2.2.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-17
10
-13
10
-9
10
-5
10
-1
Time Step Size, h
AAGE y
4
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-8
10
-6
10
-4
10
-2
10
0
10
2
Time Step Size, h
ANGE
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
41
Figure 2.9: Accuracy plot for P9 (radioactive problem (10 dimensional)). See
caption of Figure 2.2.
Figure 2.10: Accuracy plot for P12 (5 planet problem (30 dimensional)). See
caption of Figure 2.2.
The slopes of the plot lines confirm the order of the ARK methods; the slopes of ARK3,
ARK4, ARK4-4, and ARK5 lines are 3, 4, 4, and 5, respectively. The exception is P7
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-19
10
-15
10
-11
10
-7
10
-3
Time Step Size, h
ANGE
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-23
10
-18
10
-13
10
-8
10
-3
Time Step Size, h
ANGE
RK2
ARK3
RK3
ARK4
RK4
ARK4-4
RK5
ARK5
42
(Figure 2.8) at large step sizes because of instability when the revolving body passes
close to the fixed body. In Chapter 4, it is seen how variable step size methods deal with
this difficulty by reducing the step size in times of instability.
The slope of the ARK5 lines for the multi-dimensional problems are especially
important. It is hypothesized in Section 2.3.3 that although the
5
() Oh order equations
are derived based on a two-dimensional ODE system, they apply to higher dimensional
problems as well. The fact that problems P4, P6, P7, P9, and P12 (Figure 2.3 to Figure
2.10) are 3-dimensional or higher, and their ARK5 accuracy plot lines have slope 5 (for
small step sizes) supports this hypothesis.
The advantage of ARK methods is evident when comparing them with RK methods of
equal number of function evaluations. Table 2.9 summarizes the order and number of
function evaluations for the ARK and RK methods. When comparing ARK3 vs. RK2,
ARK4 vs. RK3, and ARK4-4 vs. RK4 in the accuracy plots (for small step sizes), ARK
methods prove to be more accurate (in most cases).
RK2 ARK3 RK3 ARK4 RK4 ARK4-4 RK5 ARK5
No. of function
evaluations
2 2 3 3 4 4 6 5
Table 2.9: Order of accuracy and number of function evaluations per time step for
RK and ARK methods. This table shows that ARK methods are more efficient than
RK methods (in most cases).
43
Furthermore, because the ARK3 and ARK4 methods are higher order than the RK2 and
RK3 methods, respectively, their gain in accuracy grows as the step size decreases. For
example, for P6 (see Figure 2.4) at step size 0.1, ARK3 and ARK4 are about ten times
more accurate than RK2 and RK3, respectively, but at step size 0.001, they are
3
10 and
4
10 times more accurate than RK2 and RK3, respectively. A similar gain of accuracy
can occur even for ARK4-4 vs. RK4 when for some problems (e.g., P9), ARK4-4
becomes a 5th order method.
For variable step size methods (Chapter 4) the step size can become as small as
14
10
for
small error tolerances. The accuracy advantage of ARK methods at small step sizes
(mentioned above) inspires the creation of variable step size ARK4 method to compete
with the corresponding RK3 method of Matlab (implemented as ODE23).
2.6 Speed
In this section, the speed of execution of the ARK methods is assessed. For comparison,
the execution time for ARK3, ARK4, RK2, and RK3 are measured here for solving the
standard problems (except P12 due to lengthy execution time), time span, step sizes, and
parameter values as in the previous section. The integration is repeated 100 times and the
average execution time is used to calculate the ratio
ARK RK
TT . The execution time is
measured using Matlab‟s profile utility.
44
Figure 2.11 to Figure 2.15 display this ratio, which represents the increase in execution
time of ARK methods compared with RK methods, on the horizontal axis. (The data for
these plots are included in Appendix B.) On the vertical axis, the error ratio
RK ARK
ANGE ANGE (recall definition (2.56)), which represents the increase in accuracy
of the ARK methods compared with RK methods, is displayed. The points are plotted in
order of increasing step size. The top-left point corresponds to the smallest, and the
bottom-right point corresponds to the largest step size.
Figure 2.11: The accuracy and execution time of ARK and RK methods in solving
P1 (scalar non-autonomous problem) are compared here. This plot shows that for a
little more time, ARK methods are much more accurate.
1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18
10
0
10
1
10
2
10
3
Increase in Time
Increase in Accuracy
ARK3 vs RK2
ARK4 vs RK3
45
Figure 2.12: The accuracy and execution time of ARK and RK methods in solving
P4 (Euler problem) are compared here. This plot shows that for a little more time,
ARK methods are much more accurate.
Figure 2.13: The accuracy and execution time of ARK and RK methods in solving
P6 (2 body problem with eccentricity 0) are compared here. This plot shows that for
a little more time, ARK methods are much more accurate.
1.04 1.06 1.08 1.1 1.12 1.14 1.16
10
0
10
1
10
2
10
3
10
4
Increase in Time
Increase in Accuracy
ARK3 vs RK2
ARK4 vs RK3
1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.1
10
0
10
1
10
2
10
3
10
4
Increase in Time
Increase in Accuracy
ARK3 vs RK2
ARK4 vs RK3
46
Figure 2.14: The accuracy and execution time of ARK and RK methods in solving
P7 (2 body problem with eccentricity 0.9) are compared here. This plot shows that
for a little more time, ARK methods are much more accurate.
Figure 2.15: The accuracy and execution time of ARK and RK methods in solving
P9 (radioactive problem) are compared here. This plot shows that for a little more
time, ARK methods are much more accurate.
1.02 1.04 1.06 1.08 1.1 1.12
10
-1
10
0
10
1
10
2
Increase in Time
Increase in Accuracy
ARK3 vs RK2
ARK4 vs RK3
1 1.02 1.04 1.06 1.08 1.1 1.12
10
0
10
1
10
2
10
3
Increase in Time
Increase in Accuracy
ARK3 vs RK2
ARK4 vs RK3
47
The first result seen in the plots is that these ARK methods are slower than RK methods
even though they cost the same number of function evaluations. The reason is that ARK
methods have a higher arithmetic overhead cost (compare ARK3 and RK2 formulas in
Section 2.2). It is shown that the relative higher arithmetic overhead cost of ARK
methods is mainly due to two operations: (a) additional multipliactions and additions for
evaluating
1 n
y , and (b) assignment operations to set
11
,,
n
yk to
1
,,
n
yk [49]. It is
surprising that an assignment operation which should presumably be the fastest operation
in Matlab could take a long time to evaluate. However, that‟s what is found. Based on
this observation (and other experiences working with Matlab) it is recommended that any
presumptions about Matlab‟s computation performance be tested.
The plots show that for a small increase in execution time, ARK3 and ARK4, can be far
more accurate than RK2 and RK3, respectively. For example, in the case of P9 (Figure
2.15), for 7% more time than RK3, ARK4 gives a solution that is 10 times more accurate.
Furthermore, as the step size reduces, this advantage becomes even more pronounced.
For example, again in the case of P9, for a step size of 0.001 (the left-most point in the
plot), ARK4 and RK3 take equally as long, but ARK4 is 300 times more accurate than
RK3.
The observation that as these ARK methods become more accurate relative to RK
methods, they need even less extra time may seem surprising. Note however that the
increase in time is neither the cause nor the effect of the increase in accuracy. Both are
48
effects of step size. The ARK methods‟ accuracy increases with decreasing step size
simply because they are higher order methods. The amount of extra time they need drops
because as the number of steps increases the effect of ARK methods‟ extra computational
cost at the first step diminishes in comparison.
To see the effect of number of steps on the increase in time, consider the following.
The total execution time of ARK methods can be written as ( 1)
ARK
start per step
T T T N ,
where
start
T and
ARK
per step
T denote the extra execution time spent on the first step and the time
spent per step, respectively, and N denotes the number of steps. Then, the ratio of
execution times of ARK methods over RK methods can be written as
( 1)
1
ARK ARK ARK
startup per step startup per step per step
RK RK RK
per step per step per step
T T N T T T
T N N T T
,
which reduces as the number of steps increases.
The clear advantage of the constant step size ARK4 over RK3 leads to the belief that the
variable step size ARK4 method can also have an advantage over the variable step size
RK3 method of Matlab. This matter is investigated in Chapter 4.
49
2.7 Stability
It is established that the error of an ARKp method over a single time step (local error) is
of
1
()
p
Oh
(see Section 2.1). In this section, how this error accumulates over many time
steps (global error) is looked at by studying stability and convergence.
By stability, it is roughly meant that small changes to initial conditions and method result
in small changes in the numerical solution. Computation error causes small changes in
the initial conditions and method, which is not desired to greatly affect the solution.
Hence, the numerical method should be stable. Stability and accuracy are not separate,
but intertwined. An unstable method cannot produce an accurate solution. That is why
stability is studied.
Closely related to stability is convergence which indicates whether and how quickly the
numerical solution can converge to the exact solution (see Theorem 2.2 for exact
definition). A major difference between convergence and stability is the following.
Convergence looks at the difference between the numerical solution and the exact
solution. Stability looks at the difference between two numerical solutions. Often when
people talk about the behavior of the numerical solution compared with the exact solution
they use the term “stability”. The more correct term however, is “convergence”.
In this section, the stability of the numerical method is dealt with, which is different than
the stability of the problem. A problem may be considered stable (by some) if the
50
difference of two solutions (with different initial conditions) reduces with time
(considered by some to be aymptotic stablility), e.g., yy . Conversely, a problem
may be considered unstable if the difference of two solutions increases with time, e.g.,
yy [24]. Alternately, some consider a problem stable (loosely speaking) if solutions
that are close at one point do not spread apart substantially thereafter, and unstable if they
do [44]. There‟s also a definition of well-posedness that is very similar to stability. A
problem is said to be well-posed if “small” changes to the initial conditions and the
differential equation result in “small” changes to the solution [44].
A more precise definition of stability (and “small” changes mentioned above) of the
solution of an initial value problem (given with slight variations in works such as [16],
[42], [28]) is the following. A solution () t y of the IVP given by (2.1) which is defined
for 0 t is said to be stable if, given any 0 , there exists a 0 such that any
solution ˆ() t y of the system satisfying ˆ (0) (0) yy satisfies ˆ ( ) ( ) tt yy for
0 t . The solution () t y is said to be asymptotically stable if, in addition to being stable,
ˆ ( ) ( ) 0 tt yy as 0 t .
It is easy to see how stability can affect the global error. With every local error
committed by the numerical method, the numerical solution differs from the local
solution in every step. Instability can cause these local errors to add up and so the
numerical solution can diverge from the global solution. However, it may not be easy to
51
see how stability can affect the local error because only one local error is committed over
one step. Stability can affect the local error through the computational error. This error
changes the initial conditions and the method, and instability can amplify these changes
and so increase the local error.
It is not possible to completely and exactly determine the stability of a numerical solution
because it ultimately depends on the problem which in general is non-linear. However,
two measures of stability are often used to give a rough indication of stability. These
measures are simple enough to be analyzed, but general enough to be useful:
1. D-stability stands for Germund Dahlquist, and is also known as zero stability or
small step size stability. D-stability provides a bound on the difference between
two numerical solutions of any problem (see Theorem 2.1 for exact definition).
2. A-stability stands for Absolute stability, and is also known as large step size
stability. A-stability provides a region in which the difference between two
numerical solutions of a “test problem” does not increase.
Note the strength and weakness of the above measures relative to each other. D-stability
applies to any problem, but can only show that the difference between two solutions is
finite. A-stability can show that the difference actually does not increase, but it only
applies to the test problem.
52
2.7.1 D-stability
The ARK method given by expression (2.6) yields a set of approximate solutions
n
y ,
2 nN , to the initial value problem (2.3) and can be written as
1 00 1 1 1 1
2
1
nn i i i
i
nn
cc c c c
yy II k k k k
yy I 0
0
(2.58)
for 11 nN , where I is an l by l identity matrix. Equation (2.58) can be written as
1
( , , )
n n n
h
y By φ y f for 11 nN , (2.59)
where
1
1
n
n
n
y
y
y
,
1
n
n
n
y
y
y
,
B is the 2l by 2l block matrix given by
00
cc
II
B
I 0
, (2.60)
and φ is the 2l by 1 vector defined by
53
1 1 1 1
2
i i i
i
c c c
φ k k k k
φ
0
0
.
Now, consider a slightly different initial condition
0 0 0
zy Δ at time
0
t , a slightly
different approximate solution
1 1 1
zy Δ at time
1
t , and a slightly different recipe
( , , )
nn
hh φ z f δ (1 1) nN . Thus, the ARK methods yield a "perturbed"
approximate solution
n
z (2 ) nN , which can be written as
1 00 1 1 1 1
2
1
nn n i i i
i
nn
cc c c c
h
zz II δ k k k k
zz I00
0
for 11 nN , or as
1
( , , )
n n n n
hh
z Bz φ z f δ for 11 nN , (2.61)
where
n
n
δ
δ
0
.
To prove D-stability, it is shown that under some conditions,
nn
zy is bounded. To
prove convergence, it is shown that ( ) 0
nn
t
yy as 0 h , where ()
n
t y is the exact
54
solution of the problem. The following stability analysis, which is inspired by [44, Ch.
5], comprises of two lemmas and two theorems.
In Lemma 2.1, the eigenvalue problem for the matrix Q is considered.
In Lemma 2.2, the function φ is shown to be Lipschitz continuous.
In Theorem 2.1, D-stability for ARK methods is established by showing that the
difference of equations (2.59) and (2.61) is bounded.
In Theorem 2.2, convergence for ARK methods is proved using the result of
Theorem 2.1.
2.7.1.1 Lemma 2.1
The eigenvalue problem for the matrix B given in equation (2.60) is written as
BW WD . (2.62)
If
0
11 c
, the matrix W is nonsingular and satisfies
1
1
W BW , (2.63)
2 W , (2.64)
55
1
0
2
:
1
w
c
W , (2.65)
where here and throughout the stability analysis, all norms denote the infinity norm
.
Proof Taking
0
c
II
W
II
,
0
c
I
D
I
0
0
, (2.66)
and using the
0
() Oh order equation,
00
1 cc
, equation (2.62) is satisfied. Since
0 1
0
1
1
c
c
II
W
II
, (2.67)
it is required that
0
1 c
for
1
W to exist. Recalling that
, it can be written
1
0
max(absolute row sum) max(1, ) c
W BW D . (2.68)
With the condition
0
11 c
, (2.69)
56
it can be seen from equation (2.68) that
1
1
W BW . Condition (2.69) and expression
(2.66) lead to
0
max(1 ,2) 2 c
W ,
which along with expression (2.67) results in
1
0
00
12
: max(1 ,2)
11
wc
cc
W .
Thus, Lemma 2.1 is proved. □
2.7.1.2 Lemma 2.2
If f is a Lipschitz continuous function so that
( ) ( )
n n n n
L f z f y z y for a constant L , and any
n
z ,
n
y , (1 ) nN
then, so is φ , i.e.,
ˆ
( ) ( )
n n n n
L φ z φ y z y for a constant
ˆ
L , and any
n
z ,
n
y , (1 ) nN ,
where
1
ˆ
()
i i i
i
L c c
,
1
1
j j j
L h a
, and
1
L .
57
Proof First, it is shown by induction that
( ) ( )
i n i n i n n
h k z k y z y for a constant
i
(1 ) iv , (2.70)
where it is recalled that
, and that v is the number of function evaluations of the
ARK method. Also, here and throughout this proof, 1 nN .
For 1 i ,
1 1 1
( ) ( ) ( ) ( )
n n n n n n n n
h h hL h k z k y f z f y z y z y ,
where
1
L . Assuming inequality (2.70) is true for ij , it can be written
11
1
( ) ( ) ( ( )) ( ( ))
( ( ) ( ))
1
,
j n j n n j j n n j j n
n n j j n j n
n n j j n n
j j n n
j n n
h a h a
hL a
hL a h
hL h a
h
k z k y f z k z f y k y
z y k z k y
z y z y
zy
zy
where
1
1
j j j
L h a
. (2.71)
58
Hence, inequality (2.70) holds for 1 j , and therefore it holds for 1 iv . Similarly,
1 1 1 1
( ) ( )
i n i n i n n
h
k z k y z y for 1 iv . (2.72)
Function φ can be written as
1 1 1 1
2
11
11
()
where for 2
.
i i i
i
i i i i i i
ii
c c c
c c c c i
φ k k k k
kk
φφ
Using inequality (2.70) leads to
11
11
1
1
( ) ( ) ( ) ( )
( ) ( )
.
n n i i n i i n
ii
i i n i n
i
i i n n
i
cc
c
hc
φ z φ y k z k y
k z k y
zy
Similarly, using inequality (2.72), it can be shown that
1 1 1 1 1 1
1
( ) ( )
n n i i n n
i
hc
φ z φ y z y .
59
It can be written then
1 1 1 1 1 1
1 1 1 1 1 1
11
11
( ) ( ) ( ) ( )
max( ( ) ( ) ,0)
( ) ( )
( ) ( ) ( ( ) ( ))
( ) ( ) ( ) ( )
.
n n n n
nn
nn
n n n n
n n n n
i i n n i i n n
ii
h c h c
φ z φ y φ z φ y
φ z φ y
φ z φ y
φ z φ z φ y φ y
φ z φ y φ z φ y
z y z y
Because
11
max( , )
n n n n n n
z y z y z y , it can be written
n n n n
z y z y , and
11 n n n n
z y z y .
Therefore,
11
( ) ( )
ˆ
,
n n i i i i n n
ii
nn
h c c
hL
φ z φ y z y
zy
where
1
ˆ
()
i i i
i
L c c
. (2.73)
Thus, Lemma 2.2 is proved. □
60
2.7.1.3 Theorem 2.1
Suppose that an ARK method is used to solve the initial value problem given in equation
(2.3), and that f is a Lipschitz continuous function throughout the integration span. If
0
11 c
, the ARK method is D-stable, and
0,1 1
max max ,max
n n r r m
r m n
E
z y z y δ (2.74)
for 2 nN ,
where
1
ˆ
2 ( )
1
4 e max( ,1)
n
Lw t t
n
E w t t
, (2.75)
1
ˆ
()
i i i
i
L c c
,
1
1
j j j
L h a
,
1
L , and
0
2
1
w
c
.
Proof Subtracting equation (2.61) from equation (2.59) results in
11
( ) ( , , ) ( , , )
n n n n n n n
h h h
z y B z y φ z f φ y f δ for 11 nN .
This equation is multiplied by
1
W to get
1 1 1 1
11
( ) ( ) [ ( , , ) ( , , )]
n n n n n n n
h h h
W z y W B z y W φ z f φ y f W δ .
61
Letting
1
()
n n n
d W z y so that ()
n n n
Wd z y for 2 nN , (2.76)
leads to
1 1 1
1
[ ( , , ) ( , , )]
n n n n n
h h h
d W BWd W φ z f φ y f W δ .
Taking the infinity norm and using the Lipschitz condition on φ (Lemma 2.2) it can be
written
1 1 1
1
ˆ
n n n n n
hL h
d W BW d W z y W δ for 11 nN .
Considering expressions (2.63) and (2.65), the above inequality becomes
1
ˆ
n n n n n
hLw hw
d d z y δ . (2.77)
Also, using expression (2.76) and (2.64) leads to
2
n n n n n
z y Wd W d d , (2.78)
so inequality (2.77) becomes
1
ˆ
(1 2 )
n n n
hLw hw
dd δ for 11 nN . (2.79)
62
Relation (2.79) establishes a bound on
1 n
d based on
n
d . This is not very useful
because it is not known how large
n
d is. Instead, it is desired to find a bound based on
1
d . It is shown by induction that this bound is
11
1
ˆˆ
2 ( ) 2 ( )
1
1
ee
n n m
n
Lw t t Lw t t
nm
m
hw
dd δ for 2 nN . (2.80)
In the following, the inequality
1 1 e
t
t for 0 t ,
is used, which follows from the expression
2
1
2
e1
t
tt . For 2 n , the right hand
side of inequality (2.80) becomes
2 1 2 2
ˆˆ ˆ
2 ( ) 2 ( ) 2
1 1 1 1
e e e
Lw t t Lw t t Lwh
hw hw
d δ d δ . (2.81)
Inequality (2.79) can be written as
11
ˆ
(1 2 )
n n n
hLw hw
dd δ for 2 nN ,
which for 2 n becomes
63
2 1 1
ˆ
2
11
ˆ
(1 2 )
e.
Lwh
hLw hw
hw
dd δ
d δ
(2.82)
Comparing expressions (2.82) and (2.81), shows that inequality (2.80) holds for 2 n .
Assuming it holds for nk , inequality (2.79) leads to
11
1
1
ˆˆ ˆ
2 ( ) 2 ( ) 2
1
1
ˆ
(1 2 )
e e e .
k k m
k k k
k
Lw t t Lw t t hLw
mk
m
hLw hw
hw hw
dd δ
d δδ
Since for any r ,
1
()
k r k r
h t t t t
, it can be written
1 1 1 1 1 1
1 1 1 1
1
ˆ ˆ ˆ
2 ( ) 2 ( ) 2 ( )
11
1
ˆˆ
2 ( ) 2 ( )
1
1
e e e
e e for 1 1.
k k m k k
k k m
k
Lw t t Lw t t Lw t t
k m k
m
k
Lw t t Lw t t
m
m
hw hw
hw k N
dd δδ
d δ
Therefore, inequality (2.80) holds for 1 k , and by induction it holds for 2 nN .
64
Inequality (2.80) can be simplified by writing
11
12
11
11
1
1
ˆˆ
2 ( ) 2 ( )
1
1
ˆˆ
2 ( ) 2 ( )
1
1
ˆˆ
2 ( ) 2 ( )
1
1
ˆˆ
2 ( ) 2 ( ) 1
1 1 1
1
ˆ
2 ( )
ee
e e ( 1) max
e e ( 1) max
e ( ) e ( ) max
e
n n m
nn
nn
nn
n
n
Lw t t Lw t t
nm
m
Lw t t Lw t t
m
mn
Lw t t Lw t t
m
mn
Lw t t Lw t t
nm
mn
Lw t t
hw
hw n
hw n
w t t
dd δ
d δ
d δ
W z y δ
1
1
1 1 1
1
ˆ
2 ( )
1 1 1 1
1
ˆ
2 ( )
1 1 1
1
( ) ( ) max
e max( ,1) ( ) max( ,1) max
2 e max( ,1) max ( ) ,max .
n
n
nm
mn
Lw t t
n n m
mn
Lw t t
nm
mn
w t t
w t t t t
w t t
zy δ
zy δ
zy δ
Using inequality (2.78) leads to
1
ˆ
2 ( )
1 1 1
1
4 e max( ,1)max ( ) ,max .
n
Lw t t
n n n m
mn
w t t
z y z y δ
Since
n n n n
z y z y , and
mm
δδ , it can be written
0,1 1
max max ( ) ,max
n n r r m
r m n
E
z y z y δ (2.83)
for 2 nN ,
where
1
ˆ
2 ( )
1
4 e max( ,1)
n
Lw t t
n
E w t t
. (2.84)
65
Hence, D-stability of ARK methods is established, and Theorem 2.1 is proved. □
It is shown that the difference between the approximate solution and perturbed solution
of the ARK methods is bounded. That is what D-stability for a numerical method means.
This bound can be used as a measure of stability, and it is instructive to look at what it
depends on.
1. The perturbations in the initial condition
0
y and the startup value
1
y (supplied by
a one-step method), given by
0,1
max
r r r
zy .
2. The perturbation in the ARK method‟s formula,
m
h δ .
3. The ARK integration time span,
1 n
tt .
4. The constants
ˆ
L and w , which depend on the step size h and the parameters of
the ARK method.
It is equally instructive to note what the bound does not depend on, the order of the
method. The method can be of any order (low or high), and D-stability (in the sense of
the above bound) would not be affected. D-stability is not significantly affected by the
step size either. Even as the step size approaches zero, the bound stays finite, and still
depends on the items listed above.
66
The above observations are a result of the fact that D-stability relates the approximate
solution to the perturbed solution, not to the exact solution. The latter is done through
convergence (see next theorem).
2.7.1.4 Theorem 2.2
Consider an ARKp method that is used to solve the initial value problem (2.3), where f
is a sufficiently smooth Lipschitz continuous function throughout the integration span. If
0
11 c
and the approximate solution
1
y at time
1
t is accurate to ()
q
Oh , the ARKp
method is convergent to order min( , ) pq , and
( ) max ( ), ( )
pq
nn
t E O h O h yy for 2 nN , (2.85)
where
1
ˆ
2 ( )
1
4 e max( ,1)
n
Lw t t
n
E w t t
.
In particular, ( ) 0
nn
t yy as 0 h .
Proof Consider again the approximate solution
n
y (2 ) nN and the perturbed
solution
n
z (2 ) nN of the ARKp method given by
1 0 0 1 1
( , , , ) for 1 1
n n n n n
c c h n N
y y y φ y y f , (2.86)
67
1 0 0 1 1
( , , , ) for 1 1
n n n n n n
c c h h n N
z z z φ z z f δ , (2.87)
where
0 0 0
zy Δ ,
1 1 1
zy Δ , and
n
z ‟s recipe is perturbed by
n
h δ . The truncation
error
*
n
h δ is defined as the difference between the exact and approximate solutions at the
end of the current step if the method is provided with the exact solution at the beginning
of the current and previous steps. Therefore, the exact solution ()
n
t y satisfies
*
1 0 0 1 1
( ) ( ) ( ) ( ( ), ( ), , )
n n n n n n
t c t c t t t h h
y y y φ y y f δ . (2.88)
It is now shown that ()
n
t y (2 ) nN can be considered a perturbed solution
n
z of the
ARK method.
For 1 n ,
2 0 1 0 0 1 0
( , , , ) c c h
y y y φ y y f , (2.89)
2 0 1 0 0 1 0 1
( , , , ) c c h h
z z z φ z z f δ , (2.90)
*
2 0 1 0 0 1 0 1
( ) ( ) ( ) ( ( ), ( ), , ) t c t c t t t h h
y y y φ y y f δ . (2.91)
68
Setting
0 0 0
*
1 1 1 1
*
11
( ) ,
( ) ,
,
t
t
z y y
z y y
δδ
Δ
and considering equations (2.90) and (2.91) leads to
22
() t zy . Similarly, setting
*
nn
δδ for 11 nN , and considering equations (2.87) and (2.88) leads to ()
nn
t zy
for 2 nN .
Since the same assumptions as Theorem 2.1 are made, relation (2.74) holds, and it can be
written
*
11
1
( ) max ( ) ,max
n n m
mn
t E t
y y y y δ for 2 nN .
For ARKp,
*
()
p
m
Oh δ . The approximate solution
1
y at time
1
t is supplied by a one-
step method such as RK. If
1
y is accurate of order q , i.e.,
11
( ) ( )
q
t O h yy , the
above inequality shows the convergence of the ARKp method of order min( , ) pq , i.e.,
( ) max ( ), ( )
pq
nn
t E O h O h yy for 2 nN . (2.92)
In particular, ( ) 0
nn
t yy as 0 h , and Theorem 2.2 is proved. □
69
Unlike the stability bound of Theorem 2.1, the convergence bound depends significantly
on the step size through the truncation error
*
n
δ . As the step size goes to zero, so does the
global error ()
nn
t yy .
2.7.2 A-stability
To get a rough guide on the behavior of the method in solving a general problem, the
solution of the scalar test problem yy is investigated, where is a complex
number. After some simplification using the order equations, the ARK method‟s solution
of this problem becomes
11
1 0 0 0 0 22
1
1 (3 )( ) (1 )( )
10
nn
nn
yy c c h S c c h S
yy
, (2.93)
where for ARK3,
2
0
1
(5 )( )
12
S c h
,
for ARK4,
23
0
11
(5 )( ) ( )
12 6
S c h h
,
for ARK4-4,
70
2 3 4
0 4 1 2 3
11
(5 )( ) ( ) ( )
12 6
S c h h c a a a h
,
and for ARK5,
2 3 4 5
0 0 5 1 2 3 4
1 1 1
(5 )( ) ( ) (31 )( ) ( )
12 6 720
S c h h c h c a a a a h
.
For a different numerical solution
n
z , all the y ‟s are replaced with z ‟s in equation
(2.93). Taking the difference between these equations, and denoting the difference
e y z leads to
11
1 0 0 0 0 22
1
1 (3 )( ) (1 )( )
10
nn
nn
ee c c h S c c h S
ee
. (2.94)
For A-stability, it is required that the difference
n
e does not increase as the integration
goes on. This is equivalent to requiring that the maximum modulus of the eigenvalues of
the matrix in the above equation be smaller than or equal to 1. It is clear from the above
equations that the stability region of ARK3 and ARK4 depends only on
0
c
, but the
stability of ARK4-4 and ARK5 depends also on the products
4 1 2 3
c a a a and
5 1 2 3 4
c a a a a ,
respectively.
Figure 2.16 to Figure 2.19 show the stability regions of ARK and RK methods produced
in this way. In all the plots (but the last) methods of equal number of function
71
evaluations are compared just as is done in the accuracy and speed comparisons. The
curves represent the points at which the computed maximum modulus of the eigenvalues
equals 1. All of the stability plots here are produced numerically, so only a finite region
of the complex plane can be checked to find a stability region. In the plots here, the
region 5 Re( ) 1 h and 0 Im( ) 5 h is checked. The region of stability is the area
enclosed by the curves and the real axis. Because these curves are symmetric about the
real axis, only the top half is shown. The plots show that the ARK methods‟ stability
regions are somewhat smaller than those of the corresponding RK methods, i.e., ARK3
vs. RK2, ARK4 vs. RK3, ARK4-4 vs. RK4, and ARK5 vs. RK5. Recall that A-stability
is only a rough guide, and it can fail to accurately describe stablity for a general problem
(see for instance the discussion on problem P8 in Section 4.8).
An alternate interpretation of A-stability is the following. On the left half plane of the
stability plot, the exact solution of the test problem decreases. Because the matrices in
equations (2.93) and (2.94) are the same, a reduction in
n
e implies a reduction in
n
y .
Therefore, inside the stability region, the numerical solution decreases. So, A-stability
provides a region in the left-half plane in which the numerical solution qualitatively
agrees with the exact solution (both are decreasing). On the other hand, outside the
stability region, on the left half plane, the two solutions do not qualitatively agree (one
increases, and the other decreases), and thus the method is unstable.
72
Figure 2.16: Stability region of ARK3 (with parameter sets of Table 2.1), and RK2.
This plot shows that ARK3‟s stability region is practically the same size as RK2‟s.
Figure 2.17: Stability region of ARK4 (with parameter sets of Table 2.2), and RK3.
This plot shows that ARK4‟s stability region is smaller than but comparable to
RK3‟s.
-2.5 -2 -1.5 -1 -0.5 0 0.5
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Re( h)
Im( h)
ARK3 Sets 1,3
ARK3 Set 2
RK2
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5
0
0.5
1
1.5
2
2.5
Re( h)
Im( h)
ARK4 Set 1
ARK4 Sets 2 & 3
RK3
73
Figure 2.18: Stability region of ARK4-4 (with parameter sets of Table 2.3), and
RK4. This plot shows that ARK4-4‟s stability region is smaller than but comparable
to RK4‟s.
Figure 2.19: Stability region of ARK5 (with parameter sets of Table 2.5), and RK5
(with parameter set of Table 2.8). This plot shows that ARK5‟s stability region is
smaller than but comparable to RK5‟s.
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5
0
0.5
1
1.5
2
2.5
3
Re( h)
Im( h)
ARK4-4 Set 1 & 2
ARK4-4 Set 3
RK4
-3.5 -3 -2.5 -2 -1.5 -1 -0.5 0 0.5
0
0.5
1
1.5
2
2.5
3
3.5
Re( h)
Im( h)
ARK5 Set 1
ARK5 Set 2
ARK5 Set 3
RK5
74
2.8 Summary
A new set of constant step size numerical integration schemes, named Accelerated
Runge-Kutta (ARK) methods, are developed for the numerical integration of initial value
problems described by ordinary differential equations. A detailed treatment of these
methods is presented, which is missing in previous work on similar multistep methods. It
includes motivation, derivation, parameter selection, accuracy, speed, stability and
convergence studies. The main conclusions are as follows.
1. The simplicity of the ARK method formulas makes them simple to derive and
select parameter for. The ARK methods benefit from a precise parameter
selection technique that increases their order of accuracy for some problems.
Three sets of parameters are provided for ARK3, ARK4, ARK4-4, and ARK5
methods.
2. The ARK methods are two-step which allows them to reuse function evaluations
and be more efficient than the one-step RK methods. This two-step structure is
designed in a simple form to reduce computational cost and simplify its parameter
selection. Specifically, ARK3 and RK2 both cost 2 function evaluations, and
ARK4 and RK3 both cost 3 function evaluations.
75
3. Convergence and stability is proved for ARK methods given some conditions.
Convergence (not stability) states that as the step size approaches zero, so does
the global error. The stability regions of ARK methods are also presented.
4. Numerical examples show that for a little more execution time (up to 18%),
ARK3 and ARK4 give solutions that are far more accurate (up to 4000 times)
than RK2 and RK3, respectively. This inspires development of a variable step
size ARK method to compete with the variable step size RK method of Matlab
(implemented as ODE23), which is taken up in Chapter 4.
76
CHAPTER 3 - CONSTANT STEP SIZE NON-AUTONOMOUS ARK METHODS
The Accelerated Runge-Kutta (ARK) methods presented in Chapter 2 are in autonomous
form. Non-autonomous problems must be converted to autonomous form before they can
be solved using these methods. In this chapter, the non-autonomous form of the ARK
methods are presented which eliminates this requirement. This chapter shows that the
non-autonomous ARK methods have the same accuracy as the autonomous methods
within rounding error, but are faster. In addition, the non-autonomous ARK methods are
proved to be stable and convergent under the same conditions as the autonomous ARK
methods. Numerical examples are used to assess the accuracy and speed of these
methods (in comparison with the RK methods).
3.1 Introduction
Initial value problems can be divided into two categories: autonomous and non-
autonomous. In a non-autonomous problem, the differential equation depends explicitly
on the independent variable, i.e.,
0
00
d ( )
( , ( )),
d
( ) ,
N
t
t t t t t
t
t
y
fy
yy
(3.1)
where
77
1
()
()
()
l
yt
t
yt
y ,
1
( , ( ))
( , ( ))
( , ( ))
l
f t t
tt
f t t
y
fy
y
,
and t denotes the independent variable, time. In the above, the superscripts denote the
index of differential equation, not power. Starting from this chapter, non-autonomous
initial value problems are the main concern. Therefore, unlike Chapter 2, from this point
on, tildes are used to denote the autonomous problem, not the non-autonomous.
The ARK methods in Chapter 2 are designed to solve problems in autonomous form
because doing so simplifies their derivation. This is common practice in developing
numerical integrators. However, to the author‟s knowledge, the effects of this decision
have not been closely studied. It is merely assumed that the autonomous form of the
problem is supplied and leads to the same approximate solution as the non-autonomous
form would. In this chapter, a new form of the ARK formulas is presented that can solve
non-autonomous problems directly, thereby eliminating the need to modify the problem.
The differences between these methods are investigated here.
In Section 3.4, two standard non-autonomous problems are used to verify that the
approximate solution of the autonomous and non-autonomous forms of the ARK methods
are equal within accumulated rounding error. In Section 3.5, the same problems help to
illustrate that the speed of the non-autonomous ARK methods (relative to RK methods) is
equal to or higher than the speed of the autonomous ARK methods (relative to RK
78
methods). In Section 3.6, the non-autonomous ARK methods are proved to be stable and
convergent under the same conditions as the autonomous ARK methods. In Section 3.7,
a summary of this chapter is given.
3.2 Derivation
To solve a non-autonomous initial value problem using the autonomous ARK methods
presented in Chapter 2, the problem must first be converted to autonomous form. The
non-autonomous problem of equation (3.1) is converted to autonomous form by adding to
it the differential equation for
1
( ) :
l
y t t
, which is
1
11
11
0 0 0
d ( )
( ( ), ( )) 1,
d
( ) .
l
ll
ll
yt
f y t t
t
y t y t
y
(3.2)
The result is the ( 1) l -dimensional system of autonomous differential equations given
by
1
1
d ( )
( ( ), ( ))
d
d ( ) 1
d
l
l
t
y t t
t
yt
t
y
fy
. (3.3)
79
Using the dual notation for a function of several variables, i.e.,
1
1
()
( ( ), ( ))
()
l
l
t
y t t
yt
y
f y f , (3.4)
where f on both sides is the same l element vector, and setting
1
()
()
()
l
t
t
yt
y
y , and
( ( ))
( ( ))
1
t
t
fy
fy , (3.5)
equation (3.3) can be written in autonomous form as
0
00
d ( )
( ( )),
d
( ) ,
N
t
t t t t
t
t
y
fy
yy
(3.6)
where
0
0
0
t
y
y . (3.7)
In the following, the autonomous ARK methods developed in Chapter 2 are applied to
the autonomous problem given by equation (3.6). After manipulating the resulting
equations, the non-autonomous form of the ARK methods are derived, thus illustrating
the equivalence of the autonomous and non-autonomous forms of the ARK methods.
80
Recall from Chapter 2 that the approximate solution,
1
1 1
1
l
y
y
y
at time
1
t must be supplied by a one-step method such as an RK method. Since the right
hand side of differential equation (3.2) is constant, the RK and ARK methods are
expected to solve it exactly and produce
1 l
nn
yt
. This is now shown explicitly.
The RK methods approximate the solution of the autonomous IVP (3.6) by
1
1
n n i i
i
c
y y k , where
1
1
( , )
i
i n i n ij j
j
h t d h a
k f y k .
The
i
c ,
i
d , and
ij
a are parameters of the RK methods, and is the number of function
evaluations per time step. The last equation in the above system of equations is
11
1
1
ll
n n i
i
y y h c
.
All RK methods must satisfy
1
1
i
i
c
[19], therefore
11
1
ll
nn
y y h
. (3.8)
81
For 0 n , using the initial condition of equation (3.2) leads to
11
1 0 0 1
ll
y y h t h t
. (3.9)
Therefore, the RK methods produce the exact solution (within rounding error) of
equation (3.2) at
1
t .
An autonomous ARK method approximates the solution ()
n
t y of equation (3.6) by
n
y
for 2 nN , which can be written as
1
n
n l
n
y
y
y . (3.10)
The autonomous ARK methods presented in Chapter 2 have the form
1 0 0 1 1 1 1 1 1 1
2
( ) ( ) ( ) ( )
n n n n n i i n i n
i
c c c c c
y y y k y k y k y k y (3.11)
for 11 nN , where
1
2 1 1
5 4 4
( ),
( ),
( ),
n
n
n
h
ha
ha
k f y
k f y k
k f y k
11
2 1 1 1
5 1 4 4
( ),
( ),
( ).
n
n
n
h
ha
ha
k f y
k f y k
k f y k
(3.12)
82
Using equations (3.5) and (3.10), equation (3.11) can be written as
1
11 11
0 0 1 1 1 1 1 1
11
1 1
111
1
nn
n n n ll
nn l l l
n n n
nn i
ill
i n n
hh
c c c y c y
y y y
hh
h a h
c y y h
h
yy
y y y f f
yy k
ff
1
1
2
.
i
i
i
a
h
h
k
(3.13)
The last equation of the above system is
1 1 1
1 0 0 1 1 1
()
l l l
n n n
y c y c y h c c
for 11 nN . (3.14)
For 1 n , using equations (3.2) and (3.9), the above equation becomes
1 1 1
2 0 1 0 0 1 1
0 1 0 1 1 1
0 0 1 0 1 1
()
( ) ( )
( ) ( ).
l l l
y c y c y h c c
c t c t h h c c
c c t h c c c
(3.15)
Using the
0
() Oh order equation (2.7),
00
1 cc
, and the
1
() Oh order equation (2.8),
0 1 1
1 c c c
, equation (3.15) becomes
1
2 1 2
l
y t h t
.
83
Now, assuming
1
11
l
kk
yt
and
1
1
l
k k k
y t t h
, equation (3.14) becomes for nk ,
1
1 0 0 1 1 1
0 0 1 1
0 0 0 1 1
1
()
( ) ( )
( ) ( )
.
l
k k k
kk
k
kk
y c t c t h c c
c t c t h h c c
c c t h c c c
t h t
Therefore by induction,
11
()
ll
n n n
y t y t
for 1 nN , which is the exact solution (in
absence of round-off error) of equation (3.2), and equation (3.10) becomes
n
n
n
t
y
y . (3.16)
Equation (3.13) therefore becomes
1
11
0 0 1 1 1
11
1 1 1 1 1
1 1 1
nn
n n n
nn
n n n
n i i n i i
i n i n i
hh
c c c t c t
t t t
hh
aa
hh
c t a h t a h
h
yy
y y y f f
y k y k
ff
2
.
i
h
The above equation shows that the autonomous approximate solution
1 n
y comprises of
the non-autonomous approximate solution
1 n
y and
1 n
t
. Using again the dual notation
84
for a function of several variables (3.4), the first l equations of the above formula can be
written as
1 0 0 1 1 1 1 1
1 1 1 1 1 1 1 1
2
( , ) ( , )
( , ) ( , ) .
n n n n n n n
i n i n i i n i n i i
i
c c c h t c h t
c h t a h a h t a h a
y y y f y f y
f y k f y k
Using the ARK notation of equation (3.11), the above equation can be written as
1 0 0 1 1 1 1 1 1 1
11
2
( , ) ( , )
( , ) ( , )
n n n n n n n
i i n n i n n
i
c c c t c t
c t t
y y y k y k y
k y k y
(3.17)
for 11 nN , where
1
2 1 1 1
5 4 4 4
( , ),
( , ),
( , ),
nn
nn
nn
ht
h t a h a
h t a h a
k f y
k f y k
k f y k
1 1 1
2 1 1 1 1 1
5 1 4 1 4 4
( , ),
( , ),
( , ).
nn
nn
nn
ht
h t a h a
h t a h a
k f y
k f y k
k f y k
(3.18)
The above equation is therefore the non-autonomous form of the ARK methods. It shows
that the approximate solution
1 n
y of the autonomous and non-autonomous ARK
methods are the same if no round-off error occurs in the computation of
n
t . Hence, the
order equations for the autonomous and non-autonomous ARK methods are the same.
85
Consequently, the ARK3, ARK4, ARK4-4, and ARK5 methods and their three sets of
parameter sets (given in Chapter 2) now apply to the non-autonomous form.
The non-autonomous ARK methods (given by (3.17) and (3.18)) do not solve for t
themselves. They must be supplied with t , which can simply be done by the equation
1nn
t t h
. The autonomous ARK methods however, do solve for t themselves
because
1 l
yt
is one component of their solution. So, the method of calculation of t is
different in the autonomous and non-autonomous methods. Therefore, because of
computational error, the value of t is different in the autonomous and non-autonomous
methods.
Furthermore, because the solution components
1
y to
l
y are computed at time t , their
values are different in the autonomous and non-autonomous methods. In the next
section, the effects of this round-off error are shown through numerical examples.
3.3 Standard Test Problems
Some standard initial value problems are used in Chapter 2 to assess the accuracy of the
autonomous ARK methods. In the next section, a similar study is made for the non-
autonomous ARK methods. Four non-autonomous problems are used for this purpose.
One (P1) is the scalar non-autonomous problem of Chapter 2. Two (P2 & P3) are
problems from the standard set [21]. Because [21] does not have high dimensional non-
86
autonomous problems, one (P10) is created here (see Appendix A) by adding time-
dependent terms to the radioactive problem of [21] which is used in Chapter 2.
3.4 Accuracy
The problems are solved for the same time span and step sizes as in Chapter 2. The
parameter values used are also the same. The Average Norm of the Global Error (2.56)
for two problems, P2 and P3, is plotted in Figure 3.1 to Figure 3.4. Similar to Chapter 2,
due to insufficient precision of Matlab, the PARI mathematics environment is used for all
calculations.
Figure 3.1: Accuracy plot for P2 (oscillatory problem) solved in autonomous form.
The RK methods are designated by circles while ARK methods are designated by
squares. Lines of the same color denote methods with the same number of function
evaluations per time step. These plots show that the non-autonomous and
autonomous methods‟ solutions are virtually the same.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-18
10
-14
10
-10
10
-6
10
-2
Time Step Size, h
ANGE
ARK3
ARK4
ARK4-4
ARK5
RK2
RK3
RK4
RK5
87
Figure 3.2: Accuracy plot for P2 (oscillatory problem) solved in non-autonomous
form. See caption of Figure 3.2.
Figure 3.3: Accuracy plot for P3 (Duffing‟s problem) solved in autonomous form.
See caption of Figure 3.2.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-18
10
-14
10
-10
10
-6
10
-2
Time Step Size, h
ANGE
ARK3
ARK4
ARK4-4
ARK5
RK2
RK3
RK4
RK5
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-15
10
-10
10
-5
Time Step Size, h
ANGE
ARK3
ARK4
ARK4-4
ARK5
RK2
RK3
RK4
RK5
88
Figure 3.4: Accuracy plot for P3 (Duffing‟s problem) solved in non-autonomous
form. See caption of Figure 3.2.
The accuracy plots of the non-autonomous and autonomous approximate solutions for the
two problems look identical. This is also the case for the other problems, so their plots
are not included for brevity. However, as expected in the previous section, the two
approximate solutions differ due to accumulated rounding errors in computation. This
difference is too small to make the plots distinguishable, but it is evident in numbers. For
example, for ARK4 solving P3 (Duffing problem) at a step size of 0.001, the errors
shown in Table 3.1 are produced.
0.001 0.0025 0.005 0.01 0.025 0.05 0.1
10
-15
10
-10
10
-5
Time Step Size, h
ANGE
ARK3
ARK4
ARK4-4
ARK5
RK2
RK3
RK4
RK5
89
ANGE
Non-autonomous
1.355872839153304214033803154
12
10
Autonomous
1.355872839153688811939061475
12
10
Table 3.1: An example of error produced by non-autonomous and autonomous ARK
methods. This table shows that these errors are slightly different, which is due to
numerical rounding error.
3.5 Speed
The speed of constant step size autonomous ARK methods are assessed in relation to
their accuracy in Chapter 2. In this section, this asssessment is made for the non-
autonomous ARK methods.
ARK3, ARK4, RK2, and RK3 are used to solve the same problems, for the same time
span, and step sizes as the previous section. The integration is repeated 100 times and the
average execution time (measured by Matlab‟s profile utility) is used to calculate the
ratio
ARK RK
TT . Figure 3.5 to Figure 3.8 display this ratio, which represents the increase
in execution time of ARK methods compared with RK methods, on the horizontal axis.
On the vertical axis, the error ratio
RK ARK
ANGE ANGE , which represents the increase in
accuracy of the ARK methods compared with RK methods, is displayed. The results for
the autonomous ARK methods (denoted by (A) in the plots) are also plotted for
comparison.
90
Figure 3.5: The accuracy and execution time of non-autonomous ARK and RK
methods in solving P1 (scalar non-autonomous problem) are compared here. Here,
(A) denotes autonomous and (NA) denotes non-autonomous methods. This plot
shows that for little more time, the non-autonomous ARK methods are much more
accurate than RK methods. See Appendix A for definition of problem.
Figure 3.6: The accuracy and execution time of non-autonomous ARK and RK
methods in solving P2 (oscillatory problem) are compared here. See caption of
Figure 3.5.
1 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18
10
0
10
1
10
2
10
3
Increase in Time
Increase in Accuracy
ARK3 vs RK2 (A)
ARK4 vs RK3 (A)
ARK3 vs RK2 (NA)
ARK4 vs RK3 (NA)
1 1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18
10
0
10
1
10
2
10
3
10
4
Increase in Time
Increase in Accuracy
ARK3 vs RK2 (A)
ARK4 vs RK3 (A)
ARK3 vs RK2 (NA)
ARK4 vs RK3 (NA)
91
Figure 3.7: The accuracy and execution time of non-autonomous ARK and RK
methods in solving P3 (Duffing problem) are compared here. See caption of Figure
3.5.
Figure 3.8: The accuracy and execution time of non-autonomous ARK and RK
methods in solving P10 (radioactive problem) are compared here. See caption of
Figure 3.5.
1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18
10
-1
10
0
10
1
10
2
10
3
Increase in Time
Increase in Accuracy
ARK3 vs RK2 (A)
ARK4 vs RK3 (A)
ARK3 vs RK2 (NA)
ARK4 vs RK3 (NA)
0.98 1 1.02 1.04 1.06 1.08 1.1 1.12 1.14
10
0
10
1
10
2
10
3
Increase in Time
Increase in Accuracy
ARK3 vs RK2 (A)
ARK4 vs RK3 (A)
ARK3 vs RK2 (NA)
ARK4 vs RK3 (NA)
92
These plots give a similar result to the autonomous case. For a small increase in
execution time, the non-autonomous ARK3 and ARK4 methods, give much higher
accuracy than RK2 and RK3, respectively. In fact, for two problems (P1 and P2), the
non-autonomous ARK methods provide higher accuracy for even less extra computation
times than the autonomous case.
The plot for problem P10 suggests that for the smallest step size the autonomous ARK3
and ARK4 methods run faster than RK2 and RK3, respectively. This is rather surprising
because as mentioned before, ARK methods need to perform more arithmetic
computations per step than RK methods of equal number of function evaluations.
However, execution time measurements in Matlab change from one run to another.
Some time measurements for the smallest step size for the P10 problem lead to plots that
show the ARK3 and ARK4 methods to be slower than RK2 and RK3. Furthermore, it
may be possible that due to the way Matlab works internally, the ARK methods can run
slightly faster when solving linear problems such as P10.
3.6 Stability
In the next section D-stability and convergence of the non-autonomous ARK methods for
is proved under certain conditions. In Section 3.6.2, the A-stability region of the non-
autonomous ARK methods is presented.
93
3.6.1 D-stability
The non-autonomous ARK methods given by expression (3.17) yield the approximate
solution
n
y for 2 nN to the non-autonomous problem given by equation (3.1) and
can be written as
1 0 0 1 1
( , , , )
n n n n n
c c h
y y y φ y y f for 11 nN ,
where
1 1 1 1
2
()
i i i
i
c c c
φ k k k k .
With a perturbed initial condition
0 0 0
zy Δ , a perturbed approximate solution
1 1 1
zy Δ at time
1
t , and a perturbed recipe
1
( , , , )
n n n
hh
φ z z f δ , the non-autonomous
ARK methods yield a perturbed approximate solution
n
z for 2 nN and can be
written as
1 0 0 1 1
( , , , )
n n n n n n
c c h h
z z z φ z z f δ for 11 nN .
3.6.1.1 Theorem 3.1
Suppose that a non-autonomous ARK method (3.17) is used to solve the non-autonomous
initial value problem given by equation (3.1) and that ( , ( )) tt fy is a Lipschitz continuous
94
function throughout the integration span. If
0
11 c
, the non-autonomous ARK
method is D-stable, and
0,1 1
max max , max
n n r r m
r m n
E
z y z y δ
for 2 nN , where here and throughout,
, and
1
ˆ
2
1
4 e max( )
n
Lw t t
n
E w t t
,
0
2
1
w
c
, and
ˆ
L is a constant.
Proof The autonomous ARK methods given by expression (3.11) yield the approximate
solution
n
y for 2 nN to the autonomous initial value problem given by equation
(3.6) and can be written as
1 0 0 1 1
( , , , )
n n n n n
c c h
y y y φ y y f for 11 nN ,
where
1 1 1 1
2
()
i i i
i
c c c
φ k k k k .
95
The autonomous ARK methods yield the perturbed approximate solution
1
n
n l
n
z
z
z for 2 nN , (3.19)
given the perturbed initial condition
0 0 0
zy Δ , where
0
0 1
0
Δ
l
Δ
Δ , (3.20)
and the perturbed approximate solution
1 1 1
zy Δ , at time
1
t , where
1
1 1
1
Δ
m
Δ
Δ , (3.21)
and the perturbed recipe
1
( , , , )
n n n
hh
φ z z f δ , where
1
n
n l
n
δ
δ
δ . (3.22)
The autonomous ARK methods can then be written as
1 0 0 1 1
( , , , )
n n n n n n
c c h h
z z z φ z z f δ for 11 nN .
96
Recalling that norms denote the infinity norm, it follows from equations (3.16) and (3.19)
that
1
max ,
l
n n n n n n n n
zt
z y z y z y . (3.23)
Also, it follows from (3.22) that
1
max( , ).
l
n n n
δδ (3.24)
It is shown in Theorem 2.1 that if the assumptions of Theorem 3.1 are true for an
autonomous problem, the autonomous ARK method is D-stable, and
0,1 1
max max ,max
n n r r m
r m n
E
z y z y δ , (3.25)
where
1
ˆ
2
1
4 e max( )
n
Lw t t
n
E w t t
,
0
2
1
w
c
, and
ˆ
L is a constant.
Using equations (3.20), (3.21), (3.23), and (3.24), equation (3.25) becomes
1
0,1 1
max max( , ),max( , )
l
n n r r r r r
r r n
E
z y z y δ .
97
As stated in Section 3.2, the non-autonomous problem does not solve for time, hence
0
r
for 0,1 r , and
1
0
m
r
for 1, , 1 rn .
Therefore,
0,1 1
max max( ),max( )
n n r r r
r r n
E
z y z y δ .
Hence, D-stability for non-autonomous ARK methods is established, and Theorem 3.1 is
proved. □
Next, convergence is established. Recall that, the truncation error is the error committed
in approximating the exact solution at the end of the current step, given exact data.
Therefore, the truncation error
*
n
h δ of the non-autonomous ARK methods and the exact
solution () t y of the non-autonomous problem given by equation (3.1) satisfy the
equation.
*
1 0 0 1 1
( ) ( ) ( ) ( ( ), ( ), , )
n n n n n n
t c t c t t t h h
y y y φ y y f δ
98
3.6.1.2 Theorem 3.2
Suppose a non-autonomous ARKp method is used to solve the non-autonomous initial
value problem (3.1), where ( , ( )) tt fy is a sufficiently smooth Lipschitz continuous
function throughout the integration span. If
0
11 c
and the approximate solution
1
y
at time
1
t is accurate to ()
q
Oh , the non-autonomous ARKp method is convergent to
order min( , ) pq , and
( ) max ( ), ( )
qp
nn
t E O h O h yy ,
where
1
ˆ
2
1
4 e max( )
n
Lw t t
n
E w t t
,
0
2
1
w
c
, and
ˆ
L is a constant.
In particular, ( ) 0
nn
t yy as 0 h .
Proof The truncation error
*
n
h δ and the exact solution () t y of the autonomous IVP
given by equation (3.6) satisfy the equation
*
1 0 0 1 1
( ) ( ) ( ) ( ( ), ( ), , )
n n n n n n
t c t c t t t h h
y y y φ y y f δ ,
where
99
()
()
n
n
n
t
t
t
y
y .
Therefore,
( ) max ( ) ,0 ( )
n n n n n n
t t t y y y y y y . (3.26)
It is shown in Theorem 2.2 that if the assumptions of this theorem are valid for an
autonomous problem, the autonomous ARK method is convergent, and
( ) max ( ), ( )
qp
nn
t E O h O h yy , (3.27)
where
1
ˆ
2
1
4 e max( )
n
Lw t t
n
E w t t
,
0
2
1
w
c
, and
ˆ
L is a constant.
Using equation (3.26), equation (3.27) becomes
( ) max ( ), ( )
qp
nn
t E O h O h yy .
In particular, ( ) 0
nn
t yy as 0 h . Therefore, convergence is established for non-
autonomous ARK methods, and Theorem 3.2 is proved. □
100
3.6.2 A-stability
The region of A-stability for the autonomous ARK methods is presented in Section 2.7.2.
This region is produced by looking at the approximate solution of the problem yy ,
where is a complex number. Since this problem is autonomous, the approximate
solution produced by the non-autonomous ARK methods is the same as the approximate
solution produced by the autonomous ARK methods. Therefore, the stability regions of
the two methods are identical.
3.7 Summary
In this section, the non-autonomous form of the ARK methods is presented that can solve
non-autonomous initial value problems without the need for converting them to
autonomous form. The following properties of the non-autonomous ARK are deduced.
1. Altering a non-autonomous problem to autonomous form increases the
complexity and the effort needed to implement the problem. The non-
autonomous ARK methods proposed herein avoid this difficulty by solving the
non-autonomous problem directly. In the absence of computational rounding
error, the autonomous and non-autonomous ARK methods produce the same
approximate solution to an initial value problem.
101
2. The non-autonomous ARK methods are proved to be stable and convergent under
the same conditions as the autonomous ARK methods. In addition, their stability
regions are the same.
3. Similar to the autonomous case, the non-autonomous ARK3 and ARK4 methods
give a far more accurate solution than the RK2 and RK3 methods, respectively for
a small increase in computation time.
102
CHAPTER 4 - VARIABLE STEP SIZE ARK METHODS
The Accelerated Runge-Kutta (ARK) methods presented in Chapters 2 and 3 are constant
step size methods. They form a prelude to the main result of this study, the variable step
size ARK methods. A full analysis of these methods is presented in this chapter. The
equations of a 4th order variable step size method with error control named ARK34 is
given here and its parameters are chosen. D-stability and convergence for the variable
step size ARK methods are proved, and their A-stability regions are given. Numerical
examples are used to show that ARK34 can be 10 times more accurate and up to 4 times
faster than ODE23 of Matlab. ARK34 can even be 10 times more accurate than ODE45
of Matlab.
4.1 Introduction
Although constant step size methods have their uses (such as real time simulation),
variable step size methods are much more useful and widely used for the solution of
differential equations. This is because these methods keep the integration error within a
given tolerance by adjusting the step size. Chapter 2 shows that the constant step size 3rd
and 4th order ARK methods are slightly slower than the 2nd and 3rd order RK methods
(which cost the same number of function evaluations), respectively, but they give
solutions that are much more accurate. This makes variable step size ARK methods
103
promising because if a method is more accurate then it can take larger steps and therefore
can take fewer steps which would then leverage its speed.
This chapter begins by developing variable step size ARK3 and ARK4 methods in
Section 4.2. In Section 4.3, these methods are combined to form an error control and step
size selection scheme. In Section 4.2.3, the selection of parameters for the ARK34
method is given. In Section 4.4, the reasons for developing ARK34 and comparing it
with RK23 of Matlab are explained. In Section 4.5, the basis by which the set of standard
problems are chosen are described. Using these standard problems, the accuracy of
ARK34 is assessed in Section 4.7. Using the same problems, the speed of ARK34 is
illustrated in Section 4.10. In Section 4.8, an explanation of “limiting precision” is given,
and in Section 4.9, a brief description of stiffness is presented. In Section 4.11, an
interpolation scheme is developed for the variable step size ARK methods. A proof of D-
stability and convergence of the ARK34 method under certain conditions is presented and
its A-stability regions are shown in Section 4.12. The chapter ends with a summary, and
included in the appendix are the detailed statistics of the numerical experiments, and the
flowchart of the ARK34 Matlab program.
104
4.2 Derivation
The general non-autonomous initial value problem (IVP) is again considered here, i.e.,
0
00
d ( )
( , ( )),
d
( ) ,
N
t
t t t t t
t
t
y
fy
yy
(4.1)
where () t y and ( , ( )) tt fy are l -dimensional vectors, and t denotes the independent
variable, time. Recall that the true solution of this IVP is denoted by ()
n
t y , and the
approximate solution by
n
y . At step 1 n , the solution
1
()
n
t
y at time
1 n
t
is
approximated by
1 n
y . A variable step size method adjusts the step size
1 n n n
h t t
,
(0 1) nN to satisfy the given error tolerance.
Recall that the local error
11
()
n n n
t
le u y is the error made in approximating the local
solution
1
()
n
t
u , and the global error
11
()
n n n
t
ge y y is the cumulative effect of the
local error.
The variable step size ARK methods proposed here have the form
1 0 0 1
2
n n n i i i i
i
c c c c
y y y k k (4.2)
for 11 nN , where
105
1
2 1 1 1
3 2 2 2
( , ),
( , ),
( , ),
n n n
n n n n
n n n n
ht
h t a h a
h t a h a
k f y
k f y k
k f y k
1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 2 1 1 2 2
( , ),
( , ),
( , ).
n n n
n n n n
n n n n
ht
h t a h a
h t a h a
k f y
k f y k
k f y k
The parameters
i
c and
i
a need to be appropriately chosen for a specific ARK method.
Recall that denotes the number of function evaluations per step. At every step, only
i
k
need to be evaluated while
i
k are reused from the previous step (see Figure 4.1).
The ARK formulas involve the step sizes of the current and previous steps
1
,
nn
hh
,
respectively. Therefore, the order equations involve these step sizes. Because the step
size generally changes at every step, the order equations change at every step and have to
be solved at every step. This would make the variable step size ARK methods too
computationally intensive, and so non-competative compared to other methods. To
overcome this roadblock, an effective technique is employed. The order equations are
written in terms of the step size ratio
n
r , which makes possible the solution of the order
equations for any step size (see next section).
106
Figure 4.1: This diagram illustrates the central idea of the ARK methods similar to
Figure 2.1 but for the variable step size case.
The simplicity of the proposed numerical scheme described by equation (4.2) has the
following advantages.
1. It produces a set of order equations with an aesthetic appearance. They can be
derived by hand calculation using Taylor series, though the results here are
obtained using Maple because of their algebraically intensive nature.
2. It places a low overhead cost (the computations other than function evaluations)
when computing the approximate solution
1 n
y .
3. It makes the search for an “embedded” pair a trivial problem.
y
t
n-2
t
n-1
t
n
t
n+1
t
n+2
k
-1
k
-2
k
1
k
2
k
-1
k
-2
k
1
k
2
k
-1
k
-2
k
1
k
2
step n
step n+1
step n+2
1 n
h
n
h
y
n+2
y
n+1
y
n
y
n-1
y
n-2
107
4.2.1 ARK3
For 2 , the parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c ,
2
c
, and
1
a are given. The order equations
up to
3
()
n
Oh are the following.
0
00
( ) 1
n
O h c c
, (4.3)
12
0 1 1 2
( ) (1 )
n n n n n
O h c c r c c r r r
, (4.4)
2
22 0
1 2 1
( ) (1 )
22
n
n n n n
cr
O h c c r a r r
, (4.5)
3
33 0
1 2 1
( ) (2 1)
33
n
nn
cr
O h c c r a
, (4.6)
33
22
()
nn
O h c c r
, (4.7)
where
2
c ,
1
a , and
n
r are assumed to be non-zero. The order equations are given in terms
of the
i
c ,
1
a , and the step size ratio
1
n
n
n
h
r
h
, (4.8)
which in general changes at every step. Therefore, the
i
c ‟s change at every step (
1
a is
held constant), and are more accurately denoted by
n
i
c . This being understood, the
subscript n is dropped here for brevity.
108
In Section 4.3, it is shown that the ARK3 method is used for estimating the local error
and not for advancing the integration step. ARK3 does not need to be very accurate, just
simple and stable. Through numerical experiments, this is found best done by setting
0
0 c
. Solving the order equations for the
i
c leads to
32
1 1 1 1
1
1
311
1
1
2
1
3
22
2 4 (6 2) 6 3
,
6 (1 )
2( 1) 4 3
,
6 (1 )
23
,
6 (1 )
.
n n n
n
n
n
n
n
n
n
a r a r a r a
c
ar
a r a
cr
ar
r
c
ar
c r c
(4.9)
As seen from equations (4.9), all
i
c ‟s are explicitly expressed in terms of the free
parameter
1
0 a and the step size ratio
n
r . Therefore, they need to be recalculated at
every step.
4.2.2 ARK4
For 3 , the parameters
0
c ,
0
c
,
1
c ,
1
c
,
2
c ,
2
c
,
3
c ,
3
c
,
1
a , and
2
a are given. The
order equations up to
4
()
n
Oh are
0
00
( ) 1
n
O h c c
, (4.10)
13
0 1 1 2 3
( ) ( )(1 )
n n n n n
O h c c r c r c c r r
, (4.11)
109
2 2 2 2 0
1 2 1
2
2 2 2
32
( ) (1 )
2
(1 ) ,
2
n n n n
n
n n n
c
O h c c r a r r
r
c r a r r
(4.12)
3 3 2 0
1 2 1 1
3
32
3 2 2
( ) (1 ) 2
3
(1 ) 2 ,
3
n n n n n
n
n n n n
c
O h c c r a r a r r
r
c r a r a r r
(4.13)
34
22
()
nn
O h c c r
, (4.14)
4
4 4 2 4 2 0
1 2 1 1 3 2 2
( ) 3 3 1 3 3 1
44
n
n n n
cr
O h c c r a a c r a a
, (4.15)
42
2 1 3 2 1 2
( ) (2 ) 0
n
O h c a c a a a . (4.16)
Again, in the expressions above and below, the
i
c ‟s are functions of
1 n n n
r h h
, but the
subscript n is dropped for brevity. Solving equations (4.10)-(4.16) for
i
c gives the
following solution
2 5 2 4
0 2 1 1 1 1 2
23
1 1 2
00
2 2 3 4 2 2 3 3
1 1 2 1 2 1 2 1 2 1 2 1 2
3 2 2 2
1 2 1 2 1 2
2 3 2 2
1 2 1 2 1 2 2 1 2 1
[(3 6 9 ) ( 15 12 5 )
(12 12 4 ) ] / 1,
1,
[( 6 2 6 ) (4 12 12 )
(18 18 6 )
(2 2 12 6
nn
n
nn
n
c a a a r a a a r
a a a r
cc
c a a a a a a r a a a a a a r
a a a a a a r
a a a a a a a a a a
2
2 2 2 2
1 2 1 2 1 2 1 2 1 2
)
2 6 2 ] / [2 ],
n
r
a a a a a a a a a a
(4.17)
110
3 2 2 3 2 2 2
1 1 2 2 1 2 1 2 1 1 2
2 2 3 2
1 1 2 1 2 1 2 2 1 2
2 2 3
1 2 1 2 1 2 1 2
2 1 2 1
4
22
3 1 2
4
33
[( 12 2 6 4 )
( 18 12 2 6 )
6 2 6 ] / [2 ],
(2 )( 1) / (2 ),
,
( 1) / (2 ),
,
nn
n
n
n
n
n
c r a a a a a a a a a a r
a a a a a a a a a a r
a a a a a a a a
c a a r a
c r c
c a r a
c r c
(4.18)
where
2
1 1 2 1 2
(6 3 ) 3
n
a a a r a a .
Because occurs in the denominator of the expressions (4.17) and (4.18), it must be
ensured that it does not become zero. For the two sets of parameters chosen here, (4.19)
and (4.20), becomes (approximately)
2.685 1.65
n
r , and 1.478 1.01
n
r ,
respectively. In this study, only forward integration is considered, i.e.,
0 n
tt . Hence,
steps sizes are always positive, and so are all
n
r . Therefore, never becomes zero.
4.2.3 Parameter Selection
ARK3 has one free parameter
1
a , and ARK4 has two free parameters
1
a and
2
a . To
create an error control scheme both ARK3 and ARK4 methods and their results are used
111
in every step of integration. To minimize the function evaluation cost of the combined
ARK34 method,
1
a should be the same for both methods (see Section 4.3).
Since ARK4 is responsible for the actual integration, its accuracy is important. The
selection of parameters for this purpose can be attempted in a similar way to Chapter 2 by
solving two of the
5
()
n
Oh equations (not shown). However, this method is not
successful. The reason is that error control greatly complicates the behavior of a
numerical method, and therefore makes it difficult to select the appropriate parameters.
This is because the values of
1
a and
2
a affect the accuracy and stability of both ARK4
and ARK3, which affect the accuracy of error estimation, which affects the step size,
which again affects the accuracy and stability of both ARK4 and ARK3.
Better success is gained in selecting the parameters of ARK34 through limited numerical
experimentation. In other words, various values of
1
a and
2
a are used in integration of
the standard problems, and the values that yield the most accurate and efficient ARK34
method are chosen. Noting that
1
a and
2
a appear in the denominator of the parameter
expressions (4.9), (4.17), and (4.18), the value of zero is not considered. In effect, a
preliminary “proof of concept” of the ARK34 method is created here by finding the
following two sets of values to give good accuracy and avoid limiting precision (see
Section 4.8):
112
parameter set 1:
1
0.85 a , and
2
0.9 a , (4.19)
parameter set 2:
1
0.64394 a , and
2
0.92207 a . (4.20)
4.3 Error Control and Step Size Selection
In the following, the error control and step size selection scheme of the variable step size
ARK34 method are described. (see the flowchart in the appendix for details). The
variable step size ARK34 method presented here controls the local error. Because the
value of local error is unknown, it must be estimated, which is done here through the
“embedded pair”. An embedded pair consists of a higher order method and a lower order
method. The higher order method is (usually) used to advance the step, i.e., calculate
1 n
y . This is referred to as “local extrapolation”. The difference between the
approximate solutions of the higher and lower order methods is used to estimate the local
error. To reduce the number of function evaluations required per step, these lower and
higher order methods are designed in such a way that they can share their function
evaluations, the
i
k ‟s and
i
k ‟s. For ARK34, this is simply achieved by choosing the
same value of
1
a for both ARK3 and ARK4 (see expression (4.2)).
The following items are described next:
a. how the local error of (the current) step 1 n is estimated,
113
b. what criterion determines whether step 1 n passes the local error test,
c. how an optimal step size is chosen if step 1 n fails, and
d. if step 1 n passes the test, how the information gathered from it, is used to find a
suitable step size for step 2 n .
4.3.1 Error Control
The embedded pair used here consists of the lower order method, ARK3, and the higher
order method, ARK4. At step 1 n , the two methods are used to calculate
3
1
ARK
n
y and
4
1
ARK
n
y . It can be written
3 4 3 4
1 1 1 1 1 1
34
( ) ( )
,
ARK ARK ARK ARK
n n n n n n
ARK ARK
nn
tt
y y y u u y
le le
(4.21)
where
3 ARK
n
le and
4 ARK
n
le are the local error of step 1 n of ARK3 and ARK4,
respectively. Since
34
()
ARK
nn
Oh le , and
45
()
ARK
nn
Oh le ,
the
5
()
n
Oh (and higher) terms in (4.21) can be ignored for small enough
n
h . An estimate
of the local error of ARK3 at step 1 n can then be estimated as
114
3 4 3
11
:
ARK ARK ARK
n n n n
est y y le . (4.22)
Therefore, for small enough step sizes, the difference between the approximate solutions
of ARK3 and ARK4 can be used as an estimate for the local error of the ARK3 method.
Even though the local error of ARK3 is estimated, the integration (calculating
1 n
y ) is
performed using ARK4. This is because it would be a waste to form ARK4 and not use
it. Another consequence is that it makes the error estimation and hence step size
selection conservative. In other words, the local error of ARK4 is overestimated and a
step size that is smaller than necessary is used. This method is similar to the scheme used
in Matlab‟s ODE23, in which integration is done by RK3, but the error is estimated for
RK2. It is also used in Matlab‟s ODE45.
The desired accuracy in numerical integration is specified through a relative tolerance,
r
, and an l -element vector ( l is the dimension of the initial value problem) of absolute
tolerances,
a
τ . The error control scheme used here implements a mixed relative and
absolute error control, which avoids the weaknesses of pure relative error control or pure
absolute error control, and is effective and robust [44],
1, ,
max ( )
i
n
r i
im
n
est
s
, (4.23)
where
115
1
max( , , )
i i i i
n n n
s y y th
, and
i
i a
r
th
for 1, , il . (4.24)
Step 1 n of ARK34 passes if inequality (4.23) holds, and it fails otherwise. Here‟s how
it works. When
1
max( , )
ii
nn
yy
is greater than the threshold,
i
th , condition (4.23)
becomes
1, ,
1
max( )
max( , )
i
n
r
ii
il
nn
est
yy
,
and relative error control with tolerance
r
is implemented. When
1
max( , )
ii
nn
yy
is
smaller than the threshold,
i
th , condition (4.23) becomes
1, ,
max( )
i
n
r i
il
ar
est
1, ,
max( )
ii
na
il
est
,
and absolute error control with tolerance
i
a
is implemented. So at any step of
integration, either relative error control or absolute error control is implemented, not
both.
An example can illustrate this. A scalar problem is solved who‟s solution ranges from
0
10 to
6
10
. The relative tolerance
3
10
r
and absolute tolerance
7
10
a
are used,
116
which means
4
10 th
. When y th , i.e.,
40
10 10 y
, the error control scheme
becomes
3
10
est
y
3
10 est y
.
The left inequality shows that the (estimate of) relative error is kept smaller than
3
10
.
The right inequality shows that the (estimate of) absolute error grows with the solution.
For example, for
1
10 y
,
4
10 est
which is 1000 times larger than the absolute error
tolerance specified. In other words, the solver ignores the absolute error tolerance.
On the other hand, when y th , i.e.,
64
10 10 y
, the error control scheme becomes
3
10
ar
est
7
10 est
.
The right inequality shows that the absolute error is kept smaller than
7
10
. The relative
error is
7
10
relative error
est
yy
,
which grows as y decreases. For example, for
6
10 y
,
1
rel. err. 10
which is 100
times larger than the relative error tolerance specified.
117
Table 4.1 shows the relative and absolute errors that result from a specific magnitude of
the solution of this example problem. In the top portion of the table, y th , and
therefore relative error control is implemented. This leaves the absolute error
uncontrolled. In the bottom portion, y th , and therefore absolute error control is
applied while the relative tolerance is ignored.
This is a potential pitfall for an otherwise effective and robust scheme. Depending on the
magnitude of the problem and the choice of tolerances, either the relative or the absolute
errors may become much larger than the specified tolerance at any step of integration.
y
applied scheme
absolute error is
smaller than
relative error is
smaller than
0
10
relative error
control
( y th )
3
10
3
10
1
10
4
10
3
10
2
10
5
10
3
10
3
10
6
10
3
10
5
10
absolute error
control
( y th )
6
10
2
10
6
10
6
10
1
10
Table 4.1: An example illustrating that at any step of integration, either absolute or
relative error control are applied, not both.
Also, if the user does not specify either the relative or absolute tolerances, they default to
3
10
and
6
10
, respectively. So if only the relative tolerance is specified by the user to
for example
8
10
, the absolute tolerance remains at
6
10
, and may become the effective
tolerance. In other words, the specified small relative tolerance may be completely
ignored. To prevent this problem, it is recommended that both tolerances be specified in
118
tandem. The error control and step size selection scheme described above is similar to
the scheme due to Shampine [44] that is implemented in Matlab‟s ODE23 and ODE45
integrators.
4.3.2 Step Size Selection
The optimal step size for (the current) step 1 n is now found, i.e., the largest step size
that satisfies the tolerance. The optimal step size is used for two cases: a) the second try
at step 1 n if it fails, and b) to find a suitable (near optimal) step size for step 2 n if
step 1 n succeeds. The local error of ARK3 for step 1 n , taken with a non-optimal
step size
n
h , can be written as
45
4
()
ii
n n n n
i
nn
le h O h
h
for 1, , il ,
where
i
n
ψ is the coefficient of the
4
() Oh term for the i th component in the local error.
Dividing both sides by
i
n
s , and taking the maximum of the absolute value leads to
4
1, , 1, ,
max(| |) max(| |)
ii
nn
nii
i l i l
nn
le
h
ss
. (4.25)
119
Had this step been taken with the optimal step size,
*
n
h , expression (4.25) would become
**
*4
**
1, , 1, ,
max(| |) max(| |)
ii
nn
nii
i l i l
nn
le
h
ss
, (4.26)
Dividing (4.26) by (4.25) gives
**
* * *
1, , 1, ,
4
1, , 1, ,
max(| |) max(| |)
()
max (| |) max(| |)
ii
nn
ii
i l i l
n n n
ii
nn n
ii
i m i l
nn
le
h s s
le h
ss
. (4.27)
For an optimal step size, expression (4.23) leads to
*
*
1, ,
max(| |)
i
n
r i
il
n
est
s
.
Considering the above expression and using the estimate of the local error in place of the
actual local error, expression (4.27) can be written as
*
*
1, ,
*4 4
1, , 1, ,
max(| |)
max(| |) max(| |)
i
n
i
il
n r
nnii
nn
ii
i l i l
nn
s
hh
est
ss
.
120
Because step 1 n is in general not taken with the optimal step size, the values of
*
n
ψ and
*
n
s are not available, so the above is not a computable expression for
*
n
h . Therefore, the
approximation
*
*
1, , 1, ,
max(| |) max(| |)
ii
nn
ii
i l i l
nn
ss
is made, which results in the computable expression for the optimal step size,
* 1/4
1, ,
()
max( )
r
nn
ii
nn
il
hh
est s
. (4.28)
The above is an estimate of
*
n
h , the optimal step size of step 1 n . This estimate depends
on the step size that is actually taken,
n
h , and the error estimate that is consequently
computed,
n
est , using
3
1
ARK
n
y and
4
1
ARK
n
y . In other words,
*
n
h can only be computed after
step 1 n has been taken. When the current step fails, the above scheme is used to find a
more suitable step size for the second try. Because failed attempts are computationally
wasteful, their occurrence should be minimized. Therefore, a "factor of safety" [44] is
incorporated, i.e.,
(2) 1/4
1, ,
: 0.8 ( )
max( )
r
nn
ii
nn
il
hh
est s
, (4.29)
121
where
(2)
n
h denotes the step size chosen for the second attempt at the current step, 1 n .
For the third and higher tries, the step size is just halved, i.e.,
( ) ( 1)
: 0.5
jj
nn
hh
( 2 j ).
It is also desirable to find a suitable guess for the step size of the next step ( 2 n ) when
the current step succeeds. According to (4.28), the optimal step size for step 2 n is
* 1/4
11
11
1, ,
( ) .
max( )
r
nn
ii
nn
il
hh
est s
Making the approximation
1
1, , 1, ,
11
max(| |) max(| |)
ii
nn
ii
i l i l
n n n n
est est
h s h s
,
leads to
* 1/4
1
1, ,
()
max( )
r
nn
ii
nn
il
hh
est s
,
which is a computable expression for approximating the optimal step size of step 1 n .
A factor of safety is also incorporated, i.e.,
1/4
1
1, ,
: 0.8 ( )
max( )
r
nn
ii
nn
il
hh
est s
. (4.30)
122
The step size selection scheme used by ODE23 and ODE45 are similar to expression
(4.30).
4.4 Basis of Comparison
To evaluate the performance of the ARK34 method numerically, it is compared with
Matlab‟s ODE23 numerical integrator [35]. The reasons for this are as follows.
Matlab is a very popular mathematics software platform that has been used for a long
time by scientists and engineers around the world. The Runge-Kutta solvers for the
solution of non-stiff differential equations in Matlab are ODE23 and ODE45. Both
methods are popular with users. In fact, ODE45 is considered to be one of the best
solvers to try as a first attempt at solving any problem. It is hence reasonable to regard
them as some of the best quality solvers available today, making them a suitable standard
of reference.
Both ARK34 and ODE23 (based on an RK23 embedded pair) cost 3 function evaluations
per successful step of integration. Chapter 2 shows that the constant step size ARK3 and
ARK4 can be much more accurate than RK2 and RK3, respectively, but are only slightly
slower. For variable step size methods with error control, higher accuracy can mean
faster execution because higher accuracy allows them to take larger steps and hence
fewer of them to complete an integration over a given time interval. It is therefore
plausible that a variable step size ARK34 method would perform better than ODE23.
123
ARK34‟s accuracy is also compared with that of ODE45, although ARK34 is not
expected to be as fast as ODE45. The comparison is made for completeness and
curiosity.
4.5 Standard Test Problems
In Chapters 2 and 3, the reasons for choosing a set of standard test problems to evaluate
the constant step size ARK methods are explained. For the variable step size ARK
methods, the following changes are made.
There is no specific need for non-autonomous problems in testing the variable step size
methods. Therefore, only two of the non-autonomous problems of Chapter 3 are used
here. Although the ARK methods are not suited for solving stiff problems, the stiff
Robertson‟s problem is used to show that ARK34, ODE23, and ODE45 are equally
capable of solving it. Another addition is the 2 body problem with eccentricity 0.99
which illustrates the problem of limiting precision. The problem of the equations of
motion of the rolling ball developed in Chapter 5 is also used because of the author‟s
interest in accurate and efficient solution of differential equations that govern the
behavior of mechanical systems.
124
4.6 Solver Structure and Syntax
In the next few sections, the accuracy and speed of ARK34 and ODE23, and the accuracy
of ODE45 are assessed and compared in Matlab [35]. Considerable effort is expended to
make a fair comparison. None of the programs are unjustly burdened with extra
computation or inaccuracy that the other two are not. The aim is to compare only the
underlying integration method. So, most of the extra features of the ODE23 and ODE45
codes that are not directly related to simple integration, such as event handling, mass
matrix handling, etc. are removed. Then the following minimum necessary changes are
made to the Matlab codes to produce the codes that are used for fair accuracy and speed
comparisons.
1. Obviously, the RK23, RK45, and ARK34 integration methods are different.
2. ARK34 contains a startup procedure because it is not self-starting. It uses a
modified ODE23 that integrates only one step. The other codes do not have a
startup procedure.
3. The exponent in the step size selection expressions (4.29) and (4.30) for ODE23
is 1/ 3 , for ODE45 is 1/ 5 , and for ARK34 is 1/ 4 because the order of the
methods are different.
125
4. The maximum allowable step size ratio max( )
n
r is 5 for ODE23 and ODE45, but
it is 1.25 for ARK34 because of its smaller stability region (see Figure 4.31).
5. The interpolation schemes of the three codes are different (see Section 4.11).
However, interpolation is not used in the accuracy and speed comparisons here.
The syntax of these (modified) solvers is as follows.
options = odeset(‘RelTol’,rtol,‘AbsTol’,atol,‘Refine’,refine)
[t, y, stats] = solver(ode,tspan,y0,options)
The parameters of this syntax are as follows.
1. rtol and atol are the relative and absolute tolerances, respectively. Their
default values are
3
10
and
6
10
, respectively.
2. refine is used to request extra solutions inside the solver‟s steps. Its default
value is 1, which does not request any extra solutions.
3. t, y, and stats are the solution time vector, the solution matrix itself, and the
integration statistics vector, respectively. The statistics include in order, the
number of successful steps, number of failed attempts, and the number of function
evaluations.
126
4. solver is the name of the solver program, which is one of ode23, ode45, or
ode34.
5. ode is the function handle of the initial vlaue problem.
6. tspan is the integration time span vector. If this vector has two elements, its
elements are taken in order as the start and end times, and the output solution is
given at the solver‟s own chosen time points. On the other hand, if tspan has
more than two elements, the solution is provided at time points specified by those
elements.
7. y0 is the vector of initial values of the problem.
4.7 Accuracy
The codes (modified as above) are used to solve ten standard initial value problems (P1,
P3-9, P11-12) given in Appendix A. For ARK34, both parameter sets of (4.19) and
(4.20) are used. The problems include autonomous and non-autonomous differential
equations with dimensions ranging from 1 to 30. The problems are solved for 0 20 t
at nine relative tolerances,
3 4 11
10 ,10 , ,10
r
, and absolute tolerances
4
10
ar
(for all components). Results using other values of
a
and integration spans are similar.
127
To find the global error in these integrations, the exact solutions are computed at the
same time points as those of the approximate solutions. The exact solution is computed
using the closed form solution, if available. Otherwise, it is approximated by ODE45
using
13
10
r
and
17
10
a
(for all components). Clearly, one needs to ensure that
this “exact” solution is far more accurate than the approximate solutions. That is why
tolerances (
13
10
and
17
10
) that are 100 times smaller than the most stringent tolerances
of the approximate solutions (
11
10
and
15
10
) are used. These tolerances apply to the
local error and not the global error, so there is no guarantee that the global error of the
“exact” ODE45 solution is 100 times smaller than the global error of the approximate
solution.
The Averaged 2-Norm of the Global Error for each problem, over the entire integration
span, given by
2
1
1
()
N
nn
n
ANGE t
N
yy
is plotted against relative tolerance in Figure 4.2 to Figure 4.11. Alternatively, the
accuracy can be based on the error at the end of integration time span. This method does
not give as complete a picture of accuracy as using the average of the error over the entire
time span (see Section 4.11). Nonetheless, accuracy plots created using the end of
integration time span are included in Appendix G. The results are similar in both cases.
128
Figure 4.2 to Figure 4.11 show that the accuracy of ARK34 is higher than both ODE23
and ODE45 for most problems and tolerances. Specifically, for P3, P4, P6-P9, and P12,
ARK34 with parameter set 1 appears to be more than 10 times more accurate than
ODE23. ARK34 with parameter set 2 appears to be 10 times more accurate than ODE23
for P3, P4, P7-P9, and P12. Furthermore, ARK34 with parameter sets 1 and 2 seem to be
close to 10 times more accurate than even ODE45 for P4, P7, P12, and P1, P3, P4, P7,
respectively.
The plots show that ODE45 can be less accurate than ARK34, and sometimes even less
accurate than ODE23. This might come as a surprise to some, but it is indeed possible
because all that these variable step size methods try and do is to satisfy the local error
tolerance while taking the fewest number of steps possible, which ODE45 does here.
These methods do not claim to give the most accurate solution possible, just accurate
enough to meet the user specified tolerances. Therefore, it would be erroneous to believe
that higher order variable step size methods always give the most accurate global
solutions.
129
Figure 4.2: Accuracy plot of P1 (scalar non-autonomous problem) for the variable
step size methods. This plot shows that the lower order methods like ARK34 and
ODE23 can be more accurate than ODE45.
Figure 4.3: Accuracy plot of P3 (Duffing problem) for the variable step size
methods. This plot shows that ARK34 can more accurate than ODE23 and ODE45.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
130
Figure 4.4: Accuracy plot of P4 (Euler problem) for the variable step size methods.
This plot shows that ARK34 can be more than 10 times more accurate than ODE23
and ODE45.
Figure 4.5: Accuracy plot of P5 (stiff Robertson problem) for the variable step size
methods. This plot shows that ARK34, ODE23, and ODE45 have similar accuracy
when solving an example stiff problem.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-15
10
-10
10
-5
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
131
Figure 4.6: Accuracy plot of P6 (2 body eccentricity 0 problem) for the variable step
size methods. This plot shows that ARK34 can be more accurate than ODE23 and
ODE45.
Figure 4.7: Accuracy plot of P7 (2 body eccentricity 0.9 problem) for the variable
step size methods. This plot shows that ARK34 can be 10 times more accurate than
ODE23 and ODE45.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-10
10
-8
10
-6
10
-4
10
-2
10
0
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-8
10
-6
10
-4
10
-2
10
0
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
132
Figure 4.8: Accuracy plot of P8 (2 body eccentricity 0.99 problem) for the variable
step size methods. This plot shows that ARK34 can be more accurate than ODE23
and ODE45. The errors for ARK34 with parameter set 1 at
11 10
10 ,10
r
are not
included because it reaches limiting precision (see Section 4.8).
Figure 4.9: Accuracy plot of P9 (radioactive problem) for the variable step size
methods. This plot shows that ARK34 can be 10 times more accurate than ODE23.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
10
1
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-14
10
-12
10
-10
10
-8
10
-6
10
-4
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
133
Figure 4.10: Accuracy plot of P11 (rolling problem) for the variable step size
methods. For this problem ARK34, ODE23, and ODE45 have similar accuracy for
most tolerances. The error for ARK34 with parameter set 1 at
11
10
r
is not
included because ARK34 reaches limiting precision (see Section 4.8).
Figure 4.11: Accuracy plot of P12 (5 planet problem) for the variable step size
methods. This problem shows that ARK34 can be more accurate than ODE23 and
ODE45.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-6
10
-4
10
-2
10
0
10
2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
134
For a more in-depth comparison of the integration error, the global error versus time for
P7 (2-body problem with eccentricity 0.9) is plotted in Figure 4.12 to Figure 4.15. The
global error is plotted for all four solution components separately for
7
10
r
and
11
10
a
(for all components). It can be seen that ARK34 produces the most accurate
solution, followed by ODE45, followed by ODE23. In fact, by the time that the
revolving body passes by the center body for the second time ( 12.5 t ), the ARK34‟s
solution is about 10 times more accurate than those of ODE23 and ODE45.
Figure 4.12: The accuracy plot of component x for P7 (2 body eccentricity 0.9
problem) over time. This plot shows clearly how the ARK34 solution (motion of the
revolving body) can be much more accurate than that of ODE23 and ODE45.
0 5 10 15 20
-5
-4
-3
-2
-1
0
1
2
3
4
5
x 10
-5
Time
Global Error
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
135
Figure 4.13: The accuracy plot of component y for P7 (2 body eccentricity 0.9
problem) over time. This plot shows the higher accuracy of ARK34.
Figure 4.14: The accuracy plot of component x for P7 (2 body eccentricity 0.9
problem) over time. This plot shows the higher accuracy of ARK34.
0 5 10 15 20
-6
-4
-2
0
2
4
6
8
x 10
-5
Time
Global Error
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
0 5 10 15 20
-2
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-3
Time
Global Error
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
136
Figure 4.15: The accuracy plot of component y for P7 (2 body eccentricity 0.9
problem) over time. This plot shows the higher accuracy of ARK34.
4.8 Limiting Precision
At very small tolerances, the step size
n
h required by a solver may get so small that it
reaches the computer‟s unit precision. At this point, the computer cannot distinguish
between
n
t and
nn
th . Computation therefore is not done correctly and the solver
produces erroneous results. This is referred to as “limiting precision” and can lead to
inaccuracy and inefficiency [44].
Because limiting precision can be subtle and not catastrophic, the user may not notice
that it is happening, and accept the results as valid. A good solver should detect limiting
precision, notify the user, and stop the integration altogether. Clearly, no solution is
0 5 10 15 20
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x 10
-3
Time
Global Error
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
137
better than a wrong solution. The danger of using a solver that does not detect limiting
precision is well illustrated using the 2 body problem in [44].
ARK34 (and Matlab solvers) terminate the integration and display the following error
message if limiting precision is detected.
Failure at t=f. Unable to meet integration tolerances without
reducing the step size below the smallest value allowed (hmin) at
time t.
Here, f is the integration time at which the step size becomes equal to or smaller than
hmin which is the minimum step size allowed. The minimum step size allowed is 16
times the unit precision at time f, which can be calculated using the Matlab command
eps(f). For example, the minimum step size at 1 is hmin = 16*eps(1) = 3.56e-
15 (approximately). Limiting precision happens for ARK34 parameter set 1 (4.19)
when solving P8 (2 body problem eccentricity 0.99) at relative tolerances
11
10
and
10
10
, and P11 (rolling ball problem) at relative tolerance
11
10
. It also occurs for ARK34
with parameter set 2 beyond the integration time span considered here ( 0 20 t ).
Although limiting precision does not occur for ODE23 or ODE45 for the problems and
tolerances considered here, such problems and tolerances exist and can readily be found.
That is precisely why these solvers are equipped with the ability to detect limiting
precision.
138
The two problems P8 and P11 exhibit properties that often make problems difficult to
integrate numerically. The Jacobian of the two body problem has two real eigenvalues
(equal in magnitude, one positive and one negative) that increase rapidly to large
magnitudes as the revolving body passes close by the stationary body (see Figure 4.16).
This is the point at which limiting precision occurs. Also, having a large real positive
eigenvalue indicates great local instability of the solution. In addition, the imaginary part
of the complex eigenvalues become very large (upto 1000) at this point (the effect is
often a highly oscillatory solution). The mass matrix of the rolling ball problem has
elements in it that are apart by the large magnitude of
4
10 . These properties combined
with very small tolerances require very small step sizes which can cause limiting
precision to occur.
Figure 4.16: Magnitude of the real eigenvalues of P8 (2 body problem eccentricity
0.99) solved by ODE45 at relative tolerance
11
10
. This plot shows the great range
of magnitude of the real eigenvalue which can make numerical integration difficult.
0 5 10 15 20
10
-1
10
0
10
1
10
2
10
3
10
4
Time
Magnitude of Real Eigenvalues
139
To look more closely at why ARK34 with parameter set 1 requires a very small step size,
its local error is studied. Figure 4.17 shows the ratio of local error over step size for P8
for all the solvers. It can be seen that near the point where the revolving body passes by
the stationary body ( 6.3 t ), this ratio increases rapidly for all the solvers. However, the
increase is much larger for ARK34 with parameter set 1 than others. Specifically, the
ratio for ODE45 reaches
5
10
, for ODE23 and ARK34 with parameter set 2 it reaches
2
10
, but for ARK34 with parameter set 1 it reaches
2
10 . So, ARK34 with parameter set
1 seems to lose its accuracy at this point, and demand small step sizes that cause limiting
precision to occur. The program correctly detects this and stops the integration.
Changing integration parameters does not prevent limiting precision for ARK34 with
parameter set 1 for P8 and P11. These changes include: (a) raising or lowering the safety
factor in the step size selection scheme (4.30), (b) increasing or decreasing the minimum
step size, (c) raising or lowering the limit on step size ratio
n
r , and (d) placing a limit on
the change in
n
r .
140
Figure 4.17: Local error per step size of P8 (2 body problem eccentricity 0.99) at
relative tolerance
11
10
. This plot shows that ARK34 with parameter set 1 loses its
accuracy more than other solvers near the point where the revolving body passes by
the stationary body.
ARK4 with parameter set 2 (4.20) has larger stability regions (see Figure 4.32) than
ARK4 with parameter set 1. This may suggest why set 1 fails and set 2 does not,
however, that reasoning has a problem. For example, the stability plot for ARK4 with
parameter set 1 (Figure 4.31) shows that for 1.5
n
r , the stability boundary crosses the
real axis at approximately -0.1. The real negative eigenvalue of the Jacobian of P8
reaches approximately 1000. Therefore, the stability plot suggests that in order for the
method to be A-stable, step size must be smaller than approximately
4
1 10
. However,
ARK34 with parameter set 1 requires a step size of approximately
14
1.4 10
when close
to the point of failure. Therefore, the A-stability plot which uses the test equation
yy does not give an accurate indication of stability in this case.
0 1 2 3 4 5 6 7
10
-15
10
-10
10
-5
10
0
Time
Local Error per Step Size
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
141
4.9 Stiffness
The previous section mentions that P8 (2 body problem with eccentricity 0.99) and P11
(rolling ball problem) exhibit properties that often make numerical integration difficult.
These properties are often thought to produce stiff problems although opinions differ as
to what constitutes stiffness [47].
For instance, when Aiken asks experts at a conference what constitutes stiffness, he
receives different answers [2]. However, what the experts differ in is how to predict
stiffness, not how to determine it. Determining stiffness is done by a simple and well
agreed upon test. A problem is determined to be stiff if a solver intended for stiff
problems can solve it using much fewer steps than a solver intended for non-stiff
problems. In most cases, implicit solvers are intended for solving stiff problems, and
explicit solvers are intended for solving non-stiff problems. Furthermore, the smaller the
ratio of the number of steps taken by an implicit method over those taken by an explicit
method, the more stiff the problem is considered to be.
Using this definition, neither P8 nor P11 are stiff problems because ODE45 (an explicit
solver) can solve them using fewer steps than it takes ODE15s or ODE23s (implicit
solvers). Likewise, ODE23 (an explicit solver) takes fewer steps than ODE23s. Problem
P8 is difficult to solve because it is very unstable (at some points). Just because a
problem is difficult to solve does not mean it is stiff.
142
On the other hand, predicting stiffness simply by analyzing a problem‟s differential
equations and initial conditions (without solving it) is not a straightforward task. A
popular prediction criterion is that the ratio of the magnitudes of the largest real part to
the smallest real part of the eigenvalues of the jacobian of a problem is “large”. In other
words, the solution has very fast and very slow components. While this criterion is
useful and often correct in predicting stiffness, it is not perfect. For example, it suggests
that scalar problems cannot be stiff. However, the simple combustion model
2
(1 ) y y y , (0) y , 02 t ,
where is a small number, is an example of a scalar problem that can be stiff [47]. For
example, for
4
1 10
and
3
1 10
r
,
4
10
ar
, ODE45 takes 3029 steps to solve
this problem, while ODE15s takes only 82 steps.
The combustion problem can also illustrate that stiffness can depend on the tolerance.
For example, for
4
1 10
and
11
1 10
r
,
4
10
ar
, ODE45 takes 3836 steps to
solve this problem, while ODE15s takes 1757 steps. So, for smaller tolerances this
problem becomes less stiff. In fact, if
3
1 10
, for large tolerances the problem is
stiff, but for smaller tolerances it is not stiff at all.
Another prediction criterion for stiffness (championed by Shampine) is that
0
()
N
L t t is
“large”, where L is the problem‟s Lipschitz constant, and
0
,
N
tt are the integration‟s start
143
and end times, respectively [44]. It is not clear how large is “large” (although Shampine
considers 100 to be sufficiently large, and 1 not to be large enough [44]). The main
strength of this criterion is that it considers the length of integration. Shortening the
integration span can turn a stiff problem into a non-stiff problem, and vice versa [44].
For the value of L , the largest magnitude of eigenvalues with negative real parts can also
be used. Because the magnitude of the eigenvalues with negative real parts times the
time span is
4
2 10 for P8, the above criterion would predict it to be stiff. However, as
mentioned before, experiments with ODE45 and ODE15s show that P8 is not stiff.
4.10 Speed
The execution speed of the ARK34 solver is illustrated in this section. The speed of
ARK34 is quantified here by the ratio
RK ARK
TT , where
ARK
T and
RK
T are the execution
times for the ARK and RK methods, respectively.
ARK34 and ODE23 are used to solve the same problems for the same time span and at
the same nine relative tolerances as in the accuracy section. As explained in Section 4.6,
objectivity and fairness is ensured in the speed comparison by using similar codes for the
ODE23 and ARK34 methods. The Matlab profile utility is used to measure the
execution time of these codes 5 times and the average is taken before calculating the
speed ratio. Figure 4.18 and Figure 4.19 show the speed ratio of the ARK34 method over
ODE23.
144
Figure 4.18: The ratio of the execution speed of ARK34 with parameter set 1 over
that of ODE23 for the standard problems considered here. (The ratio for P11 at
11
10
r
is not included because of very lengthy execution time.)
10
-11
10
-9
10
-7
10
-5
10
-3
0
1
2
3
4
5
6
Relative Tolerance
Speed Ratio
P1 (Scalar)
P3 (Duffing)
P4 (Euler)
P5 (Robertson)
P6 (2 body 0)
P7 (2 body 0.9)
P8 (2 body 0.99)
P9 (Radioactive)
P11 (Rolling)
P12 (5 planet)
145
Figure 4.19: The ratio of the execution speed of ARK34 with parameter set 2 over
that of ODE23 for the standard problems considered here. (The ratio for P11 for
11
10
r
is not included because of very lengthy execution time.)
For most engineering and scientific applications, relative error tolerances smaller than
6
10
are usually used. For these tolerances, the ARK34 method seems to execute faster
than ODE23 (the exception is P5, the stiff problem), and its speed ratio increases as the
tolerance decreases. For instance, at the relative error tolerance
8
10
, ARK34 appears to
be 1.4 to 3 times faster than ODE23 for the problems used in this study, and at a relative
tolerance of
11
10
, ARK34 appears to be between 2.5 to 5.5 times faster than ODE23.
Thus, the ARK34 method seems to be simultaneously faster and more accurate than
ODE23 for relative error tolerances of principal interest in engineering and scientific
computation.
10
-11
10
-9
10
-7
10
-5
10
-3
0
1
2
3
4
5
6
Relative Tolerance
Speed Ratio
P1 (Scalar)
P3 (Duffing)
P4 (Euler)
P5 (Robertson)
P6 (2 body 0)
P7 (2 body 0.9)
P8 (2 body 0.99)
P9 (Radioactive)
P11 (Rolling)
P12 (5 planet)
146
The ARK34 method is faster because it takes fewer steps than the ODE23 method.
Figure 4.20 shows that the number of steps taken by ODE23 grows rapidly compared to
the number of steps taken by ARK34 (parameter set 1) as the relative error tolerance
decreases. This trend is also shown in the data given in Appendix E which presents the
actual number of successful steps, failed attempts, and function evaluations performed by
ODE23, ARK34, and ODE45.
Figure 4.20: The ratio of the number of successful steps of ODE23 over that of
ARK34 (parameter set 1). This plot shows that ODE23 takes many more steps than
ARK34 as tolerance decreases. This is the reason for ARK34‟s higher speed.
Comparison of Figure 4.18 and Figure 4.20 shows that for each problem, the ratio of
number of steps is higher than the ratio of speed. Because both ARK34 and ODE23 cost
3 function evaluations per successful time step, and the number of failed attempts are
mostly insignificant, the speed ratio is expected to be almost the same as the number of
10
-11
10
-9
10
-7
10
-5
10
-3
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Relative Tolerance
Sucessfull Steps Ratio
P1 (Scalar)
P3 (Duffing)
P4 (Euler)
P5 (Robertson)
P6 (2 body 0)
P7 (2 body 0.9)
P8 (2 body 0.99)
P9 (Radioactive)
P11 (Rolling)
P12 (5 planet)
147
steps ratio. However, Figure 4.18 and Figure 4.20 show that this is not the case. The
speed ratio is lower than the number of steps ratio.
The total execution time of a method can be written as
//
()
fe s o s
T T T N ,
where T denotes total execution time,
/ fe s
T denotes execution time spent on function
evaluations per step,
/ os
T denotes execution time spent on arithmetic overhead per step,
and N denotes number of successful steps. It can be written
ODE23 ODE23
ARK34 ARK34
TN
TN
, where
fe/s o/s
ODE23 ODE23
fe/s o/s
ARK34 ARK34
TT
TT
.
The above expressions show that represents two equal values.
1. The left expression shows that is the ratio of total execution times over the
ratio of numbers of successful steps,
2. The right expression shows that is the ratio of total execution times per step of
integration.
The first value above can be measured using Figure 4.21, which plots the speed ratio
versus the step ratio for all of the problems and relative tolerances considered here. The
148
slope, , of the least square line through these points is approximately 0.83. Therefore,
each integration step of ODE23 takes 0.83 of the time it takes for ARK34. Put another
way, ARK34 is 17% slower than ODE23 per step of integration. However, because
ARK34 takes far fewer steps than ODE23 (as the relative error tolerance decreases),
ARK34‟s entire integration takes less time than ODE23‟s.
This is certainly expected because Section 2.6 shows that the constant step size ARK
methods have a higher arithmetic overhead than RK methods. In fact, in the variable step
size case, the arithmetic overhead is more pronounced than in the constant step ARK
methods because here, the
i
c ‟s need to be recalculated at every step.
Figure 4.21: The ratio of execution speed of ARK34 (parameter set 1) over that of
ODE23 for all problems is plotted here against the corresponding ratio of number of
successful steps. A least square line that goes through the origin is also plotted.
This line is extended to the origin for convenience only, as the speed and step ratios
are not defined there. This plot shows that ARK34 is slower than ODE23 per step.
0 1 2 3 4 5
0
1
2
3
4
5
6
Ratio of No. of Successful Steps
Speed Ratio
149
For larger relative tolerances, ARK34 executes slower than ODE23 because it takes more
steps than ODE23. The reason appears to be in part that for large tolerances, ARK34
cannot take step sizes that are as large as ODE23‟s step sizes because max( )
n
r
(maximum of step size ratio) in ARK34 is restricted to 1.25, while in ODE23 it is set to
5. This restriction exists because ARK34‟s A-stability region is smaller than ODE23‟s
(see Section 4.12.2).
However, in spite of the smaller stability region of ARK34 compared with that of
ODE23, ARK34 in general has fewer failed attempts for the problems considered here
(see Table D.2 and D.2c). The reason appears to be that variable step size methods
monitor their local error, and pick an appropriate step size accordingly that would lead to
a successful step. The downside of having a small A-stability region is that it sometimes
forces the ARK34 method to take a smaller step size than ODE23. This happens at large
relative error tolerances (larger than
5
10
in this study), in which case, ARK34 takes
more steps than ODE23 does (see Figure 4.20).
4.11 Interpolation
A user may want to get the solution of the differential equation at time points that are
different than those chosen by the solver. Two examples are: getting the solution at a
number of specific time points that interest the user, and multiple time points inside of all
integration steps taken by the solver (called “refine”).
150
The method by which ODE23 and ODE45 provide these extra solutions is as follows.
The solvers take steps based on the step size selection scheme described in Section 4.3.2.
After a successful step is completed, the solver checks to see if solutions are requested at
any times inside the step just completed. If so, the solver uses interpolation to compute
the requested solutions. If not, the solver continues to the next step.
ODE23 employs a 3rd order polynomial interpolant. So, the interpolant has the same
order of local accuracy as the solver (RK3). ODE45 on the other hand uses a technique
named “RK triples” which employs a 4th order RK method to compute the solution at
requested points [20]. So, the interpolant does not have the same order of accuracy as the
solver (RK5).
A 4th order polynomial interpolant is now developed for ARK34. The interpolant has the
form
4 3 2
4 3 2 1 0
() t t t t t ρ .
To find the parameters
i
the following conditions are imposed
11
11
()
()
()
nn
nn
nn
t
t
t
ρy
ρy
ρy
1 1 1
( ) ( , )
( ) ( , ) .
n n n n
n n n n
tt
tt
ρ f y f
ρ f y f
151
Solving the above equations for
i
(which can be done in Maple) leads to
4 3 2 4
1 1 1 1 1 2
4 3 2 3
1 1 1 1 1 1
42
1 1 1 1 1
1
( ) (2 ) ( ) ( )(3 2)
(1 )
(3 ) 4( ) ( ) 2( )
(3 ) ( 2 ) ( )(4
n n n n n n n n n n n n n
n n n n n n n n n n n n n n
n n n n n n n n n n n
t r h r h r r r
r
r h r r h r
r h r h r
ρ g f f f f y y
g f f y y f f y y
g f f f f y y
2
1
3)
,
n
n n n n
r
hr
fy
where
11 n n n n
h
g y f y ,
n
n
tt
h
, and ( , )
n n n
t f f y .
The solutions
1 n
y ,
n
y , and
1 n
y as well as the function evaluations
n
f and
1 n
f in the
above expression are computed by the ARK methods for integration. Therefore, they
don‟t need to be recomputed for interpolation, making interpolation effectively “free”
(only some arithmetic operations are needed).
To see the accuracy of these interpolated solutions when solving the standard problems
considered here, the following experiment is performed. First, the problems are solved
with ARK34, ODE23, and ODE45 using the solver selected time points as is done in
Section 4.7. This results in the solver time vector t and solution matrix y . Next, the
solution at three different sets of time points are requested as given below.
152
a. tspan = 0:0.1:20. This requests 200 points at 0.1,0.2, ,20 to be
interpolated.
b. tspan = linspace(0,20,length(t)). This requests as many equidistant
points as the solver solution (more than 200 here) to be interpolated.
c. tspan = [0 20], options = odeset(‘refine’,2). This asks for one
interpolation point in the middle of every step of the solver solution.
As a first example, case (a) is applied to P3 (Duffing problem). The average norm of the
global error for these interpolated solutions is plotted in Figure 4.22. Comparing it with
Figure 4.3, it is seen that the interpolated solutions appear to be exactly as accurate as the
non-interpolated solutions. This is also the case for P4 and P6. For P1 and P5 the
accuracy of interpolated solutions is not exactly the same as non-interpolated solutions,
but they are close.
153
Figure 4.22: Accuracy plot of interpolated solutions for P3 (Duffing problem) for the
variable step size methods using case (a). The accuracy of solutions here is virtually
the same as that of Figure 4.3.
To compare the accuracy of interpolated and non-interpolated solutions more closely, the
ratio of errors of interpolated solutions over non-interpolated solutions,
interp. non-interp.
ANGE ANGE is plotted in Figure 4.23 for P3. The plot shows that the
interpolated solutions are slightly less accurate (in most cases) than non-interpolated
solutions.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 pars set 1
ARK34 pars set 2
ODE23
ODE45
154
Figure 4.23: Ratio of error of interpolated solutions over non-interpolated solutions
for P3 (Duffing problem) using case (a). The error of interpolated solutions here is
slightly larger than that of non-interpolated solutions.
Another problem is investigated next. The plot of error ratios for P7 (2 body problem
with eccentricity 0.9) using case (a) is given in Figure 4.24. It shows that the interpolated
solutions (in most cases) are close to 10 times more accurate than non-interpolated
solutions. It is surprising that interpolated results can be so much more accurate than the
underlying solver solutions.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0.8
0.9
1
1.1
1.2
1.3
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
155
Figure 4.24: Ratio of error of interpolated solutions over non-interpolated solutions
for P7 (2 body problem with eccentricity 0.9) using case (a). The accuracy of
interpolated solutions here are surprisingly 10 times higher than non-interpolated
solutions.
Therfore, to investigate this further, the error ratio calculated using interpolated solutions
produced using case (b) is plotted in Figure 4.25. The error ratio in this case is slightly
larger than case (a), but it still seems surprisingly small.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0.1
0.15
0.2
0.25
0.3
0.35
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
156
Figure 4.25: Ratio of error of interpolated solutions over non-interpolated solutions
for P7 (2 body problem with eccentricity 0.9) using case (b). The interpolated
solutions are more than six times more accurate than non-interpolated solutions.
The error ratio calculated using case (c) is now plotted in Figure 4.26. For this case, the
solver returns the solution at its own time points as well as the refine points. The
interpolation error reported here for case (c) is for the interpolated refine points only.
This plot is dramatically different and shows that the interpolated solutions are virtually
as accurate as the non-interpolated solutions (note the scale on the vertical axis).
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0.1
0.15
0.2
0.25
0.3
0.35
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
157
Figure 4.26: Ratio of error of interpolated solutions over non-interpolated solutions
for P7 (2 body problem with eccentricity 0.9) using case (c). The interpolated
solutions are virtually as accurate as non-interpolated solutions.
The reason for the difference between the results of cases (a), (b), and (c) is as follows.
The error here is calculated as the average of the norm of global error over the entire
integration time span. The numerical solution of P7 is very inaccurate at the point where
the revolving body passes close to the stationary body compared with the rest of the orbit
(see Figure 4.27). Close to this point the solver reduces the step size and spends many
steps to pass it. Case (b) has slightly more solutions near this point than (a). Case (c) is
the only one that has as many interpolation points as the solver. So, case (c) has many
more inaccurate solutions than (a) and (b). Therefore, cases (a) and (b) have higher
(average) accuracy compared to (c).
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0.98
0.985
0.99
0.995
1
1.005
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
158
So, the lesson here is that the higher accuracy of (a) and (b) is an illusion. The accuracy
of interpolation is better (more correctly) illustrated with (c). Users often use cases (a)
and (b) in their work and might over-estimate the accuracy of interpolation.
Figure 4.27: Norm of the Global Error for P7 (2 body problem with eccentricity 0.9)
over time solved using ARK34 (with parameter set 1) with
5
10
r
. (Scale of y
axis is limited to
82
10 10
.) This plot shows that global error is about 100 times
larger when revolving body is passing close to the stationary body than it is for the
rest of the orbit.
As mentioned before, ODE45‟s interpolant is 4th order. It can be shown how this can
cause the interpolated solutions to be very inaccurate for P1 (scalar problem) in Figure
4.28. However, this is not always the case. As Figure 4.29 shows, ODE45‟s
interpolation can be slightly more accurate compared to other solvers depending on the
problem.
0 5 10 15 20
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
Time
Norm of Global Error
159
Figure 4.28: Ratio of error of interpolated solutions over non-interpolated solutions
for P1 (scalar problem) using case (c). This plot shows that the interpolated solution
of ODE45 can be very inaccurate for some tolerances for this problem.
Figure 4.29: Ratio of error of interpolated solutions over non-interpolated solutions
for P4 (Euler problem) using case (c). ODE45‟s interpolation is slightly more
accurate compared to other solvers.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0
1
2
3
4
5
6
7
8
9
10
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
0.95
0.96
0.97
0.98
0.99
1
1.01
Relative Tolerance
ANGE
interp.
/ ANGE
non-interp.
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
160
4.12 Stability
4.12.1 D-stability
In this section, D-stability and convergence are proved for the variable step size ARK
methods for two cases: a) arbitrarily varying step size, and b) step sizes chosen by an
error control scheme. (See discussion on stability in Section 2.7.)
An approximate solution
n
y (2 ) nN to the initial value problem (4.1) and produced
by the ARK method (4.2) can be written as
1 00
1
1
nn i i i i
i
nn
cc cc
yy II kk
yy I 0
0
for 11 nN , where I is an l by l identity matrix. This equation can be written as
1 1 1
( , , , , , )
n n n n n n n
t t h h
y By φ y f for 11 nN , (4.31)
where
1
1
n
n
n
y
y
y
,
1
n
n
n
y
y
y
,
161
B is the 2l by 2l block matrix given by
00
cc
II
B
I 0
, (4.32)
and φ is the 2l by 1 vector defined by
1
i i i i
i
cc
φ kk
φ
0
0
.
Now consider a slightly different initial condition
0 0 0
zy Δ at time
0
t , a slightly
different approximate solution
1 1 1
zy Δ at time
1
t , and a slightly different recipe
11
( , , , , , )
n n n n n n n
t t h h h
φ z f δ (1 1) nN . Then, the ARK methods yield a
"perturbed" approximate solution
n
z (2 ) nN , which can be written as
1 00
1
1
nn n i i i i
i
n
nn
cc cc
h
zz II δ kk
zz I00
0
for 11 nN , or as
1 1 1
( , , , , , )
n n n n n n n n n
t t h h h
z Bz φ z f δ for 11 nN , (4.33)
where
162
n
n
δ
δ
0
.
4.12.1.1 Lemma 4.1
Suppose that a variable step size ARK method is used to solve the initial value problem
(4.1), and that f is a smooth Lipschitz continuous function throughout the integration
span. It can be written
21
()
1 1 1 1
e
nn
L h h
n n n n n n
z y z y le μ for 2 nN , (4.34)
where
1 n
le is the local error in
n
y , and
1 n
μ is the local error in
n
z , and all norms denote
the infinity norm,
.
Proof It can be written
1 1 1 1 1 1
( ) ( )
n n n n n n
tt
z y z u u y for 01 nN , (4.35)
where () t u is the local solution who‟s numerical solution is
n
y , and satisfies
1
d ( )
( , ( )),
d
( ) .
nn
nn
t
t t t t t
t
t
u
fu
uy
163
Taking the (infinity) norm of equation (4.35) leads to
1 1 1 1 1 1
( ) ( )
n n n n n n
tt
z y z u u y . (4.36)
The term
11
()
nn
t
uy is the local error at the end of step 1 n , and is denoted by
n
le .
Therefore,
1 1 1 1
()
n n n n n
t
z y z u le for 01 nN .
Now, consider the local solution who‟s numerical solution is
n
z , denoted by () t v , which
satisfies
1
d ( )
( , ( )),
d
( ) .
nn
nn
t
t t t t t
t
t
v
fv
vz
Denoting the local error in
1 n
z by
n
μ , it can be written
11
()
n n n
t
zv μ . (4.37)
Inequality (4.36) can then be written as
1 1 1 1
11
( ) ( )
( ) ( ) .
n n n n n n
n n n n
tt
tt
z y v μ u le
v u le μ
164
Since () t v and () t u are exact solutions of the same differential equation, and f is a
Lipschitz continuous function, it can be written
11
e ( ) ( )
e for 0 1,
n
n
Lh
n n n n n n
Lh
n n n n
tt
nN
z y v u le μ
z y le μ
(4.38)
where L is the Lipschitz constant of f [44]. Likewise,
1
1 1 1 1
e
n
Lh
n n n n n n
z y z y le μ for 1 nN . (4.39)
Inequalities (4.38) and (4.39) are now combined into one inequality using the infinity
norm as
11
11
11
max , .
nn
nn
nn
n n n n
zy
zy
zy
z y z y
Using inequalities (4.38) and (4.39) gives
1
1
1
1 1 1 1 1 1
()
1 1 1
1
()
max e , e
e max , max ,
max ,
e,
nn
nn
nn
Lh Lh
n n n n n n n n n n
L h h
n n n n n n
nn
L h h
n n n n
z y z y le μ z y le μ
z y z y le le
μμ
z y le μ
165
where
1
n
n
n
le
le
le
, and
1
n
n
n
μ
μ
μ
.
The above inequality can also be written as
21
()
1 1 1 1
e
nn
L h h
n n n n n n
z y z y le μ for 2 nN .
Thus, Lemma 4.1 is proved. □
4.12.1.2 Theorem 4.1
Suppose that a variable step size ARK method is used to solve the initial value problem
(4.1), and that f is a Lipschitz continuous function throughout the integration span. The
ARK method is then D-stable, and assuming
nn
h le and
nn
h μ , where is the
specified tolerance,
0
2 ( )
0
0,1
e max 4( )
n
L t t
n n i i n
i
tt
z y z y , (4.40)
for 2 nN .
166
Proof Relation (4.34) establishes a bound on
nn
zy based on
11 nn
zy . To show
stability, a bound based on
11
zy must be established. It is now shown that such a
bound is given by
2
0
0
1 ()
11
1
e ( )
n
ni
i
n L t t h
n n i i
i
z y z y le μ (4.41)
for 2 nN . In the following, the inequality
1 1 e
t
t for 0 t
is used, which follows from the expression
1 2
2
e1
t
tt . For 2 n , the right hand
side of inequality (4.41) becomes
2 0 0
01
()
1 1 1 1
(2 )
1 1 1 1
e
e,
L t t h
L h h
z y le μ
z y le μ
(4.42)
while inequality (4.34) becomes
01
01
()
2 2 1 1 1 1
(2 )
1 1 1 1
e
e,
L h h
L h h
z y z y le μ
z y le μ
(4.43)
167
which is the same as expression (4.42). Therefore, inequality (4.41) holds for 2 n .
Assuming it holds for nk , inequality (4.34) leads to
1
2
0
10
1
10
0
1
10
0
()
11
1 ()
()
11
1
1 ()
11
1
1 ()
11
1
e
e e ( )
e ( )
e ( )
kk
k
ki
k k i
k
ki
i
k
ki
i
L h h
k k k k k k
k L t t h
L h h
i i k k
i
k L t t h
i i k k
i
k L t t h
ii
i
z y z y le μ
z y le μ l e μ
z y le μ l e μ
z y le μ
1
10
0
1
10
0
()
()
11
1
( )e
e ( ) .
k
ki
i
k
ki
i
L t t h
kk
k L t t h
ii
i
le μ
z y le μ
Therefore, inequality (4.41) holds for 1 nk , and by induction, it holds for all
2 nN . Inequality (4.41) can be simplified by writing
1
0
0
0
1 ()
11
1
1
2 ( )
11
1
e ( )
e ( ) .
n
ni
i
n
n L t t h
n n i i
i
n
L t t
ii
i
z y z y le μ
z y le μ
Since
n n n n
z y z y , it can be written
0
11
2 ( )
0,1 1, 1,
11
e max max max
n
nn
L t t
n n i i j j
i j i i j i i
ii
z y z y le μ . (4.44)
168
The above inequality establishes a bound on the difference of the approximate solution
n
y and perturbed approximate solution
n
z , and therefore proves D-stability for an ARK
method with arbitrarily varying step size.
The error control scheme used by ARK34 as given by (4.23) is an “error per step” control
scheme. Since the estimate of the error of ARK3 is used in the error control scheme,
4
()
nn
Oh est . However, because integration is done by ARK4 (local extrapolation), the
local error of integration is actually
45
()
ARK
nn
Oh le . Therefore,
4 ARK
n n n
h est le , and
the error control scheme (4.23) can be written as
1, , 1, ,
max ( ) max ( )
ii
n n n
r n r ii
i m i m
nn
le h le
h
ss
.
Therefore, using local extrapolation with an error per step control scheme amounts to an
error per unit step control scheme with an alternate tolerance. Considering the error per
unit step control
nn
h le , inequality (4.44) becomes
0
0
0
11
2 ( )
0,1 1, 1,
11
11
2 ( )
1
0,1 1,
11
1
2 ( )
0
0,1 1,
1
e max max max
e max ( ) max
e max 2( ) max
n
n
n
nn
L t t
n n i i j j
i j i i j i i
ii
nn
L t t
i i i i j
i j i i
ii
n
L t t
i i n j
i j i i
i
h
hh
tt
z y z y μ
zy μ
zy μ .
(4.45)
169
Furthermore, if
nn
h μ , it can be written
0
0
2 ( )
00
0,1
2 ( )
0
0,1
e max 2( ) 2( )
e max 4( ) .
n
n
L t t
n n i i n n
i
L t t
i i n
i
t t t t
tt
z y z y
zy
Thus, Theorem 4.1 is proved. □
Tighter bounds than that given in (4.40) can be found. However, the bound is enlarged at
numerous points in the proof in order to simplify the proof and the final result. Stability
is proved by showing that the difference between the approximate solution and perturbed
solution of the ARK methods is bounded. Similar to the constant step size methods, this
bound depends on the initial conditions, the startup solutions, the integration span, and
the Liphschitz constant. However, it does not depend on step size, perturbation, or ARK
method‟s parameters because of the error control scheme. The error control scheme
ensures that the tolerance is met by adjusting the step size. Therefore, the bound depends
only on the tolerance. A similar result is seen in the convergence bound.
4.12.1.3 Theorem 4.2
Consider a variable step size ARK method that is used to solve the initial value problem
(4.1), where f is a sufficiently smooth Lipschitz continuous function throughout the
integration span. Then,
170
0
2 ( )
0
0,1
( ) e max ( ) 2( ) .
n
L t t
n n i i n
i
t t t t
y y y y for 2 nN . (4.46)
Furthermore, if
00
() t yy 0 and
11
() t yy 0 , the difference ()
nn
t yy goes to zero
as goes to zero, and the ARK method is convergent.
Proof Consider again the approximate solution
n
y (2 ) nN and the perturbed
solution
n
z (2 ) nN of the ARK method given by
1 0 0 1 1 1 1
( , , , , , , )
n n n n n n n n n
c c t t h h
y y y φ y y f , for 11 nN , and (4.47)
1 0 0 1 1 1 1
( , , , , , , )
n n n n n n n n n n n
c c t t h h h
z z z φ z z f δ for 11 nN , (4.48)
where
0 0 0
zy Δ ,
1 1 1
zy Δ , and
1 n
z ‟s recipe is perturbed by
nn
h δ . Recall that the
truncation error
*
nn
h δ is the difference between the exact and approximate solutions if the
method is provided with exact data. Therefore, the exact solution
1
()
n
t
y satisfies
*
1 0 0 1 1 1 1
( ) ( ) ( ) ( , , ( ), ( ), , , )
n n n n n n n n n n n
t c t c t t t t t h h h
y y y φ y y f δ . (4.49)
It is now shown that ()
n
t y (2 ) nN can be considered a perturbed solution of the
ARK method. For 1 n , it can be written
2 0 1 0 0 0 1 0 1 0 1
( , , , , , , ), c c t t h h
y y y φ y y f (4.50)
171
2 0 1 0 0 0 1 0 1 0 1 1 1
( , , , , , , ) c c t t h h h
z z z φ z z f δ , (4.51)
*
2 0 1 0 0 0 1 0 1 0 1 1 1
( ) ( ) ( ) ( , , ( ), ( ), , , ) t c t c t t t t t h h h
y y y φ y y f δ . (4.52)
Setting
0 0 0
*
1 1 1 1
*
11
( ) ,
( ) ,
,
t
t
z y y
z y y
δδ
Δ
and considering equations (4.51) and (4.52) leads to
22
() t zy . Similarly, setting
*
nn
δδ for 21 nN , and considering equations (4.48) and (4.49) leads to
()
nn
t zy for 0 nN . (4.53)
Since the same assumptions as Theorem 4.1 are made, relation (4.45) holds, and using
equation (4.53) gives
0
1
2 ( )
0
0,1 1,
1
( ) e max ( ) 2( ) max .
n
n
L t t
n n i i n j
i j i i
i
t t t t
y y y y μ (4.54)
172
Considering equations (4.37) and (4.53) leads to
11
11
()
( ) ( ).
n n n
nn
t
tt
μ z v
yv
Since both
1
()
n
t
y and
1
()
n
t
v are exact solutions of the (Lipschitz continuous)
differential equations with the same initial condition
n
z , it is seen that
11
( ) ( )
nn
tt
yv .
Therefore,
n
μ 0 , and inequality (4.54) reduces to
0
2 ( )
0
0,1
( ) e max ( ) 2( ) .
n
L t t
n n i i n
i
t t t t
y y y y
This expressions shows that if
00
() t yy 0 and
11
() t yy 0 , the difference
()
nn
t yy goes to zero as goes to zero. Thus, convergence is established, and
Theorem 4.2 is proved. □
Comparing the above bound for the variable step size methods against that of the constant
step size methods in Section 2.7.1.4 shows a major difference. The convergence of the
variable step size method does not depend on the step size or the method‟s parameters,
but the tolerance. After attempting to take a step, if the step size is too large or the
parameters are not appropriate, the error control scheme reduces the step size.
173
For convergence, what step size does for constant step size methods, the tolerance does
for variable step size methods. For the global error to approach zero, for constant step
size methods the step size must go to zero, but for variable step size methods the
tolerance must go to zero.
4.12.2 A-Stability
Again the problem yy is considered. The ARK and RK methods are deemed A-
stable for those values of h where the magnitude of the approximate solution is not
increasing. The ARK methods‟ solution to this problem can be written as (subscript n is
dropped from the
i
c )
1 11
1
10
nn
nn
SS
yy
yy
. (4.55)
For ARK3,
22
1 0 1 2 1 2 1 1
2
1 0 1 2 1 2 1 1
( )( ) ( )( ) ,
( )( ) ( )( ) .
n n n n
nn
S c r c c h r c a h
S c c c h c a h
For ARK4,
2 2 3 3
1 0 1 2 3 1 2 1 3 2 1 3 1 2 1
23
1 0 1 2 3 1 2 1 3 2 1 3 1 2 1
( )( ) ( )( ) ( )( ) ,
( )( ) ( )( ) ( )( ) .
n n n n n n
n n n
S c r c c c h r c a c a h r c a a h
S c c c c h c a c a h c a a h
174
The ARK34 method is A-stable for those values of
1 n
h
for which the maximum
modulus of eigenvalues of the matrix in (4.55) is less than or equal to 1. Figure 4.30 to
Figure 4.32 show the stability regions for ARK3 and ARK4 with the parameters given in
equations (4.9), (4.17), (4.18), (4.19), and (4.20) at various values of
n
r . The stability
region of ARK3 is independent of
1
a , so Figure 4.30 represents the stability regions of
ARK3 for both parameter sets. For comparison, the A-stability regions of the RK2 and
RK3 methods implemented in ODE23 are also plotted. (Stability of RK methods is
independent of
n
r ).
All of the stability plots here are produced numerically, so only a finite region of the
complex plane can be checked to find a stability region. In the plots here, the region
1
5 Re( ) 1
n
h
and
1
0 Im( ) 5
n
h
is checked. The ARK methods are stable in the
region enclosed by the curves and the real axis (since the stability region is symmetric
about the real axis, only the region above the real axis is plotted here). The stability
regions of ARK4 for the second parameter set are larger than for the first parameter set.
For ARK3 at 1.5
n
r and for ARK4 (with parameter set 1) at 0.75
n
r and 1
n
r , and
ARK4 (with parameter set 2) at 1.25
n
r , the stability regions are composed of a larger,
main region and a smaller, minor region. The minor regions are included for
completeness only. The ARK methods are not expected to rely on them for stability, i.e.,
for all intents and purposes, the larger stability regions are considered the only stable
regions of the ARK methods.
175
The plots show that the stability regions shrink rapidly as
n
r grows larger than 1.
Considering the very small size of the stability region for 1.5
n
r , it seems prudent to
limit the value of
n
r to max( ) 1.25
n
r .
Figure 4.30: A-stability region of the ARK3 method (parameter set 1 and 2) is
compared with that of RK2. These plots show that at 1
n
r , the stability region of
ARK methods is smaller than but comparable to RK methods. However, the ARK
stability region shrinks as
n
r increases.
-5 -4 -3 -2 -1 0 1
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Re( h
n-1
)
Im( h
n-1
)
RK2
ARK3, r = 0.5
ARK3, r = 0.75
ARK3, r = 1
ARK3, r = 1.25
ARK3, r = 1.5
176
Figure 4.31: A-stability region of the ARK4 (parameter set 1) method is compared
with that of RK3. This plot shows that at 1
n
r , the stability region of ARK4 is
smaller than that of RK3. The ARK stability region shrinks as
n
r increases.
Figure 4.32: A-stability region of the ARK4 (parameter set 2) method is compared
with that of RK3. This plot shows that at 1
n
r , the stability region of ARK4 is
smaller than that of RK3. The ARK stability region shrinks as
n
r increases.
-5 -4 -3 -2 -1 0 1
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Re( h
n-1
)
Im( h
n-1
)
RK3
ARK4, r = 0.5
ARK4, r = 0.75
ARK4, r = 1
ARK4, r = 1.25
ARK4, r = 1.5
-5 -4 -3 -2 -1 0 1
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Re( h
n-1
)
Im( h
n-1
)
RK3
ARK4, r = 0.5
ARK4, r = 0.75
ARK4, r = 1
ARK4, r = 1.25
ARK4, r = 1.5
177
4.13 Summary
A variable step size numerical integrator, ARK34 is presented. Its framework and
derivation is presented, results related to its D-stability and convergence are proved, and
it‟s A-stability regions are displayed. Using numerical examples, ARK34‟s accuracy and
speed are compared with that of Matlab‟s ODE23 solver, which has the same function
evaluation cost. The conclusions of this study are as follows.
1. The variable step size ARK34 solver developed here is a simple, embedded pair
of 3
rd
and 4
th
order ARK methods with step size selection and error control. The
solver costs 3 function evaluations per time step of integration. This makes the
ARK34 solver more efficient than the 2
nd
and 3
rd
order RK23 pair implemented as
ODE23 in Matlab, which also cost 3 function evaluations per successful time step.
2. For some of the initial value problems considered here, the error of the ODE45
method is higher than that of both the ODE23 and ARK34 methods. This
observation disproves the erroneous, but perhaps commonly held, notion that
higher order variable step size methods are always more accurate than lower order
ones. The ODE45 method executes much faster than both ARK34 and ODE23
though, because it can take larger and fewer steps to integrate over a given
interval of time.
178
3. ARK34 and Matlab‟s ODE23 and ODE45 implement a mixed absolute and
relative error control scheme that is effective and robust. However, in any step,
either the relative or the absolute error may become larger than the specified
tolerance.
4. Numerical tests on standard initial value problems show that the ARK34 method
can be 10 times more accurate (with regard to global error) than ODE23 and
ODE45 methods, given the same error tolerance.
5. For engineering grade relative error tolerances, the ARK34 method can run faster
than the ODE23 method (in addition to being more accurate), and ARK34‟s speed
ratio over ODE23 increases as the tolerance decreases. For the problems
considered here, ARK34 can run on average between 1.5 times (at relative
tolerance
7
10
) to 4 times (at relative tolerance
11
10
) as fast as ODE23 (on the
author‟s computer).
6. All solvers use interpolation to compute the solution at times requested by the
user. ARK34 uses a 4th order polynomial interpolant. The accuracy of
interpolation can be overestimated if only a few solutions are interpolated. To
correctly measure interpolation accuracy, one must use interpolated solutions
inside all solver steps. Numerical examples show that depending on the problem
179
and tolerance, the interpolated solutions may be less accurate, as accurate, or even
more accurate than the underlying solver solutions.
7. ARK34 (and Matlab solvers) rightfully stop the integration if the solver requires a
step size that is too small for the computer. This happens for one parameter set of
ARK34 when solving two of the problems considered here at very small
tolerances. A second parameter set is tuned to avoid this failure in the integration
time span considered here.
8. Determining stiffness is simple, but predicting it is not. A problem is determined
to be stiff if it takes a solver intended for stiff problems far fewer steps to solve it
than it takes a solver intended for non-stiff problems. No straightforward (or
perfect) and universally accepted method of predicting stiffness (i.e., without
solving the problem) exists.
9. The ARK34 method is proved to be D-stable and convergent, and suitable global
error bounds are provided. The A-stability region of ARK34 at low step size
ratios,
n
r , is comparable to the stability region of RK23. The stability region of
ARK34 at high step size ratios is smaller than the stability region of RK23. This
however, does not lead to more failed attempts during the integration (or any
other problems) for ARK34.
180
CHAPTER 5 - NON-SLIP ROLLING ON ARBITRARY SURFACE
In this Chapter, the methodology for developing the equations of motion of non-slip
rolling of a spherical ball on an arbitrary smooth surface is given. The derivation is
simplified and the path traced by the point of contact on the surface is produced directly
through a novel modeling method. This methodology is particularized to the motion of a
spherical ball rolling non-slip on a cylindrical surface. The results of simulations and
experiments are shown to be slightly different. A study on the sensitivity of initial
conditions appear to in large part account for the differences seen in simulation and
experimentation.
In Section 5.1, the methodology for getting the equations of motion and the path traced
by the point of contact is described. In Section 5.2, the equations of motion of the
unconstrained system are developed using Lagrange equations. In Section 5.3, the
equations of constraints are developed for a general surface, and the fundamental
equation is used to give the equations of motion for the constrained system. In Section
5.4, the methodology is applied to the motion of a spherical ball rolling non-slip on a
cylindrical surface, and the motion is simulated. In Section 5.5, two experiments are
performed with a ping-pong ball and cylindrical surface and the results are compared
with simulation. Section 5.6 includes a study of the effects of perturbations in initial
conditions that explains the differences seen between simulations and experiments.
181
Section 5.7 contains a summary. The appendix contains the matrices used to get the
equations of motion for the system used in the simulations and experiments.
5.1 Modeling
A diagram of a spherical ball rolling on a surface is shown below. The inertial frame of
reference X Y Z is located at the lowest point of the surface.
Figure 5.1: Diagram of a spherical ball rolling on a surface (not to scale).
The vector n denotes the unit vector normal to the surface at the point of contact of the
ball and surface. To describe the motion (translation and rotation) of the ball, the
following vector of generalized coordinates () t q given in the inertial reference frame
X Y Z is chosen,
()
( ) ( )
()
t
tt
t
G
S
r
qr
e
, (4.56)
182
where t denotes time. The vector () t
G
r denotes the coordinates of the center (and of
gravity) of the ball (in the inertial reference frame X Y Z ),
()
( ) ( )
()
xt
t y t
zt
G
r .
The vector
() t e denotes the Euler parameters that describe the rotation of the ball,
0
1
2
3
()
()
()
()
()
et
et
t
et
et
e .
The vector () t
S
r denotes the coordinates on the surface traced by the point of contact (in
the inertial reference frame X Y Z ),
()
( ) ( )
()
ut
t v t
wt
S
r . (4.57)
Thus, the ball‟s motion is described by a total of 10 coordinates. The. The approach for
obtaining the equations of motion involves the follwoing three steps (argument t is
dropped from most expressions for brevity).
183
1. Determination of the equations of motion of the unconstrained system: The
equations of motion of the unconstrained system are developed and written in the
form
ˆ
Mq Q , (4.58)
where M is the 10 10 mass matrix,
ˆ
q is the 10 element vector of generalized
accelerations of the unconstrained system, and Q is the 10 element vector of
generalized external forces on the unconstrained system. In this study, the only
external force on the unconstrained system is gravity.
In the unconstrained system, the kinematic constraints that exist in the system
under study are removed. In other words, the ball is not constrained to be in
contact with the surface, it does not need to be tangent to the surface, rolling may
include slip, and there are no constraints on the Euler parameters. Therefore, this
unconstrained system comprises of the ball and an arbitrary zero-mass point in
space. The ball is free to translate and rotate in space (described by the position
() t
G
r and rotation () t e ), and the zero-mass point is free to translate in space
(described by the position () t
S
r ). In the unconstrained system, all 10 coordinates
in () t q are independent.
184
2. Determination of the constraints: A set of kinematic constraint equations are
developed in terms of the coordiantes in () t q that constrain the unconstrained
system (mentionend in item 1) to become the actual system under study. These
kinematic constraints (which can be holonomic or non-holonomic) are then
written (through differentiation) in the form
Aq b , (4.59)
where A is a p by 10 matrix, q is the 10 element vector of generalized
accelerations that satisfy the constraints, and b is a p element vector. Here, p is
the number of constraints, and it is shown in Section 5.3 that 8 p .
3. Application of the fundamental equation: The fundamental equation gives the
generalized acceleration of the constrained system, thus providing the equations
of motion. It has the form [51]
()
Q I A A M
q
b A
, (4.60)
where the superscript
denotes the generalized inverse of a matrix, and I is a
10 10 identity matrix. This form of the fundamental equation is developed for
systems with a singular mass matrix. For the fundamental equation to give the
unique (and correct) equations of motion, the matrix
185
M
A
(4.61)
must have full rank.
The choice of the coordinates for describing the motion of the ball can greatly affect the
ease of writing the equations of motion. As shown in Section 5.3, the choice of
coordinates given in (4.56) makes derivation very simple. There are two reasons for this.
1. The 10 coordinates of vector q are considered independent in the unconstrained
system. Therefore, application of Lagrange‟s equations is simplified because
there is no need to derive the necessary geometric relations to relate the
coordinates (see Section 5.2).
2. Including the coordinates of the path traced by the point of contact in the system
coordinates q simplifies the derivation because the constraints can be written in
terms of the coordinates of this path. Normally, this would not be possible
because this point has zero mass which makes the mass matrix singular. It is the
special form of the fundamental equation (4.60) that allows the use of a singular
mass matrix, further simplifying the derivation.
The massless point is constrained to trace the point of contact through a set of constraints
(see Section 5.3). Other than simplifying the derivation, this novel approach has another
186
major benefit. Upon solution of the equations of motion, the path traced on the surface is
made a dynamical variable and therefore is given directly. This modeling method also
poses a difficulty because the path traced represents a massless point. Therefore, the
mass matrix describing the motion of the system becomes singular. To get the equations
of motion, the original fundamental equation cannot be used because it involves the
inverse of the mass matrix [50]. Instead, the modified fundamental equation that is
designed for systems with singular mass matrices and therefore does not require the
inverse of the mass matrix to be computed is used [51].
5.2 Derivation Step 1: Unconstrained System
To derive the equations of motion for the unconstrained system, the Lagrange equations
given by
d
( ) 0
d
ii
LL
t q q
for 1, ,10 i , (4.62)
are used. The Lagrangian is given by
L K P ,
where K is the kinetic energy, and P is the potential energy of the unconstrained
system. The right hand side of equation (4.62) is zero because there are no non-
conservative external forces acting on the unconstrained system. The only external force
187
is gravity, which is conservative. Through algebraic evaluation and simplification,
equation (4.62) is written in the form of equation (4.58) to find M and Q . This
algebraically intensive process is performed in Maple, and is summarized below.
The kinetic energy is the sum of rotational and translational kinetic energies,
rot tra
K K K .
The rotational kinetic energy is given by
1
2
T
rot
K ω J ω,
where
1
2
3
()
( ) ( )
()
t
tt
t
ω
is the rotational velocity of the ball with respect to the inertial frame X Y Z (Figure 5.1)
but expressed in the body frame (superscript
T
denotes the transpose), and J is the
inertial matrix of the ball.
The massless particle does not contribute to the kinetic or potential energy. The
rotational velocity can be written in terms of the Euler parameters as
188
2 ω E e ,
where
1 0 3 2
2 3 0 1
3 2 1 0
e e e e
e e e e
e e e e
E ,
and ()
ii
e e t . The translational kinetic energy is given by
1
2
T
tra
Km
GG
rr ,
where m is the mass of the ball. The potential energy is given by
P mgz ,
where g is the gravitational constant, and z is the height of the center of the ball with
respect to the inertial frame. After evaluation and simplification of the Lagrange
equation (4.62), equation (4.58), which includes the M matrix and Q vector are
obtained.
189
5.2.1 Alternate Formulation
There is an alternate method for deriving the equations of motion for the unconstrained
system than applying the Lagrange equations directly as done in the previous section
(which is referred to as the “direct method” here). This alternative method, which is
described in [52], is reproduced in the following. The equations of motion resulting from
the alternative method are analytically the same as those of the direct method. However,
they may be difficult to solve numerically and the numerical solution may be different
than the direct method. It is now shown how to avoid this problem.
The rotational kinetic energy of the ball can be written as
4 4 4
00
1
02
0 2
T T T T
rot
d
KJ
J
ω ω ω e E J E e
I ω
,
where
4
( , ) Diag d J JI , I is a 3 by 3 identity matrix, d can be any positive (real)
number, and
4
E is the 4 by 4 matrix
4
T
e
E
E
.
190
Applying the Lagrange equations
d
0
d
KK
t
ee
gives
4 4 4 4 4 4 4 4 4
4 8 4 0
T T T
E J E e E J E e E J E e .
The above is the equations of motion for the rotational motion of the unconstrained ball.
It can be written as
rot rot
M e Q ,
where
4 4 4
4
T
rot
M E J E and
4 4 4 4 4 4
84
TT
rot
Q E J E e E J E e .
Adding to the above, the equations of motion for the center of the ball and the point of
contact, the complete equations of motion for the unconstrained system are given in the
form of
ˆ
Mq Q ,
191
where
33
rot
m
I
M
M
0 , and 0 0 0 0 0
T
T
rot
mg
QQ .
As mentioned before, d can be any positive (real) number such as 1 for the equations to
be analytically correct. However, the rotational inertia of the body may be very small
compared to 1. For example in the experiment,
7
6.42978 10 J
. Having vastly
different magnitudes in a differential equation often makes numerical integration
difficult, which in fact happens here. This problem can be prevented by choosing dJ .
Specifically, the 2nd simulation in this study (see Section 5.5.2) requires the numerical
integration of the equations of motion for 0 to 1.1 seconds. This integration using
Matlab‟s ODE45 with relative and absolute tolerances of
8
10
and
11
10
for 1 d
requires 127250 steps. However, the same problem with dJ requires only 337 steps.
Furthermore, the global accuracy of the solution also suffers when 1 d . The 2-norm of
the difference between the 1 d solution and the direct method solution is of the order
4
10
. However, that difference for dJ and the direct method is of the order
9
10
.
192
5.3 Derivation Step 2: Constraints
In the following, the equations of constraints are derived (argument t is dropped for
brevity).
5.3.1 Surface Contact
In the constrained system, the path traced on the surface by the point of contact must
remain on the surface. Therefore, the coordinates of this path ( ) [ ( ) ( ) ( )] t u t v t w t
S
r
must satisfy the equation of the surface, i.e.,
( , , ) 0 f u v w , (4.63)
where f represents the equation of the surface. The above is the surface contact
constraint, and can be used to derive the equations of motion for any system in which the
equation of the surface is known. Because this equation must be differentiated to be put
in the form of equation (4.59), it must be a smooth function, and hence represent a
smooth surface.
5.3.2 Tangency
The ball and the surface are tangent to each other on the path traced by the point of
contact. Therefore, the tangency constraint can be written as
193
r
GS
r r n . (4.64)
where r is the radius of the ball, and n is the surface‟s normal vector (perpendicular to
surface) with magnitude 1 that points toward the ball,
( , , )
( , , )
f u v w
f u v w
n . (4.65)
sign in the above expression is chosen so that the vector n points toward the ball. This
constraint is simple to write because the coordinates of the path traced on the surface are
included in the system coordinates.
5.3.3 Non-Slip Rolling
The rolling of the ball occurs without slip. In other words, at every instant of time, the
ball rotates around the point of contact with rotational velocity ω . Therefore,
considering Figure 5.1, the no-slip rolling constraint can be written as
() r
G
rSωn . (4.66)
where
194
2 2 2 2
0 1 2 3 1 2 0 3 1 3 0 2
2 2 2 2
1 2 0 3 0 1 2 3 2 3 0 1
2 2 2 2
1 3 0 2 2 3 0 1 0 1 2 3
2( ) 2( )
2( ) 2( )
2( ) 2( )
T
e e e e e e e e e e e e
e e e e e e e e e e e e
e e e e e e e e e e e e
S
( ()
ii
e e t ) is the rotation matrix that ensures the rotational velocity is expressed in the
inertial frame.
5.3.4 Euler Parameters
The magnitude of the Euler parameters vector e must equal 1. Therefore, the Euler
parameters constraint can be written as
2 2 2 2
0 1 2 3
1 e e e e . (4.67)
5.3.5 Constraint Form Aq b
The above constraint equations must be put in the form Aq b . To do so, equation
(4.66) is differentiated once and equations (4.68), (4.64), and (4.67) are differentiated
twice. The resulting A matrix and b vector are used by the fundamental equation (4.60)
to give the equations of motion of the system.
195
5.3.6 Constraints For The Cylindrical Surface
The methodology here is applied to a spherical ball rolling non-slip on a cylindrical
surface of radius R . The inertial frame of reference X Y Z is located at the lowest point
of the surface (as shown in Figure 5.1). The constraints for this system are given below.
1. The equation of the cylindrical surface is
2 2 2
ˆˆ() x y R R , where ˆˆ , xy are in the
, XY directions of the inertial reference frame. Therefore, the contact constraint
becomes
2 2 2
() u w R R . (4.68)
1. The negative sign is used in expression (4.65) so that the vector n points toward
the ball, and the tangency constraint becomes
0
u
xu
R
yr
z w R w
R
. (4.69)
The third component of this constraint is redundant for this system (see Appendix
H for proof). This does not pose a problem because dependent constraints can be
used by the fundamental equation to produce the equations of motion.
196
2. The general non-slip constraint (4.66) applies here, i.e.,
() r
G
rSωn , (4.70)
with the vector n given by
0
T
u R w
RR
n .
3. The Euler parameters constraint (4.67) remains unchanged, i.e.,
2 2 2 2
0 1 2 3
1 e e e e . (4.71)
The resulting A matrix and b vector and the M matrix and Q vector for the ball and
cylindrical surface are given in Appendix H.
5.4 Simulation
Applying the fundamental equation (4.60) to the particular problem of a ball and a
cylindrical surface numerically in Matlab yields the equations of motion (a set of 20 first
order ordinary differential equations). They, along with a set of initial conditions, i.e.,
initial position, orientation, and velocity, measured in the experiments (see Section 5.5)
form an initial value problem. To check the simulation results, it is solved by ARK34
(with parameter set 2) and ODE23 with a relative error tolerance of
11
10
, and an
197
absolute error tolerance of
14
10
. For this particular problem, ODE23 is more accurate
than ARK34 (see Figure 4.10). However, the difference is so small that there‟s no visible
difference between the motion of the ball in simulation of the two numerical solutions.
Furthermore, ARK34 solves this problem much faster, and its solution satisfies the
constraints better than ODE23‟s solution (see plots below).
The numerical solution is calculated at the times that the camera records a frame in the
experiment. For the simulation motion to be correct, the solution of the equations of
motion must satisfy the constraints. In Figure 5.2 to Figure 5.5 the error in the
satisfaction of the constraint equations when simulating experiment 2 (see Section 5.5.2)
is plotted (see Section 5.5.2). The error is quantified by the difference between the left
and right hand sides of the constraint equations. The figures show that the error is of the
same order as the relative tolerance used in numerical integration (order of
11
10
or
smaller) to indicate that the constraints are effectively satisfied.
For comparison, errors in the satisfaction of the constraints are also shown when the
problem is solved using ODE23. The plots show that ODE23‟s solution satisfies the
constraints within numerical error, but the error is larger than in the ARK34 case.
198
Figure 5.2: Error in satisfaction of the surface constraint (4.68) solved using ARK34
parameter set 2 (solid line) and ODE23 (dashed line). This plot shows that the
constraint is satisfied within numerical error better by ARK34.
Figure 5.3: Error in satisfaction of the tangency constraint (4.69) solved using
ARK34 parameter set 2 (solid lines) and ODE23 (dashed lines). This plot shows
that the constraint is satisfied within numerical error better by ARK34.
0 0.2 0.4 0.6 0.8 1
-2
0
2
4
6
8
10
12
14
16
18
x 10
-13
Time
Error
0 0.2 0.4 0.6 0.8 1
-20
-15
-10
-5
0
5
x 10
-13
Time
Error
x comp.
y comp.
z comp.
199
Figure 5.4: Error in satisfaction of the no-slip constraint (4.70) solved using ARK34
parameter set 2 (solid lines) and ODE23 (dashed lines). This plot shows that the
constraint is satisfied within numerical error better by ARK34.
Figure 5.5: Error in satisfaction of the Euler parameter constraint (4.71) solved using
ARK34 parameter set 2 (solid line) and ODE23 (dashed line). This plot shows that
the constraint is satisfied within numerical error better by ARK34.
0 0.2 0.4 0.6 0.8 1
-4
-3
-2
-1
0
1
2
3
4
5
6
x 10
-11
Time
Error
x comp.
y comp.
z comp.
0 0.2 0.4 0.6 0.8 1
-10
-8
-6
-4
-2
0
2
x 10
-11
Time
Error
200
In Figure 5.6, Figure 5.7, and Figure 5.8 the coordinates of the center of the ball, the
coordinates of the path traced by the point of contact, and the rotation of the ball (as Euler
parameters), respectively, obtained over time for the simulation of experiment 2 are
shown.
Figure 5.6: The coordinates of the center of the simulation ball with respect to the
inertial frame in simulation of experiment 2.
0 0.2 0.4 0.6 0.8 1
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
0.25
Time
Position of the Center of Ball
x
y
z
201
Figure 5.7: The coordinates of the path traced by the point of contact in simulation
with respect to the inertial frame in simulation of experiment 2.
Figure 5.8: The rotation of the simulation ball (as Euler parameters) with respect to
the inertial frame in simulation of experiment 2.
Figure 5.9 shows a diagram of the matlab interface used for comparing the simulation
and experiment results. The matlab code creates an animation that displays the camera
0 0.2 0.4 0.6 0.8 1
-0.15
-0.1
-0.05
0
0.05
0.1
0.15
0.2
0.25
Time
Position of the Point of Contact
u
v
w
0 0.2 0.4 0.6 0.8 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time
Rotation of Ball (as Euler Parameters)
e0
e1
e2
e3
202
frames simultaneously with the simulated plot of the ball. This animation clearly
displays the change in translation and rotation of the ball in both simulation and
experiment, thereby producing a frame-by-frame comparison.
Figure 5.9: Diagram of the Matlab interface for comparing simulation and
experiment results.
5.5 Experiments
A physical experiment is now performed to compare the theoretically computed motion
of the ball with the actual motion of a ping-pong ball rolling on a cylindrical surface.
Figure 5.10 shows a diagram of the experiment setup. An artist‟s cutting board (flexible
rubber sheet) with a printed grid pattern, is used for the surface (see Figure 5.12). The
board is placed on four rigid supports with a circular cut, making the sheet take the shape
of a partial cylinder. A ping-pong ball with printed grid lines rolls on this surface given a
Solve equations of
motion using
numerical solver.
Import camera frame 1
from file and display it.
Plot the surface in another
figure and draw gridlines
corresponding to frame
Adjust simulation
camera to match
experiment camera.
Plot path of center of
ball and point of contact
on surface.
Draw a sphere to represent
the experiment ball at the
experiment initial conditions.
Display the next frame in the experiment
figure, and update the position and orientation
of the ball in the simulation figure.
Repeat for all frames.
203
certain initial position and velocity. Table 5.1 lists the physical constants of the
experiment and their values.
Figure 5.10: Diagram of experiment setup (not to scale).
Constant Value Description
r 1.89 cm Radius of the ball
R
20 inch Radius of the surface
m 2.7 g Mass of the ball
J
2
2
3
mr Rotational Inertia of the ball
g
9.81 m/s
2
Gravity constant
Table 5.1: Physical constants of the rolling ball experiment.
A high speed camera records the motion of the ball at 120 frames per second. The
recorded frames are imported into Matlab, where they are displayed beside the simulation
figure (see Figure 5.12). The initial conditions of the experiment are measured using the
camera
supports
level surface
204
recorded frames and used for the simulation. The scale and viewpoint of the simulation
are matched with the experiment to facilitate comparison of the motion of the ball.
Two experiments with two different types of initial conditions are performed to produce
two different paths of motion: zero initial velocity, and non-zero initial velocity.
5.5.1 Experiment 1: Zero Initial Velocity
In this experiment, the ball is let-go from a high point of the surface. Naturally, it is
expected to roll to the other side and back in a straight line, i.e., two dimensional motion.
Initial Condition Value
0
x -0.1832 m
0
x 0
0
y 0
0
y 0
Table 5.2: Initial conditions (rounded to 4 significant figures) for experiment 1.
Figure 5.11 shows the simulated path that the center of the ball (blue) and the path taken
by the point of contact (red) take given the initial conditions of Table 5.2. Initial
rotational position and velocity are also zero.
205
Figure 5.11: Simulation of the path taken by the center of the ball (blue) and the path
taken by the motion of point of contact (red) on the surface when starting with the
initial conditions of Table 5.2.
Figure 5.12 shows frame 185 of both experiment and simulation, both given the initial
conditions of Table 5.2. Therefore, both show the location and orientation of the ball at
the same point in time, 185/120 t seconds. The simulation plot is scaled to match the
experiment for easy comparison. The simulation grid lines are also scaled to match the
half inch grid lines of the experiment.
Frame 185 is the point at which the ball comes to rest after completing one period. The
two plots show that the experiment ball does not reach it‟s starting position, and lags
behind the simulation ball which does reach the starting point. This disparity is due to
two reasons. In Section 5.6, it is shown how perturbations that are within the range of
measurement errors can greatly affect the motion of the ball, and therefore account for
206
this disparity. Other possible causes for this disparity include factors not modeled in the
simulation such as friction, elasticity of the ball and the surface, and aerodynamic drag.
Figure 5.12: Frame 185 of simulation (bottom) and experiment (top). The
simulation grid lines correspond to the experiment minor gird lines. This figure
shows that the simulation and experiment do not match exactly.
100 200 300 400 500 600 700 800 900
100
200
300
400
500
600
x
y
207
5.5.2 Experiment 2: Non-zero Initial Velocity
In this experiment, the ball starts with a non-zero initial velocity and takes on a three
dimensional motion. The experimentally measured initial conditions for this experiment
are listed in Table 5.3.
Initial Condition Value
0
x -0.05807 m
0
x 0.7052 m/s
0
y 0.1232 m
0
y -0.2426 m/s
Table 5.3: Initial conditions (rounded to 4 significant figures) for experiment 2.
Figure 5.13: The path taken by the center of the ball (blue) and the path of the
motion of point of contact (red) on the surface when starting with the initial
conditions of Table 5.3.
Figure 5.14 shows frame 27 of experiment and simulation both given the same initial
conditions of Table 5.3. Therefore, both show the location and orientation of the ball at
208
the same point in time, 27 /120 t seconds. The path taken by the center of the ball in
the experiment is also shown in Figure 5.14. Again, the simulation plot is scaled to
match the experiment for easy comparison. Figure 5.15 shows the x and y positions of
the center of the experiment ball minus those of the simulation ball.
Figure 5.14: Frame 27 of experiment (bottom) and simulation (top). The simulation
grid lines correspond to the experiment minor gird lines. This figure shows that the
simulation and experiment do not match exactly.
100 200 300 400 500 600 700 800 900
100
200
300
400
500
600
x
y
209
Figure 5.15: The x and y positions of the center of the ball in experiment minus
those in simulation.
As mentioned before, it is shown in Section 5.6 how perturbations that are within the
range of measurement errors can greatly affect the motion of the ball, and therefore
account for the difference seen in the plots above. In other words, the initial conditions
used in the simulation are slightly different than the actual initial conditions in the
experiment, and that‟s what causes the differences seen here. Other possible causes for
this disparity include factors not modeled in simulation such as friction, elasticity of the
ball and the surface, and aerodynamic drag.
It can be seen that while the two plots of Figure 5.14 are close, they do not match exactly.
In fact, the difference in the x and y positions of the centers of the two balls are shown
in Figure 5.15 to reach approximately 2 and 3 cm, respectively. The x and y positions
of the experiment ball are measured in Matlab (using the “image processing” toolbox) by
0 0.2 0.4 0.6 0.8 1
-0.03
-0.02
-0.01
0
0.01
0.02
0.03
0.04
Time
Experiment Position Minus Simulation Position
x
y
210
analyzing the experiment‟s recorded images. It is possible to measure only the x and y
positions of the center of the ball with respect to the inertial frame, and the results are
used to create Figure 5.15. Information related to the rotational motion of the ball could
not be extracted because of limitations of the Matlab environment.
5.6 Sensitivity to Initial Conditions
In this section, an attempt is made to understand the main factors that might account for
the discrepancy between the simulated and experimental results. First, the measurement
error in the initial conditions is quantified. Then, the motion resulting from perturbed
initial conditions that are within the range of measurement errors is simulated.
To get the initial conditions of this system, four initial values are measured:
0
x ,
0
x ,
0
y ,
and
0
y , and the rest are calculated using the constraint equations. Frame 1 of the
experiment, shown in Figure 5.16, is used for initial condition measurements.
211
Figure 5.16: Frame 1 of experiment 2. This figure is used for initial condition
measurements.
A diagram of this frame, shown in Figure 5.17, illustrates how the initial conditions are
measured. The coordinates of a point are measured in pixels with respect to the XY
coordinate system on the top left corner of this diagram. This XY coordinate system is
separate from the inertial frame used in modeling the system. The coordinates ( , )
xy
ee
are of the top left corner of the square drawn with dashed lines measured in pixels (in the
XY coordinate system). This square helps to measure the coordinates of the center of the
ball and its radius accurately. The center of the diagram ( , )
xy
cc has coordinates
measured in pixels (in the XY coordinate system). It coincides with the origin of the
inertial frame of reference and is used to find the coordinates of the center of the ball.
212
Figure 5.17: Diagram of frame 1 (Figure 5.16). It is used for measuring initial
conditions (not to scale).
From Figure 5.17, it is seen that the x coordinate of the center of the ball with respect to
the inertial reference frame (at the center of diagram) is
0
( 2)
xx
x c e in pixels,
where is the diameter of the ball measured on computer screen in pixels. The unit is
converted from pixels to meters as
0
2
( 2)
xx
r
x c e
in meters,
where r is the radius of the ball measured in the experiment in meters (see Table 5.1).
Each single distance measurement made on the frame (on computer screen) has an error
`
η
(e
x
, e
y
)
(c
x
, c
y
)
X
Y
213
of 1 pixel. Therefore, the distance resolution of measurements in this experiment is 1
pixel and in meters it is
4
2 [mm] 37.8 mm
distance resolution 1[px] 4.55 10 m
[px] 83 px
r
.
The angle resolution of measurements is
4
2
distance resolution 4.55 10
0.0241rad 1.38
1.89 10 r
.
Reducing the height of the camera can generally reduce the distance and angle
resolutions. However, in this experiment if the camera is lowered any further, parts of
the surface cannot be captured in the frame. The minimum and maximum values of
0
x
can be
max
0
2
( 1) ( 1) ( 1) 2
( 1)
xx
r
x c e
, (4.72)
min
0
2
( 1) ( 1) ( 1) 2
( 1)
xx
r
x c e
. (4.73)
The difference
max min
00
xx is the range of error in measurements of the initial condition
0
x . Similarly, the values of
min
0
y and
max
0
y are found. Furthermore, these position values
214
are found for another frame, and used to calculate the range in velocity. The velocity is
measured over five frames rather than one frame to minimize the measurement error. It
follows that
min max
min
50
0
5 120
xx
x
, and
max min
max
50
0
5 120
xx
x
,
where
max
5
x and
min
5
x are calculated similarly as equations (4.72) and (4.73) but for frame
5. Likewise,
min
y and
max
y are calculated. The results are listed in Table 5.4.
Initial Condition Bound Value
min
0
x -0.05993 m
max
0
x -0.05625 m
min
0
x 0.6480 m/s
max
0
x 0.8053 m/s
min
0
y 0.1206 m
max
0
y 0.1259 m
min
0
y -0.2128 m/s
max
0
y -0.1954 m/s
Table 5.4: The bounds on the measured initial conditions (rounded to 4 significant
figures) based on measurement errors under the experimental conditions.
Now the effect of initial condition variations on the motion of the ball is simulated.
Figure 5.18 shows frame 27 of the simulation given the nominal initial conditions of
Table 5.3. The next four figures show the same frame of simulation, each simulation
215
having been done with a different initial condition that is within the error bounds of the
experimental observations listed in Table 5.4. These initial conditions are given by
max
max
max
max
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
( ),
( ),
( ),
( ),
x x x x
x x x x
y y y y
y y y y
(4.74)
where the tilde denotes the perturbed initial condition used here. One case is presented in
which is set specifically, 0.3 (see Figure 5.19). Three cases are presented in
which the four ‟s are uniformly chosen from a random distribution between -1 and 1
(see Figure 5.20, Figure 5.21, and Figure 5.22). Two markings are made on the ball in
each figure to help determine its orientation. First, two black and one gray short lines are
printed on the ball. Second, one of the equator lines is gray while the other two are black.
216
Figure 5.18: Frame 27 of experiment 2 simulation given nominal initial conditions
of Table 5.3. Compare with the next four figures to see the effect of sensitivity to
changes in the initial conditions.
Figure 5.19: Frame 27 of experiment 2 simulation given perturbed initial conditions
based on equations (4.74) and 0.3 . Compare with Figure 5.18 to see the effect
of sensitivity to changes in the initial conditions.
217
Figure 5.20: Frame 27 of experiment 2 simulation given perturbed initial conditions
based on equations (4.74) and random ‟s. This is the first of three simulations
with random ‟s. Compare with Figure 5.18 to see the effect of sensitivity to
changes in the initial conditions.
Figure 5.21: Frame 27 of experiment 2 simulation given perturbed initial conditions
based on equations (4.74) and random ‟s. This is the second of three simulations
with random ‟s. Compare with Figure 5.18 to see the effect of sensitivity to
changes in the initial conditions.
218
Figure 5.22: Frame 27 of experiment 2 simulation given perturbed initial conditions
based on equations (4.74) and random ‟s. This is the third of three simulations
with random ‟s. Compare with Figure 5.18 to see the effect of sensitivity to
changes in the initial conditions.
The above plots show that the motion of the ball can be very different for small changes
in the initial conditions that are within the range of measurement errors. The difference
between the simulation and experiment seen in Section 5.5.2 seems less than the
difference between the nominal and some of the perturbed simulations shown here.
Therefore, it appears plausible that the difference between simulation and experiment is
most likely caused to a large extent by experimental measurement error.
Furthermore, it is seen that the path of the ball in some of the simulations with perturbed
initial conditions is closer to the experiment than the nominal simulation is. For example,
the path seen in Figure 5.22 is closer to the path in experiment than the nominal
simulation is (Figure 5.14). This suggests that the initial conditions of Figure 5.22 may
219
have been closer to the actual initial conditions of the experiment than the initial
conditions of the nominal simulation are.
Great care is taken in designing, building, and performing the experiment to minimize
any errors. The notable difference between the results of simulation and experiment seen
in Figure 5.15 is not due to any flaw in the experiment or analysis. As the analysis on
sensitivity of changes to initial conditions shows, this system appears to be simply very
sensitive to errors in initial conditions. Therefore, producing a simulation that matches
the experiment very closely requires much more precise laboratory tools and setup.
Given the precision of the measurement tools of this experiment, it appears unlikely that
one can produce a simulation that matches the experiment exactly.
5.7 Summary
In this chapter, a new simple methodology for obtaining the equations of motion for non-
slip rolling of a spherical ball and the path of motion on an arbitrary smooth surface is
provided. The main conclusions are as follows.
1. This methodology uses the equation describing a general smooth (linear or non-
linear) surface to develop the constraints. Therefore, it can be applied to an
arbitrary smooth surface provided the equation of the surface is known.
220
2. In this methodology, the coordinates of the point on the surface traced by the
point of contact are included in the system coordinates. Therefore, the path traced
on the surface is given directly upon the solution of the equations of motion.
Furthermore, this inclusion simplifies the derivation of constraints.
3. In this methodology, an arbitrary massless point in the unconstrained system is
constrained to become the point on the surface traced by the point of contact.
This novel modeling approach makes it possible to include the coordinates of the
traced path in the system coordinates.
4. The use of a massless point in the system coordinates results in a singular mass
matrix, which is handled by an alternate form of the fundamental equation
designed for systems with singular mass matrices.
5. The methodology is particularized to the motion of a spherical ball rolling non-
slip on a cylindrical surface. Simulations and experiments on this system are
performed and compared. The motion of the ball in the two experiments is close
to the simulations, but differences exist. It is shown that sensitivity to initial
conditions that are within the range of measurement errors could account for a
large part of this difference. (Other possible causes include friction, elasticity of
the ball and surface, and aerodynamic drag, etc.) Accurately simulating the
motion of this system to match a physical experiment appears to be difficult.
221
CHAPTER 6 - CONCLUSIONS
Numerical integration is essential in solving most initial value problems such as the
equations of motion of mechanical systems. A new set of numerical integrators, named
the Accelerated Runge-Kutta (ARK) methods are developed for this purpose. A detailed
treatment of these methods is presented, which includes motivation, derivation, parameter
selection, accuracy, speed, stability and convergence studies. Also, a new methodology
for the development of equations of motion of non-slip rolling of a spherical ball on an
arbitrary smooth surface as well as the path traced on the surface is presented. This
methodology is applied to the case of a spherical ball and a cylindrical surface, and
simulations and experiments are performed and copared. A summary is included at the
end of every chapter. The following are the main conclusions of this study.
6.1 Constant Step Size Autonomous ARK Methods
1. The new set of constant step size ARK numerical integration methods are
developed for the solution of autonomous initial value problems. The simplicity
of these methods reduces their computational cost and simplifies their derivation.
Their parameter selection technique increases their order of accuracy for some
problems. Three sets of parameters for ARK3, ARK4, ARK4-4, and ARK5
methods are provided.
222
2. The ARK methods are proved to be D-stable and convergent, and they are shown
to have acceptable A-stability regions.
3. Numerical examples show that ARK3 and ARK4 take a little more time to
execute than RK2 and RK3, respectively. However, in exchange, they provide a
solution that is much more accurate. Furthermore, this advantage grows as the
step size reduces. This result inspires the creation of the variable step size ARK
methods.
6.2 Constant Step Size Non-autonomous ARK Methods
1. The non-autonomous ARK methods can solve non-autonomous problems
directly. They are as accurate but faster than the autonomous ARK methods.
Therefore, the non-autonomous ARK3 and ARK4 also give much more accurate
solutions than RK2 and RK3, respectively for a little extra time.
2. The non-autonomous ARK methods are D-stable and convergent, and their A-
stability regions are the same as autonomous ARK methods.
223
6.3 Variable Step Size ARK methods
1. The newly developed variable step size ARK34 integrator is a 4th order solver
equipped with step size selection and error control. It achieves 4th order accuracy
with 3 function evaluations per time step of integration.
2. ARK34 uses an effective and robust error control scheme that combines the
strengths of relative and absolute error control schemes. This scheme controls
either the relative error or the absolute error at every step, not both.
3. Using a 4th order interpolation scheme, ARK34 can provide the numerical
solution at any requested point. Interpolation accuracy can be correctly measured
by using the interpolated solutions inside every solver step. Interpolated solutions
may be less accurate, as accurate, or even more accurate than the solver solutions.
4. The ARK34 method is proved to be D-stable and convergent. Convergence (not
stability) states that the approximate solution converges to the exact solution as
the tolerance goes to zero. ARK34‟s A-stability regions shrink with increasing
step size ratio, but this does not cause an increase in failed steps (or any other
problems).
224
5. Numerical examples show that ARK34 can be 10 times (or more) more accurate
than ODE23. Furthermore, for engineering grade tolerances, ARK34 can also run
up to 4 times as fast as ODE23.
6. Testing on standard problems shows that ARK34 can be 10 times more accurate
than ODE45. This shows that higher order variable step size methods are not
necessarily more accurate than lower order methods (in terms of global error).
7. A good solver (those considered here) stops the integration if it requires a step
size that is too small for the computer. This happens for one parameter set of
ARK34 for two problems at the smallest tolerances considered here. A second
parameter set is tuned to avoid this in the integration time span considered here.
8. A problem is determined to be stiff if it takes a solver intended for stiff problems
far fewer steps to solve it than it takes a solver intended for non-stiff problems.
No straightforward and universally accepted method of predicting stiffness
(without solving the problem) exists.
9. ARK34, by it‟s structure, is more efficient than ODE23. Furthermore, higher
order variable step size methods generally take step sizes large enough that they
more than compensate for the methods‟ higher cost per step. That‟s why ODE45
is generally faster than ARK34 which is generallay faster than ODE23. All of
these methods satisfy the user specified error tolerance locally similarly well;
225
however, some can be tuned to be globally more accurate than others. That is
how a variable step size solver, ARK34, can be created which can be
simultaneously more accurate and faster than the popular ODE23 solver.
6.4 Non-slip Rolling
1. The methodology presented here uses the equation describing a general surface to
develop the constraints. Therefore, it can be applied to an arbitrary (linear or
nonlinear) smooth surface provided the equation of the surface is known.
2. The use of this methodology directly gives the path traced on the surface upon
solving the equations of motion. This is made possible because the coordinates
on the surface traced by the point of contact are included in the system
coordinates. Furthermore, this inclusion simplifies the derivation of constraints.
3. This inclusion is made possible by a novel modeling approach. An arbitrary
massless point in the unconstrained system is constrained to represent the path on
the surface traced by the point of contact. Therefore, this approach makes
possible the development of the dynamics of a massless point.
4. The use of a massless point in the system coordinates results in a singular mass
matrix, which is used by an alternate form of the fundamental equation designed
226
for systems with singular mass matrices to develop the equations of motion of the
constrained system.
5. This methodology is particularized to the motion of a spherical ball rolling non-
slip on a cylindrical surface. Simulations and experiments on this system are
performed and compared. The motion of the ball in the two experiments is close
to the simulations, but differences exist. It is shown that sensitivity to initial
conditions that are within the range of experimental measurement errors could
account for a large part of this difference. (Other possible causes include friction,
elasticity of the ball and surface, and aerodynamic drag, etc.) Accurately
simulating the motion of this system to match a physical experiment appears to be
difficult.
227
BIBLIOGRAPHY
[1] Abdul-Majid, Z., and M. Suleiman, “Solving large systems of ordinary differential
equations with four point block method on parallel computer”, European Journal
of Scientific Research, 29(4): 491--501, 2009.
[2] Aiken, R., Stiff Computation, Oxford University Press, 1985.
[3] Baruh, H., Analytical Dynamics, McGraw-Hill, 1999.
[4] Benenti, S., “A user-friendly approach to the dynamical equations of non-
holonomic systems”, Symmetry, Integrability and Geometry: Methods and
Applications, 3:36--69, 2007.
[5] Bhattacharya, S., and S. Agrawal, “Design, experiments and motion planning of a
spherical rolling robot”, Proceedings of the 2000 IEEE International Conference
on Robotics & Automation, San Francisco, April 2000.
[6] Bogacki, P., and L.F. Shampine, “A 3(2) pair of Runge-Kutta formulas”, Applied
Mathematics Letters, 2(4):321--325, 1989.
[7] Borisov, A.V., and I.S. Mamaev, “Rolling of a rigid body on plane and sphere
hierarchy of dynamics”, Regular and Chaotic Dynamics, 7(2):177--200, 2002.
[8] Butcher, J.C., “An introduction to “almost Runge-Kutta” methods”, Applied
Numerical Mathematics, 24: 331--342, 1997.
[9] Butcher, J.C., “On Runge-Kutta processes of high order”, The Journal of
Australian Mathematical Society, 4:179--194, 1964.
[10] Butcher, J.C., Numerical Methods for Ordinary Differential Equations, Wiley,
2003.
[11] Byrne, G.D., “Parameters for Pseudo Runge-Kutta methods”, Communications of
the ACM, 10(2):102--104, 1967.
[12] Byrne, G.D., and R.J. Lambert, “Pseudo-Runge-Kutta methods involving two
points”, Journal of the Association for Computing Machinery, 13(1):114--123,
1966.
[13] Caira, R., and C. Costabile, and F. Costabile, “A class of pseudo Runge-Kutta
methods”, BIT, 30: 642--649, 1990.
228
[14] Campos, L., and J.L. Fernandez-Chapou, and A.L. Salas-Brito, and C.A. Vargas,
“A sphere rolling on the inside surface of a cone”, European Journal of Physics,
27:567--576, 2006.
[15] Chaplygin, S.A., “On a ball‟s rolling on a horizontal plane”, Mathematical
Collection, 1:76--101, 1903.
[16] Coddington, E.A., and N. Levinson, Theory of Ordinary Differential Equations,
McGraw-Hill, 1955.
[17] Cong, N.H., and N.V. Minh, “Improved parallel-iterated pseudo two-step RKN
methods for nonstiff problems”, Southeast Asian Bulletin of Mathematics, 32: 263-
-280, 2008.
[18] Costabile, F., “Metodi Pseudo Runge-Kutta di seconda specie”, Calcolo, 7(3--
4):305--322, 1970.
[19] Dormand, J.R., and P.J. Prince, “A family of embedded Runge-Kutta formulae”,
Journal of Computational and Applied Mathematics, 6(1):19--26, 1980.
[20] Dormand, J.R., and P.J. Prince, “Runge-Kutta triples”, Computers and
Mathematics with Applications, 12A(9): 1007--1017, 1986.
[21] Enright, W. H., and J. D. Pryce, “Two FORTRAN packages for assessing initial
value methods”, ACM Transactions on Mathematical Software, 13(1): 1--27, doi:
http://doi.acm.org/10.1145/23002.27645, 1987.
[22] Enright, W. H., and J.D. Pryce, “Algorithm 648: NSDTST and STDTST: routines
for assessing the performance of IV solvers”, ACM Transactions on Mathematical
Software, 13(1): 28--34, doi: http://doi.acm.org/10.1145/23002.214338, 1987.
[23] Gear, C.W., “Hybrid methods for initial value problems in ordinary differential
equations”, Journal of Society of Applied Mathematics, Series B, 6(1):69--86,
1965.
[24] Gear, C.W., Numerical Initial Value Problems in Ordinary Differential Equations,
Prentice Hall, 1971.
[25] Goeken, D., and O. Johnson, “Runge-Kutta with higher order derivative
approximations”, Applied Numerical Mathematics, 34:207--218, 2000.
[26] Gruttke, W.B., “Pseudo-Runge-Kutta methods of the fifth order”, Journal of the
Association for Computing Machinery, 17(4):613--628, 1970.
229
[27] Hairer, E., http://www.unige.ch/~hairer/testset/testset.html, Accessed April 2010.
[28] Hairer, E., S.P. Norsett, and G. Wanner, Solving Ordinary Differential Equations I,
Springer-Verlag, 1980.
[29] Hermans, J., “A symmetric sphere rolling on a surface”, Nonlinearity, 8(4): 493--
515, 1995.
[30] Hull, T.E., and W.H. Enright, and B.M. Fellen, and A.E. Sedgwick, “Comparing
numerical methods for ordinary differential equations”, SIAM Journal on
Numerical Analysis, 9(4):603--637, 1972.
[31] INdAM Bari, http://pitagora.dm.uniba.it/~testset/, Accessed April 2010.
[32] Jackiewicz, Z., and S. Tracogna, “A general class of two-step Runge-Kutta
methods for ordinary differential equations”, SIAM Journal of Numerical Analysis,
32(5):1390--1427, 1995.
[33] Krogh, F.T., “On testing a subroutine for the numerical integration of ordinary
differential equations”, Journal of the Association for Computing Machinery,
20(4): 545--562, 1973.
[34] Kutta, W., “Beitrag zur naherungsweisen integration totaler
differentialgleichungen”, Zeitschrift f. Mathematik u. Physik., 46:435--453, 1901.
[35] The MathWorks, MATLAB 2008b, 2008, http://www.mathworks.com/.
[36] Montana, D.J., “The kinematics of contact and grasp”, The International Journal
of Robotics Research, 7(3):17--32, 1988.
[37] NetLib, NA Digest Mailing List, 2009, http://www.netlib.org/na-net/.
[38] Nguyen-ba, T., and P.W. Sharp, and R. Vaillancourt, “Hermite-Birkhoff-
Obrechkoff frou-stage four-step ODE solver of order 14 with quantized step size”,
Journal of Computational and Applied Mathematics, 222: 608--621, 2008.
[39] PARI Group, Bordeaux, PARI/GP, version 2.3.2, 2007, http://pari.math.u-
bordeaux.fr/.
[40] Phohomsiri, P., and F.E. Udwadia, “Acceleration of Runge-Kutta integration
schemes”, Discrete Dynamics in Nature and Society, 2004(2):307--314,
doi:10.1155/S1026022604311039, 2004.
230
[41] Prentice, J.S.C., “General error propagation in the RKrGLm method”, Journal of
Computational and Applied Mathematics, 228: 344--354, 2009.
[42] Rubinstein, Z., A Course in Ordinary and Partial Differential Equations,
Academic Press, 1969.
[43] Runge, C., “Ueber die numerische auflosung von differentialgleichungen”,
Mathematische Annalen, 46:167--178, 1895.
[44] Shampine, L.F., Numerical Solution of Ordinary Differential Equations, Chapman
& Hall Mathematics, 1994.
[45] Shampine, L.F., “Vectorized solution of ODEs in Matlab”, To appear,
http://faculty.smu.edu/shampine/BV78.pdf.
[46] Shampine, L.F., and M.W. Reichelt, “The Matlab ODE suite”, SIAM Journal on
Scientific Computing, 18(1): 1--22, 1997.
[47] Shampine, L.F., “Stiff Systems”, http://www.scholarpedia.org/article/
Stiff_systems, Accessed April, 2010.
[48] Tracogna, S., and B. Welfert, “Two-step Runge-Kutta: theory and practice”, BIT,
40(4): 775--799, 2000.
[49] Udwadia, F., and A. Farahani, “Accelerated Runge-Kutta methods”, Discrete
Dynamics in Nature and Society, vol. 2008, Article ID 790619, 38 pages,
doi:10.1155/2008/790619, 2008.
[50] Udwadia, F., and R.E. Kalaba, Analytical Dynamics A New Approach, Cambridge
University Press, 1996.
[51] Udwadia, F., and P. Phohomsiri, “Explicit equations of motion for constrained
mechanical systems with singular mass matrices and applications to multi-body
dynamics”, Procedures of Royal Society A, doi:10.1098/rspa.2006.1662, 2006.
[52] Udwadia, F., “Introduction to quaternions and their application to rigid body
dynamics”, Rigid Body Dynamics Lecture Notes, 2009.
[53] Virgin, L.N., T.C. Lyman, and R.B. Davis, “Nonlinear dynamics of a ball rolling
on a surface”, American Journal of Physics, 78(3): 250--257, 2010.
231
Appendix A: Standard Initial Value Problems
The following standard initial value problems (IVP) are chosen from the literature to be
used in comparison of the accuracy, and speed of the variable step ARK methods with the
RK methods. Most problems are models of physical systems and are used by other
researchers to evaluate numerical integrators. The problems‟ definitions and analytical
solutions (if available) are given below.
P1. This is a scalar non-autonomous problem [40].
2
1
ty
y
t
, (0) 1 y .
The solution is
2
1
()
1
yt
t
.
P2. This is an oscillatory problem [21].
cos( ) y y t , (0) 1 y .
The solution is
sin( )
( ) e
t
yt .
P3. This is derived from Duffing's equation [21].
3
/ 6 2sin(2.78535 ) y y y t , (0) 0, (0) 0 yy
232
P4. This is the Euler equations of motion for a rigid body without external forces [21].
1 2 3
2 1 3
3 1 2
,
,
0.51 ,
y y y
y y y
y y y
1
2
3
(0) 0,
(0) 1,
(0) 1.
y
y
y
P5. This is the classic stiff Robertson problem [44].
4
1 1 2 3
4 7 2
2 1 2 3 2
72
32
0.04 10 ,
0.04 10 3 10 ,
3 10 ,
y y y y
y y y y y
yy
1
2
3
(0) 0,
(0) 1,
(0) 1.
y
y
y
P6. This is the 2 body problem with eccentricity 0 e .
13
24
2 2 3/2
3 1 1 2
2 2 3/2
4 2 1 2
,
,
/ ( ) ,
/ ( ) ,
yy
yy
y y y y
y y y y
1
2
3
4
(0) 1,
(0) 0,
(0) 0,
(0) 1,
y
y
y
y
The solution is
1
2
3
4
( ) cos( ),
( ) sin( ),
( ) sin( ),
( ) cos( ).
y t t
y t t
y t t
y t t
P7. This is the 2 body problem with eccentricity 0.9 e [21]. The solution, which is
the orbit of a revolving body around a center body, has varying stability throughout
233
the motion. That is why constant step size methods have difficulty maintaining
accuracy of its solution (See Chapter 2). However, the variable step size methods
reduce the step size in the low stability regions and increase the step size in the high
stability regions, thereby maintaining accuracy throughout the integration (See
Chapter 4).
13
24
2 2 3/2
3 1 1 2
2 2 3/2
4 2 1 2
,
,
/ ( ) ,
/ ( ) ,
yy
yy
y y y y
y y y y
1
2
3
4
(0) 1 ,
(0) 0,
(0) 0,
1
(0) ,
1
ye
y
y
e
y
e
The solution is
1
2
2
3
2
4
( ) cos( ) ,
( ) 1 sin( ),
sin( )
( ) ,
1 cos( )
1 cos( )
( ) ,
1 cos( )
y t u e
y t e u
u
yt
eu
eu
yt
eu
where u is the solution of the Kepler equation sin( ) u t e u . This
equation is solved using the Matlab algebraic solver fzero with a
tolerance (tolFun) of
17
1 10
.
P8. This is the 2 body problem with eccentricity 0.99 e . It‟s definition and solution
are similar to the previous problem. It is a difficult problem to solve numerically
234
because it is highly unstable at the point where the revolving body passes by the
stationary body.
P9. This linear problem describes a radioactive decay chain [21].
11
22
10 10
1
1 2 0
23
0 8 9
90
yy
yy
yy
,
1
0
(0)
0
y
The solution is
0
e
t
A
yy .
P10. This is the same as the previous problem with a time dependent term added by the
author to make the problem non-autonomous.
11
22
10 10
1
1 2 0 sin( )
2 3 0
0 8 9 0
90
yy t
yy
yy
,
1
0
(0)
0
y
.
P11. This problem is the equations of motion for the non-slip rolling of the ball discussed
in Section 5.5.2. It is a 20 dimensional non-linear problem.
235
P12. This problem describes the motion of 5 outer planets about the sun [21]. The
eccentricity of the orbits of planets 1 through 5 are 0.31, 0.33, 0.30, 0.13, and 0.63,
respectively. The subscripts p and c denote a planet and coordinate, respectively.
This problem is a 30-dimensional system of first-order ordinary differential
equations.
5
0 3 3 3
1
()
pc kc pc
kc
pc p k
k
p pk k
kp
y y y
y
y G m m m
r d r
,
where
3
22
1
p pc
c
ry
,
3
22
1
()
kc kc pc
c
d y y
, and
1, ,5 k , 1, ,5 p , 1, ,3 c .
The gravity constant and planet masses are
3
04
15
2
2.95912208286, 0.0000437273164546,
1.00000597682, 0.0000517759138449,
0.000954786104043, 0.00000277777777778.
0.000285583733151,
Gm
mm
mm
m
236
The initial values are
11 11
12 12
13 13
21 21
22
(0) 3.42947415189, (0) 0.557160570446,
(0) 3.35386959711, (0) 0.505696783289,
(0) 1.35494901715, (0) 0.230578543901,
(0) 6.64145542550, (0) 0.41570776342,
(0) 5.97156957878,
yy
yy
yy
yy
yy
22
23 23
31 31
32 32
33 33
(0) 0.365682722812,
(0) 2.18231499728, (0) 0.169143213293,
(0) 11.2630437207, (0) 0.325325669158,
(0) 14.6952576794, (0) 0.189706021964,
(0) 6.27960525067, (0) 0.0877265322780,
yy
yy
yy
yy
y
41 41
42 42
43 43
51 51
52
(0) 30.1552268759, (0) 0.0240476254170,
(0) 1.65699966404, (0) 0.287659532608,
(0) 1.43785752721, (0) 0.117219543175,
(0) 21.1238353380, (0) 0.176860753121,
(0) 28.44650981
y
yy
yy
yy
y
52
53 53
42, (0) 0.216393453025,
(0) 15.3882659679, (0) 0.0148647893090.
y
yy
237
Appendix B: Speed Data for Autonomous Constant Step Size ARK Methods
Section 2.6 shows (using plots) that for a small increase in execution time, ARK3 and
ARK4 give much more accurate solutions than RK2 and RK3, respectively. Here, the
data is listed (rounded to 3 significant digits).
ARK3 / RK2 ARK4 / RK3
Time Ratio Accuracy Ratio Time Ratio Accuracy Ratio
1.06 486 1.05 342
1.07 193 1.08 137
1.10 95.9 1.09 68.9
1.12 47.1 1.12 34.8
1.12 18.0 1.10 14.5
1.14 8.35 1.12 7.78
1.17 3.71 1.14 4.73
Table B.1: Speed and accuracy data for P1 (scalar problem).
ARK3 / RK2 ARK4 / RK3
Time Ratio Accuracy Ratio Time Ratio Accuracy Ratio
1.04 447 1.04 4186
1.07 179 1.07 1676
1.09 90.0 1.09 839
1.11 45.3 1.11 421
1.12 18.6 1.11 169
1.16 9.65 1.14 84.9
1.17 5.21 1.15 41.5
Table B.2: Speed and accuracy data for P4 (Euler problem).
ARK3 / RK2 ARK4 / RK3
Time Ratio Accuracy Ratio Time Ratio Accuracy Ratio
1.01 400 1.02 1915
1.04 160 1.03 753
1.06 80.6 1.05 367
1.07 40.8 1.06 175
1.10 16.9 1.07 60.8
1.08 8.91 1.08 24.9
1.10 4.90 1.09 9.10
Table B.3: Speed and accuracy data for P6 (2 body problem eccentricity 0).
238
ARK3 / RK2 ARK4 / RK3
Time Ratio Accuracy Ratio Time Ratio Accuracy Ratio
1.01 6.05 1.01 44.4
1.05 1.88 1.05 16.8
1.07 0.860 1.06 6.81
1.08 0.828 1.06 2.71
1.09 4.41 1.06 1.61
1.09 0.334 1.07 1.28
1.12 0.307 1.08 1.41
Table B.4: Speed and accuracy data for P7 (2 body problem eccentricity 0.9).
ARK3 / RK2 ARK4 / RK3
Time Ratio Accuracy Ratio Time Ratio Accuracy Ratio
0.996 440 0.998 284
1.01 176 1.01 114
1.05 88.3 1.05 57.2
1.06 44.4 1.05 28.9
1.09 18.0 1.07 11.8
1.10 9.19 1.09 6.15
1.11 4.72 1.09 3.23
Table B.5: Speed and accuracy data for P9 (radioactive problem).
239
Appendix C: Maple Code for Constant Step Size Autonomous ARK5
The following is the Maple code that produces the ARK5 order equations (2.38)-(2.55).
The code for lower order ARK methods can be easily deduced from this. A code also
exitsts for the derivation of variable step size ARK methods. However, it is not included
here due to the pending patent application for the variable step size ARK34 solver.
restart:
tay_o := 6:
yp[1] := D(y[1])(t) = f[1](y[1](t),y[2](t)):
yp[2] := D(y[2])(t) = f[2](y[1](t),y[2](t)):
y2p[1] := (D@@2)(y[1])(t) = convert(diff(f[1](y[1](t),y[2](t)), t), D):
y2p[1] := subs({yp[1], yp[2]}, y2p[1]):
y2p[2] := (D@@2)(y[2])(t) = convert(diff(f[2](y[1](t),y[2](t)), t), D):
y2p[2] := subs({yp[1], yp[2]}, y2p[2]):
y3p[1] := (D@@3)(y[1])(t) = expand( convert(diff(
f[1](y[1](t),y[2](t)), t$2), D) ):
y3p[1] := subs({y2p[1], y2p[2]}, y3p[1]):
y3p[1] := subs({yp[1], yp[2]}, y3p[1]):
y3p[1] := expand(y3p[1]):
y3p[2] := (D@@3)(y[2])(t) = expand( convert(diff(
f[2](y[1](t),y[2](t)), t$2), D) ):
y3p[2] := subs({y2p[1], y2p[2]}, y3p[2]):
y3p[2] := subs({yp[1], yp[2]}, y3p[2]):
y3p[2] := expand(y3p[2]):
y4p[1] := (D@@4)(y[1])(t) = expand( convert(diff(
f[1](y[1](t),y[2](t)), t$3), D) ):
y4p[1] := subs({y3p[1],y3p[2]}, y4p[1]):
y4p[1] := subs({y2p[1],y2p[2]}, y4p[1]):
y4p[1] := subs({yp[1],yp[2]}, y4p[1]):
y4p[1] := expand(y4p[1]):
y4p[2] := (D@@4)(y[2])(t) = expand( convert(diff(
f[2](y[1](t),y[2](t)), t$3), D) ):
y4p[2] := subs({y3p[1],y3p[2]}, y4p[2]):
y4p[2] := subs({y2p[1],y2p[2]}, y4p[2]):
y4p[2] := subs({yp[1],yp[2]}, y4p[2]):
y4p[2] := expand(y4p[2]):
240
y5p[1] := (D@@5)(y[1])(t) = expand( convert(diff(
f[1](y[1](t),y[2](t)), t$4), D) ):
y5p[1] := subs({y4p[1],y4p[2]}, y5p[1]):
y5p[1] := subs({y3p[1],y3p[2]}, y5p[1]):
y5p[1] := subs({y2p[1],y2p[2]}, y5p[1]):
y5p[1] := subs({yp[1],yp[2]}, y5p[1]):
y5p[1] := expand(y5p[1]):
y5p[2] := (D@@5)(y[2])(t) = expand( convert(diff(
f[2](y[1](t),y[2](t)), t$4), D) ):
y5p[2] := subs({y4p[1],y4p[2]}, y5p[2]):
y5p[2] := subs({y3p[1],y3p[2]}, y5p[2]):
y5p[2] := subs({y2p[1],y2p[2]}, y5p[2]):
y5p[2] := subs({yp[1],yp[2]}, y5p[2]):
y5p[2] := expand(y5p[2]):
y6p[1] := (D@@6)(y[1])(t) = expand( convert(diff(
f[1](y[1](t),y[2](t)), t$5), D) ):
y6p[1] := subs({y5p[1],y5p[2]}, y6p[1]):
y6p[1] := subs({y4p[1],y4p[2]}, y6p[1]):
y6p[1] := subs({y3p[1],y3p[2]}, y6p[1]):
y6p[1] := subs({y2p[1],y2p[2]}, y6p[1]):
y6p[1] := subs({yp[1],yp[2]}, y6p[1]):
y6p[1] := expand(y6p[1]):
y6p[2] := (D@@6)(y[2])(t) = expand( convert(diff(
f[2](y[1](t),y[2](t)), t$5), D) ):
y6p[2] := subs({y5p[1],y5p[2]}, y6p[2]):
y6p[2] := subs({y4p[1],y4p[2]}, y6p[2]):
y6p[2] := subs({y3p[1],y3p[2]}, y6p[2]):
y6p[2] := subs({y2p[1],y2p[2]}, y6p[2]):
y6p[2] := subs({yp[1],yp[2]}, y6p[2]):
y6p[2] := expand(y6p[2]):
ynm1[1] := convert( taylor(y[1](t-h), h=0, tay_o+1), polynom):
k1[1] := h*f[1](y[1](t),y[2](t)):
k1[2] := h*f[2](y[1](t),y[2](t)):
km1[1] := collect(h*convert(taylor(f[1](y[1](t-h), y[2](t-h)), h=0,
tay_o), polynom), h):
km1[1] := sort(km1[1], h, ascending):
km1[2] := collect(h*convert(taylor(f[2](y[1](t-h), y[2](t-h)), h=0,
tay_o), polynom), h):
km1[2] := sort(km1[2], h, ascending):
k2[1] := expand( h * convert( taylor( f[1](y[1](t)+a1*k1[1],
y[2](t)+a1*k1[2]), h=0, tay_o), polynom) ):
k2[2] := expand( h * convert( taylor( f[2](y[1](t)+a1*k1[1],
y[2](t)+a1*k1[2]), h=0, tay_o), polynom) ):
km2arg[1] := 'f[1](y[1](t-h)+a1*km1[1], y[2](t-h)+a1*km1[2])':
241
km2[1] := h*( coeftayl(km2arg[1], h=0, 0) + coeftayl(km2arg[1], h=0,
1)*h + coeftayl(km2arg[1], h=0, 2)*h^2 + coeftayl(km2arg[1], h=0,
3)*h^3 + coeftayl(km2arg[1], h=0, 4)*h^4 + coeftayl(km2arg[1], h=0,
5)*h^5 ):
km2[1] := collect( expand(km2[1]), h):
km2arg[2] := 'f[2](y[1](t-h)+a1*km1[1], y[2](t-h)+a1*km1[2])':
km2[2] := h*( coeftayl(km2arg[2], h=0, 0) + coeftayl(km2arg[2], h=0,
1)*h + coeftayl(km2arg[2], h=0, 2)*h^2 + coeftayl(km2arg[2], h=0,
3)*h^3 + coeftayl(km2arg[2], h=0, 4)*h^4 + coeftayl(km2arg[2], h=0,
5)*h^5 ):
km2[2] := collect( expand(km2[2]), h):
Red := x -> x - coeff(x,h,6)*h^6:
k2r[1] := Red(k2[1]):
k2r[2] := Red(k2[2]):
k3arg[1] := 'f[1](y[1](t)+a2*k2r[1], y[2](t)+a2*k2r[2])':
k3[1] := h*( coeftayl(k3arg[1], h=0, 0) + coeftayl(k3arg[1], h=0, 1)*h
+ coeftayl(k3arg[1], h=0, 2)*h^2 + coeftayl(k3arg[1], h=0, 3)*h^3 +
coeftayl(k3arg[1], h=0, 4)*h^4 + coeftayl(k3arg[1], h=0, 5)*h^5 ):
k3[1] := collect( expand(k3[1]), h):
k3arg[2] := 'f[2](y[1](t)+a2*k2r[1], y[2](t)+a2*k2r[2])':
k3[2] := h*( coeftayl(k3arg[2], h=0, 0) + coeftayl(k3arg[2], h=0, 1)*h
+ coeftayl(k3arg[2], h=0, 2)*h^2 + coeftayl(k3arg[2], h=0, 3)*h^3 +
coeftayl(k3arg[2], h=0, 4)*h^4 + coeftayl(k3arg[2], h=0, 5)*h^5 ):
k3[2] := collect( expand(k3[2]), h):
km2r[1] := Red(km2[1]):
km2r[2] := Red(km2[2]):
km3arg[1] := 'f[1](y[1](t-h)+a2*km2r[1], y[2](t-h)+a2*km2r[2])':
km3[1] := h*( coeftayl(km3arg[1], h=0, 0) + coeftayl(km3arg[1], h=0,
1)*h + coeftayl(km3arg[1], h=0, 2)*h^2 + coeftayl(km3arg[1], h=0,
3)*h^3 + coeftayl(km3arg[1], h=0, 4)*h^4 + coeftayl(km3arg[1], h=0,
5)*h^5 ):
km3[1] := collect( expand(km3[1]), h):
km3arg[2] := 'f[2](y[1](t-h)+a2*km2r[1], y[2](t-h)+a2*km2r[2])':
km3[2] := h*( coeftayl(km3arg[2], h=0, 0) + coeftayl(km3arg[2], h=0,
1)*h + coeftayl(km3arg[2], h=0, 2)*h^2 + coeftayl(km3arg[2], h=0,
3)*h^3 + coeftayl(km3arg[2], h=0, 4)*h^4 + coeftayl(km3arg[2], h=0,
5)*h^5 ):
km3[2] := collect( expand(km3[2]), h):
k3r[1] := Red(k3[1]):
k3r[2] := Red(k3[2]):
k4arg[1] := 'f[1](y[1](t)+a3*k3r[1], y[2](t)+a3*k3r[2])':
k4[1] := h*( coeftayl(k4arg[1], h=0, 0) + coeftayl(k4arg[1], h=0, 1)*h
+ coeftayl(k4arg[1], h=0, 2)*h^2 + coeftayl(k4arg[1], h=0, 3)*h^3 +
coeftayl(k4arg[1], h=0, 4)*h^4 + coeftayl(k4arg[1], h=0, 5)*h^5 ):
k4[1] := collect( expand(k4[1]), h):
242
k4arg[2] := 'f[2](y[1](t)+a3*k3r[1], y[2](t)+a3*k3r[2])':
k4[2] := h*( coeftayl(k4arg[2], h=0, 0) + coeftayl(k4arg[2], h=0, 1)*h
+ coeftayl(k4arg[2], h=0, 2)*h^2 + coeftayl(k4arg[2], h=0, 3)*h^3 +
coeftayl(k4arg[2], h=0, 4)*h^4 + coeftayl(k4arg[2], h=0, 5)*h^5 ):
k4[2] := collect( expand(k4[2]), h):
km3r[1] := Red(km3[1]):
km3r[2] := Red(km3[2]):
km4arg[1] := 'f[1](y[1](t-h)+a3*km3r[1], y[2](t-h)+a3*km3r[2])':
km4[1] := h*( coeftayl(km4arg[1], h=0, 0) + coeftayl(km4arg[1], h=0,
1)*h + coeftayl(km4arg[1], h=0, 2)*h^2 + coeftayl(km4arg[1], h=0,
3)*h^3 + coeftayl(km4arg[1], h=0, 4)*h^4 + coeftayl(km4arg[1], h=0,
5)*h^5 ):
km4[1] := collect( expand(km4[1]), h):
km4arg[2] := 'f[2](y[1](t-h)+a3*km3r[1], y[2](t-h)+a3*km3r[2])':
km4[2] := h*( coeftayl(km4arg[2], h=0, 0) + coeftayl(km4arg[2], h=0,
1)*h + coeftayl(km4arg[2], h=0, 2)*h^2 + coeftayl(km4arg[2], h=0,
3)*h^3 + coeftayl(km4arg[2], h=0, 4)*h^4 + coeftayl(km4arg[2], h=0,
5)*h^5 ):
km4[2] := collect( expand(km4[2]), h):
k4r[1] := Red(k4[1]):
k4r[2] := Red(k4[2]):
k5arg[1] := 'f[1](y[1](t)+a4*k4r[1], y[2](t)+a4*k4r[2])':
k5[1] := h*( coeftayl(k5arg[1], h=0, 0) + coeftayl(k5arg[1], h=0, 1)*h
+ coeftayl(k5arg[1], h=0, 2)*h^2 + coeftayl(k5arg[1], h=0, 3)*h^3 +
coeftayl(k5arg[1], h=0, 4)*h^4 + coeftayl(k5arg[1], h=0, 5)*h^5 ):
k5[1] := collect( expand(k5[1]), h):
k5arg[2] := 'f[2](y[1](t)+a4*k4r[1], y[2](t)+a4*k4r[2])':
k5[2] := h*( coeftayl(k5arg[2], h=0, 0) + coeftayl(k5arg[2], h=0, 1)*h
+ coeftayl(k5arg[2], h=0, 2)*h^2 + coeftayl(k5arg[2], h=0, 3)*h^3 +
coeftayl(k5arg[2], h=0, 4)*h^4 + coeftayl(k5arg[2], h=0, 5)*h^5 ):
k5[2] := collect( expand(k5[2]), h):
km4r[1] := Red(km4[1]):
km4r[2] := Red(km4[2]):
km5arg[1] := 'f[1](y[1](t-h)+a4*km4r[1], y[2](t-h)+a4*km4r[2])':
km5[1] := h*( coeftayl(km5arg[1], h=0, 0) + coeftayl(km5arg[1], h=0,
1)*h + coeftayl(km5arg[1], h=0, 2)*h^2 + coeftayl(km5arg[1], h=0,
3)*h^3 + coeftayl(km5arg[1], h=0, 4)*h^4 + coeftayl(km5arg[1], h=0,
5)*h^5 ):
km5[1] := collect( expand(km5[1]), h):
ynp1[1] := c0*y[1](t) - cm0*ynm1[1] + c1*k1[1] - cm1*km1[1] +
c2*(k2[1]-km2[1]) + c3*(k3[1]-km3[1]) + c4*(k4[1]-km4[1]) + c5*(k5[1]-
km5[1]):
ynp1[1] := subs({yp[1], yp[2], y2p[1], y2p[2], y3p[1], y3p[2], y4p[1],
y4p[2], y5p[1], y5p[2], y6p[1], y6p[2]}, ynp1[1]):
ynp1[1] := collect(expand(ynp1[1]), h):
243
ynp1_tay[1] := convert( taylor(y[1](t+h), h=0, tay_o+1), polynom ):
Extracting Order Equations
h0termO[1] := coeff(ynp1[1], h, 0):
h0term[1] := collect(h0termO[1], y[1](t)):
eqn0 := coeff(h0term[1], y[1](t)) = coeff( coeff(ynp1_tay[1], h, 0),
y[1](t) ):
h1termO[1] := coeff(ynp1[1], h, 1):
h1term[1] := applyrule( rhs(yp[1])=lhs(yp[1]), h1termO[1]):
h1term[1] := collect(h1term[1], D(y[1])(t)):
eqn1 := coeff(h1term[1], D(y[1])(t)) = coeff( coeff(ynp1_tay[1], h, 1),
D(y[1])(t)):
h2termO[1] := coeff(ynp1[1], h, 2):
( D[1](f[1])(y[1](t),y[2](t)) = solve(y2p[1],
D[1](f[1])(y[1](t),y[2](t))) ) * f[1](y[1](t),y[2](t)):
h2term[1] := applyrule(%, h2termO[1]):
h2term[1] := collect(h2term[1], (D@@2)(y[1])(t)):
eqn2 := coeff(h2term[1], (D@@2)(y[1])(t)) = coeff( coeff(ynp1_tay[1],
h, 2), (D@@2)(y[1])(t)):
h3termO[1] := coeff(ynp1[1], h, 3):
( D[1,1](f[1])(y[1](t),y[2](t)) = solve(y3p[1],
D[1,1](f[1])(y[1](t),y[2](t))) ) * f[1](y[1](t),y[2](t))^2:
h3term[1] := applyrule(%, h3termO[1]):
h3term[1] := collect(expand(h3term[1]), (D@@3)(y[1])(t)):
eqn3 := coeff(h3term[1], (D@@3)(y[1])(t)) = coeff( coeff(ynp1_tay[1],
h, 3), (D@@3)(y[1])(t)):
fsubs := {
f[1](y[1](t),y[2](t)) = x[1], f[2](y[1](t),y[2](t)) = x[2],
D[1](f[1])(y[1](t),y[2](t)) = x[3], D[1](f[2])(y[1](t),y[2](t)) = x[4],
D[2](f[1])(y[1](t),y[2](t)) = x[5], D[2](f[2])(y[1](t),y[2](t)) = x[6],
D[1,1](f[1])(y[1](t),y[2](t)) = x[7],
D[1,1](f[2])(y[1](t),y[2](t)) = x[8],
D[1,2](f[1])(y[1](t),y[2](t)) = x[9],
D[1,2](f[2])(y[1](t),y[2](t)) = x[10],
D[2,2](f[1])(y[1](t),y[2](t)) = x[11],
D[2,2](f[2])(y[1](t),y[2](t)) = x[12],
D[1,1,1](f[1])(y[1](t),y[2](t)) = x[13],
D[1,1,1](f[2])(y[1](t),y[2](t)) = x[14],
D[1,1,2](f[1])(y[1](t),y[2](t)) = x[15],
D[1,1,2](f[2])(y[1](t),y[2](t)) = x[16],
D[1,2,2](f[1])(y[1](t),y[2](t)) = x[17],
D[1,2,2](f[2])(y[1](t),y[2](t)) = x[18],
D[2,2,2](f[1])(y[1](t),y[2](t)) = x[19],
D[2,2,2](f[2])(y[1](t),y[2](t)) = x[20],
D[1,1,1,1](f[1])(y[1](t),y[2](t)) = x[21],
D[1,1,1,1](f[2])(y[1](t),y[2](t)) = x[22],
244
D[1,1,1,2](f[1])(y[1](t),y[2](t)) = x[23],
D[1,1,1,2](f[2])(y[1](t),y[2](t)) = x[24],
D[1,1,2,2](f[1])(y[1](t),y[2](t)) = x[25],
D[1,1,2,2](f[2])(y[1](t),y[2](t)) = x[26],
D[1,2,2,2](f[1])(y[1](t),y[2](t)) = x[27],
D[1,2,2,2](f[2])(y[1](t),y[2](t)) = x[28],
D[2,2,2,2](f[1])(y[1](t),y[2](t)) = x[29],
D[2,2,2,2](f[2])(y[1](t),y[2](t)) = x[30],
D[1,1,1,1,1](f[1])(y[1](t),y[2](t)) = x[31],
D[1,1,1,1,1](f[2])(y[1](t),y[2](t)) = x[32],
D[1,1,1,1,2](f[1])(y[1](t),y[2](t)) = x[33],
D[1,1,1,1,2](f[2])(y[1](t),y[2](t)) = x[34],
D[1,1,1,2,2](f[1])(y[1](t),y[2](t)) = x[35],
D[1,1,1,2,2](f[2])(y[1](t),y[2](t)) = x[36],
D[1,1,2,2,2](f[1])(y[1](t),y[2](t)) = x[37],
D[1,1,2,2,2](f[2])(y[1](t),y[2](t)) = x[38],
D[1,2,2,2,2](f[1])(y[1](t),y[2](t)) = x[39],
D[1,2,2,2,2](f[2])(y[1](t),y[2](t)) = x[40],
D[2,2,2,2,2](f[1])(y[1](t),y[2](t)) = x[41],
D[2,2,2,2,2](f[2])(y[1](t),y[2](t)) = x[42] }:
psubs :={c0=1, cm0=1, c1=1, cm1=1, c2=1, c3=1, c4=1, c5=1, a1=1, a2=1,
a3=1, a4=1}:
h4termO[1] := coeff(ynp1[1], h, 4):
( D[1,1,1](f[1])(y[1](t),y[2](t)) = solve(y4p[1],
D[1,1,1](f[1])(y[1](t),y[2](t))) ) * f[1](y[1](t),y[2](t))^3:
h4term[1] := applyrule(%, h4termO[1]):
h4term[1] := collect(expand(h4term[1]), (D@@4)(y[1])(t)):
h4termx[1] := subs(fsubs, h4term[1]):
collect( subs(psubs, h4termx[1]), [(D@@4)(y[1])(t), x[1], x[2], x[3],
x[4], x[5]]):
eqn4_1 := coeff(h4termx[1], (D@@4)(y[1])(t)) = coeff
(coeff(ynp1_tay[1], h, 4), (D@@4)(y[1])(t)):
eqn4_2 := coeff( coeff( coeff(h4termx[1], x[1], 2), x[9]), x[4]) = 0:
eqn4_3 := coeff( coeff( coeff(h4termx[1], x[1], 2), x[7]), x[3]) = 0:
eqn4_4 := coeff( coeff( coeff(h4termx[1], x[1], 2), x[5]), x[8]) = 0:
eqn4_5 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[2]), x[9]),
x[3]) = 0:
eqn4_6 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[2]), x[11]),
x[4]) = 0:
eqn4_7 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[2]), x[5]),
x[7]) = 0:
eqn4_8 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[2]), x[5]),
x[10]) = 0:
eqn4_9 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[2]), x[9]),
x[6]) = 0:
245
eqn4_10 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[5]), x[6]),
x[4]) = 0:
eqn4_11 := coeff( coeff( coeff( coeff(h4termx[1], x[1]), x[3]), x[5]),
x[4]) = 0:
eqn4_12 := coeff( coeff(h4termx[1], x[1]), x[3], 3) = 0:
eqn4_13 := coeff( coeff( coeff(h4termx[1], x[2], 2), x[3]), x[11]) = 0:
eqn4_14 := coeff( coeff( coeff(h4termx[1], x[2], 2), x[9]), x[5]) = 0:
eqn4_15 := coeff( coeff( coeff(h4termx[1], x[2], 2), x[12]), x[5]) = 0:
eqn4_16 := coeff( coeff( coeff(h4termx[1], x[2], 2), x[11]), x[6]) = 0:
eqn4_17 := coeff( coeff( coeff(h4termx[1], x[2]), x[4]), x[5], 2) = 0:
eqn4_18 := coeff( coeff( coeff(h4termx[1], x[2]), x[3], 2), x[5]) = 0:
eqn4_19 := coeff( coeff( coeff(h4termx[1], x[2]), x[5]), x[6], 2) = 0:
eqn4_20 := coeff( coeff( coeff( coeff(h4termx[1], x[2]), x[3]), x[5]),
x[6]) = 0:
h5termO[1] := coeff(ynp1[1], h, 5):
( D[1,1,1,1](f[1])(y[1](t),y[2](t)) = solve(y5p[1],
D[1,1,1,1](f[1])(y[1](t),y[2](t))) ) * f[1](y[1](t),y[2](t))^4:
h5term[1] := applyrule(%, h5termO[1]):
h5term[1] := collect(expand(h5term[1]), (D@@5)(y[1])(t)):
h5termx[1] := subs(fsubs, h5term[1]):
collect( subs(psubs, h5termx[1]), [(D@@5)(y[1])(t), x[1], x[2], x[3],
x[4]]):
eqn5_1 := coeff(h5termx[1], (D@@5)(y[1])(t)) = coeff(
coeff(ynp1_tay[1], h, 5), (D@@5)(y[1])(t) ):
eqn5_2 := coeff( coeff(h5termx[1], x[1], 3), x[7], 2) = 0:
eqn5_3 := coeff( coeff( coeff(h5termx[1], x[1], 3), x[15]), x[4]) = 0:
eqn5_4 := coeff( coeff( coeff(h5termx[1], x[1], 3), x[5]), x[14]) = 0:
eqn5_5 := coeff( coeff( coeff(h5termx[1], x[1], 3), x[3]), x[13]) = 0:
eqn5_6 := coeff( coeff( coeff(h5termx[1], x[1], 3), x[9]), x[8]) = 0:
eqn5_7 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[3]), x[15]) = 0:
eqn5_8 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[17]), x[4]) = 0:
eqn5_9 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[13]), x[5]) = 0:
eqn5_10 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[16]), x[5]) = 0:
eqn5_11 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[11]), x[8]) = 0:
eqn5_12 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[15]), x[6]) = 0:
eqn5_13 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[9]), x[7]) = 0:
eqn5_14 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[2]),
x[9]), x[10]) = 0:
246
eqn5_15 := coeff( coeff( coeff(h5termx[1], x[1], 2), x[7]), x[3], 2) =
0:
eqn5_16 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[3]),
x[9]), x[4]) = 0:
eqn5_17 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[3]),
x[5]), x[8]) = 0:
eqn5_18 := coeff( coeff( coeff(h5termx[1], x[1], 2), x[11]), x[4], 2) =
0:
eqn5_19 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[4]),
x[5]), x[7]) = 0:
eqn5_20 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[4]),
x[5]), x[10]) = 0:
eqn5_21 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[4]),
x[9]), x[6]) = 0:
eqn5_22 := coeff( coeff( coeff( coeff(h5termx[1], x[1], 2), x[5]),
x[6]), x[8]) = 0:
eqn5_23 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[17]), x[3]) = 0:
eqn5_24 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[19]), x[4]) = 0:
eqn5_25 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[15]), x[5]) = 0:
eqn5_26 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[18]), x[5]) = 0:
eqn5_27 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[11]), x[10]) = 0:
eqn5_28 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[17]), x[6]) = 0:
eqn5_29 := coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2), x[9], 2) =
0:
eqn5_30 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[7]), x[11]) = 0:
eqn5_31 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2], 2),
x[9]), x[12]) = 0:
eqn5_31 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]), x[9]),
x[3], 2) = 0:
eqn5_32 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[3]), x[11]), x[4]) = 0:
eqn5_33 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[3]), x[5]), x[10]) = 0:
eqn5_34 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[3]), x[5]), x[7]) = 0:
eqn5_35 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[3]), x[9]), x[6]) = 0:
247
eqn5_36 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[4]), x[12]), x[5]) = 0:
eqn5_37 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[4]), x[9]), x[5]) = 0:
eqn5_38 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[4]), x[11]), x[6]) = 0:
eqn5_39 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]), x[8]),
x[5], 2) = 0:
eqn5_40 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[10]), x[6]), x[5]) = 0:
eqn5_41 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]),
x[7]), x[6]), x[5]) = 0:
eqn5_42 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[2]), x[9]),
x[6], 2) = 0:
eqn5_43 := coeff( coeff( coeff(h5termx[1], x[1]), x[4], 2), x[5], 2) =
0:
eqn5_44 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[3], 2),
x[5]), x[4]) = 0:
eqn5_45 := coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[5]), x[6],
2), x[4]) = 0:
eqn5_46 := coeff( coeff(h5termx[1], x[1]), x[3], 4) = 0:
eqn5_47 := coeff( coeff( coeff( coeff( coeff(h5termx[1], x[1]), x[3]),
x[5]), x[6]), x[4]) = 0:
eqn5_46 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[3]), x[19]) = 0:
eqn5_47 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[17]), x[5]) = 0:
eqn5_48 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[20]), x[5]) = 0:
eqn5_49 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[11]), x[12]) =
0:
eqn5_50 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[9]), x[11]) = 0:
eqn5_51 := coeff( coeff( coeff(h5termx[1], x[2], 3), x[19]), x[6]) = 0:
eqn5_52 := coeff( coeff( coeff(h5termx[1], x[2], 2), x[3], 2), x[11]) =
0:
eqn5_53 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[3]),
x[9]), x[5]) = 0:
eqn5_54 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[3]),
x[12]), x[5]) = 0:
eqn5_55 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[3]),
x[11]), x[6]) = 0:
eqn5_56 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[11]),
x[4]), x[5]) = 0:
eqn5_57 := coeff( coeff( coeff(h5termx[1], x[2], 2), x[10]), x[5], 2) =
0:
eqn5_58 := coeff( coeff( coeff(h5termx[1], x[2], 2), x[7]), x[5], 2) =
0:
248
eqn5_59 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[12]),
x[6]), x[5]) = 0:
eqn5_60 := coeff( coeff( coeff( coeff(h5termx[1], x[2], 2), x[9]),
x[6]), x[5]) = 0:
eqn5_61 := coeff( coeff( coeff(h5termx[1], x[2], 2), x[11]), x[6], 2) =
0:
eqn5_62 := coeff( coeff( coeff(h5termx[1], x[2]), x[3], 3), x[5]) = 0:
eqn5_63 := coeff( coeff( coeff( coeff(h5termx[1], x[2]), x[3], 2),
x[5]), x[6]) = 0:
eqn5_64 := coeff( coeff( coeff( coeff(h5termx[1], x[2]), x[3]), x[4]),
x[5], 2) = 0:
eqn5_65 := coeff( coeff( coeff( coeff(h5termx[1], x[2]), x[3]), x[5]),
x[6], 2) = 0:
eqn5_66 := coeff( coeff( coeff(h5termx[1], x[2]), x[5]), x[6], 3) = 0:
eqn5_67 := coeff( coeff( coeff( coeff(h5termx[1], x[2]), x[4]), x[5],
2), x[6]) = 0:
h6termO[1] := coeff(ynp1[1], h, 6):
( D[1,1,1,1,1](f[1])(y[1](t),y[2](t)) = solve(y6p[1],
D[1,1,1,1,1](f[1])(y[1](t),y[2](t))) ) * f[1](y[1](t),y[2](t))^5:
h6term[1] := applyrule(%, h6termO[1]):
h6term[1] := collect(expand(h6term[1]), (D@@6)(y[1])(t)):
h6termx[1] := subs(fsubs, h6term[1]):
h6termxp[1] := collect( subs(psubs, h6termx[1]), [(D@@6)(y[1])(t),
x[1], x[2], x[3], x[4]]):
eqn6_1 := coeff(h6termx[1], (D@@6)(y[1])(t)) = coeff(
coeff(ynp1_tay[1], h,6), (D@@6)(y[1])(t)):
eqn6_2 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[23]), x[4]) = 0:
eqn6_3 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[5]), x[22]) = 0:
eqn6_4 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[21]), x[3]) = 0:
eqn6_5 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[9]), x[14]) = 0:
eqn6_6 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[13]), x[7]) = 0:
eqn6_7 := coeff( coeff( coeff(h6termx[1], x[1], 4), x[15]), x[8]) = 0:
eqn6_8 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[9]), x[16]) = 0:
eqn6_9 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[25]), x[4]) = 0:
eqn6_10 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[11]), x[14]) = 0:
eqn6_11 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[5]), x[24]) = 0:
eqn6_12 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[7]), x[15]) = 0:
eqn6_13 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[13]), x[9]) = 0:
249
eqn6_14 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[23]), x[3]) = 0:
eqn6_15 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[21]), x[5]) = 0:
eqn6_16 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[23]), x[6]) = 0:
eqn6_17 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[15]), x[10]) = 0:
eqn6_18 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[2]),
x[17]), x[8]) = 0:
eqn6_19 := coeff( coeff( coeff(h6termx[1], x[1], 3), x[13]), x[3],2) =
0:
eqn6_20 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[3]),
x[9]), x[8]) = 0:
eqn6_21 := coeff( coeff( coeff(h6termx[1], x[1], 3), x[3]), x[7],2) =
0:
eqn6_22 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[3]),
x[15]), x[4]) = 0:
eqn6_23 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[3]),
x[5]), x[14]) = 0:
eqn6_24 := coeff( coeff( coeff(h6termx[1], x[1], 3), x[17]), x[4],2) =
0:
eqn6_25 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[11]), x[8]) = 0:
eqn6_26 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[9]), x[10]) = 0:
eqn6_27 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[13]), x[5]) = 0:
eqn6_28 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[9]), x[7]) = 0:
eqn6_29 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[5]), x[16]) = 0:
eqn6_30 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[4]),
x[15]), x[6]) = 0:
eqn6_31 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[5]),
x[10]), x[8]) = 0:
eqn6_32 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[9]),
x[6]), x[8]) = 0:
eqn6_33 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[5]),
x[6]), x[14]) = 0:
eqn6_34 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 3), x[7]),
x[5]), x[8]) = 0:
eqn6_35 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[5]), x[26]) = 0:
250
eqn6_36 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[11]), x[16]) = 0:
eqn6_37 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[25]), x[3]) = 0:
eqn6_38 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[13]), x[11]) = 0:
eqn6_39 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[23]), x[5]) = 0:
eqn6_40 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[15]), x[12]) = 0:
eqn6_41 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[15]), x[9]) = 0:
eqn6_42 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[27]), x[4]) = 0:
eqn6_43 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[9]), x[18]) = 0:
eqn6_44 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[25]), x[6]) = 0:
eqn6_45 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[7]), x[17]) = 0:
eqn6_46 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[17]), x[10]) = 0:
eqn6_47 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2],2),
x[19]), x[8]) = 0:
eqn6_48 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[9]), x[7]) = 0:
eqn6_49 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[9]), x[10]) = 0:
eqn6_50 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[11]), x[8]) = 0:
eqn6_51 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[13]), x[5]) = 0:
eqn6_52 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[17]), x[4]) = 0:
eqn6_53 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[5]), x[16]) = 0:
eqn6_54 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[3]), x[15]), x[6]) = 0:
eqn6_55 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[19]), x[4],2) = 0:
eqn6_56 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[4]), x[9],2) = 0:
eqn6_57 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[11]), x[10]) = 0:
251
eqn6_58 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[5]), x[18]) = 0:
eqn6_59 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[17]), x[6]) = 0:
eqn6_60 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[15]), x[5]) = 0:
eqn6_61 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[9]), x[12]) = 0:
eqn6_62 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[4]), x[7]), x[11]) = 0:
eqn6_62 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[5]), x[12]), x[8]) = 0:
eqn6_63 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[7]), x[5]), x[10]) = 0:
eqn6_64 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[13]), x[5]), x[6]) = 0:
eqn6_65 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[7]), x[9]), x[6]) = 0:
eqn6_66 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[14]), x[5],2) = 0:
eqn6_67 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[5]), x[16]), x[6]) = 0:
eqn6_68 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[5]), x[10],2) = 0:
eqn6_69 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[11]), x[6]), x[8]) = 0:
eqn6_70 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[15]), x[6],2) = 0:
eqn6_71 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[9]), x[1]), x[6]) = 0:
eqn6_72 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[2]), x[9]), x[5]), x[8]) = 0:
eqn6_73 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[5]), x[7],2) = 0:
eqn6_219 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[2]),
x[3],2), x[15]) = 0:
eqn6_74 := coeff( coeff( coeff(h6termx[1], x[1], 2), x[7]), x[3],3) =
0:
eqn6_75 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[3],2),
x[5]), x[8]) = 0:
eqn6_76 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[3],2),
x[9]), x[4]) = 0:
eqn6_77 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[3]),
x[11]), x[4],2) = 0:
252
eqn6_78 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[3]), x[4]), x[5]), x[10]) = 0:
eqn6_79 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[3]), x[4]), x[9]), x[6]) = 0:
eqn6_80 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[3]), x[4]), x[7]), x[5]) = 0:
eqn6_81 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[3]), x[5]), x[6]), x[8]) = 0:
eqn6_8 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[4],2),
x[9]), x[5]) = 0:
eqn6_83 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[4],2),
x[11]), x[6]) = 0:
eqn6_84 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[4],2),
x[5]), x[12]) = 0:
eqn6_85 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[4]), x[5]), x[10]), x[6]) = 0:
eqn6_86 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1], 2),
x[4]), x[7]), x[5]), x[6]) = 0:
eqn6_87 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[4]),
x[9]), x[6],2) = 0:
eqn6_88 := coeff( coeff( coeff( coeff(h6termx[1], x[1], 2), x[4]),
x[8]), x[5],2) = 0:
eqn6_89 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[5]), x[28]) = 0:
eqn6_90 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[29]), x[4]) = 0:
eqn6_91 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[7]), x[19]) = 0:
eqn6_92 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[27]), x[6]) = 0:
eqn6_93 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[19]), x[10]) = 0:
eqn6_94 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[27]), x[3]) = 0:
eqn6_95 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[17]), x[9]) = 0:
eqn6_96 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[17]), x[12]) = 0:
eqn6_97 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[9]), x[20]) = 0:
eqn6_98 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[15]), x[11]) = 0:
eqn6_99 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[11]), x[18]) = 0:
253
eqn6_100 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],3),
x[25]), x[5]) = 0:
eqn6_220 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[17]), x[3],2) = 0:
eqn6_101 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[9],2), x[6]) = 0:
eqn6_102 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[5]), x[18]) = 0:
eqn6_103 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[19]), x[4]) = 0:
eqn6_104 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[15]), x[5]) = 0:
eqn6_105 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[9]), x[12]) = 0:
eqn6_106 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[3]), x[9],2) = 0:
eqn6_107 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[7]), x[11]) = 0:
eqn6_108 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[3]), x[11]), x[10]) = 0:
eqn6_109 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[4]), x[5]), x[20]) = 0:
eqn6_110 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[4]), x[17]), x[5]) = 0:
eqn6_111 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[4]), x[19]), x[6]) = 0:
eqn6_112 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[4]), x[9]), x[11]) = 0:
eqn6_113 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[4]), x[11]), x[12]) = 0:
eqn6_114 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[17]), x[6],2) = 0:
eqn6_115 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[13]), x[5],2) = 0:
eqn6_116 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[16]), x[5],2) = 0:
eqn6_117 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[15]), x[6]), x[5]) = 0:
eqn6_118 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[11]), x[8]), x[5]) = 0:
eqn6_119 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[5]), x[10]), x[12]) = 0:
eqn6_120 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[7]), x[5]), x[12]) = 0:
254
eqn6_121 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[7]), x[11]), x[6]) = 0:
eqn6_122 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[7]), x[5]), x[9]) = 0:
eqn6_123 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[9]), x[5]), x[10]) = 0:
eqn6_124 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2],2),
x[9],2), x[6]) = 0:
eqn6_125 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[11]), x[6]), x[10]) = 0:
eqn6_126 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[9]), x[12]), x[6]) = 0:
eqn6_127 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2],2), x[5]), x[18]), x[6]) = 0:
eqn6_128 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[3],3) = 0:
eqn6_129 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3],2), x[7]), x[5]) = 0:
eqn6_130 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3],2), x[5]), x[10]) = 0:
eqn6_131 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3],2), x[9]), x[6]) = 0:
eqn6_132 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3],2), x[11]), x[4]) = 0:
eqn6_133 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[3]), x[4]), x[9]), x[5]) = 0:
eqn6_134 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[3]), x[4]), x[5]), x[12]) = 0:
eqn6_135 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[3]), x[4]), x[11]), x[6]) = 0:
eqn6_136 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[3]), x[7]), x[5]), x[6]) = 0:
eqn6_137 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3]), x[8]), x[5],2) = 0:
eqn6_138 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[3]), x[5]), x[10]), x[6]) = 0:
eqn6_139 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[3]), x[9]), x[6],2) = 0:
eqn6_140 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[11]), x[4],2), x[5]) = 0:
eqn6_141 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[4]), x[11]), x[6],2) = 0:
eqn6_142 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[4]), x[10]), x[5],2) = 0:
255
eqn6_143 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[4]), x[9]), x[5]), x[6]) = 0:
eqn6_144 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[4]), x[7]), x[5],2) = 0:
eqn6_145 := coeff( coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[2]), x[4]), x[5]), x[12]), x[6]) = 0:
eqn6_146 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_147 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[8]), x[5],2), x[6]) = 0:
eqn6_148 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[5]), x[10]), x[6],2) = 0:
eqn6_149 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]),
x[7]), x[5]), x[6],2) = 0:
eqn6_150 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_151 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_152 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_153 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_154 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_155 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[2]), x[9]),
x[6],3) = 0:
eqn6_156 := coeff( coeff(h6termx[1], x[1]), x[3],5) = 0:
eqn6_157 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[3],3),
x[5]), x[4]) = 0:
eqn6_158 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]),
x[3],2), x[5]), x[6]), x[4]) = 0:
eqn6_159 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[3]),
x[5],2), x[4],2) = 0:
eqn6_160 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[3]),
x[5]), x[6],2), x[4]) = 0:
eqn6_161 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[5],2),
x[6]), x[4],2) = 0:
eqn6_162 := coeff( coeff( coeff( coeff(h6termx[1], x[1]), x[5]),
x[6],3), x[4]) = 0:
eqn6_163 := coeff( coeff( coeff(h6termx[1], x[2],4), x[9]), x[19]) = 0:
eqn6_164 := coeff( coeff( coeff(h6termx[1], x[2],4), x[5]), x[30]) = 0:
eqn6_165 := coeff( coeff( coeff(h6termx[1], x[2],4), x[27]), x[5]) = 0:
eqn6_166 := coeff( coeff( coeff(h6termx[1], x[2],4), x[17]), x[11]) =
0:
eqn6_167 := coeff( coeff( coeff(h6termx[1], x[2],4), x[3]), x[29]) = 0:
256
eqn6_168 := coeff( coeff( coeff(h6termx[1], x[2],4), x[19]), x[12]) =
0:
eqn6_169 := coeff( coeff( coeff(h6termx[1], x[2],4), x[29]), x[6]) = 0:
eqn6_170 := coeff( coeff( coeff(h6termx[1], x[2],4), x[11]), x[20]) =
0:
eqn6_171 := coeff( coeff( coeff(h6termx[1], x[2],3), x[3],2), x[19]) =
0:
eqn6_172 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[3]),
x[11]), x[12]) = 0:
eqn6_173 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[3]),
x[17]), x[5]) = 0:
eqn6_174 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[3]),
x[9]), x[11]) = 0:
eqn6_175 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[3]),
x[19]), x[6]) = 0:
eqn6_176 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[3]),
x[5]), x[20]) = 0:
eqn6_177 := coeff( coeff( coeff(h6termx[1], x[2],3), x[4]), x[11],2) =
0:
eqn6_178 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[4]),
x[19]), x[5]) = 0:
eqn6_179 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[9]),
x[6]), x[11]) = 0:
eqn6_180 := coeff( coeff( coeff(h6termx[1], x[2],3), x[5]), x[12],2) =
0:
eqn6_181 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[9]),
x[12]), x[5]) = 0:
eqn6_182 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[11]),
x[6]), x[12]) = 0:
eqn6_183 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[7]),
x[11]), x[5]) = 0:
eqn6_184 := coeff( coeff( coeff(h6termx[1], x[2],3), x[9],2), x[5]) =
0:
eqn6_185 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[17]),
x[5]), x[6]) = 0:
eqn6_186 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[5]),
x[20]), x[6]) = 0:
eqn6_187 := coeff( coeff( coeff(h6termx[1], x[2],3), x[18]), x[5],2) =
0:
eqn6_188 := coeff( coeff( coeff(h6termx[1], x[2],3), x[15]), x[5],2) =
0:
eqn6_189 := coeff( coeff( coeff( coeff(h6termx[1], x[2],3), x[11]),
x[10]), x[5]) = 0:
eqn6_190 := coeff( coeff( coeff(h6termx[1], x[2],3), x[19]), x[6],2) =
0:
257
eqn6_191 := coeff( coeff( coeff(h6termx[1], x[2],2), x[3],3), x[11]) =
0:
eqn6_192 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3],2),
x[11]), x[6]) = 0:
eqn6_193 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3],2),
x[9]), x[5]) = 0:
eqn6_194 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3],2),
x[5]), x[12]) = 0:
eqn6_195 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3]),
x[7]), x[5],2) = 0:
eqn6_196 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[2],2),
x[3]), x[11]), x[4]), x[5]) = 0:
eqn6_197 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[2],2),
x[3]), x[5]), x[12]), x[6]) = 0:
eqn6_198 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3]),
x[10]), x[5],2) = 0:
eqn6_199 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[2],2),
x[3]), x[9]), x[6]), x[5]) = 0:
eqn6_200 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[3]),
x[11]), x[6],2) = 0:
eqn6_201 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[4]),
x[5],2), x[12]) = 0:
eqn6_202 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[4]),
x[9]), x[5],2) = 0:
eqn6_203 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[2],2),
x[4]), x[5]), x[11]), x[6]) = 0:
eqn6_204 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[10]),
x[6]), x[5],2) = 0:
eqn6_205 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[7]),
x[5],2), x[6]) = 0:
eqn6_206 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[9]),
x[6],2), x[5]) = 0:
eqn6_207 := coeff( coeff( coeff( coeff(h6termx[1], x[2],2), x[5]),
x[12]), x[6],2) = 0:
eqn6_208 := coeff( coeff( coeff(h6termx[1], x[2],2), x[8]), x[5],3) =
0:
eqn6_209 := coeff( coeff( coeff(h6termx[1], x[2],2), x[11]), x[6],3) =
0:
eqn6_210 := coeff( coeff( coeff(h6termx[1], x[2]), x[3],4), x[5]) = 0:
eqn6_211 := coeff( coeff( coeff(h6termx[1], x[2]), x[4],2), x[5],3) =
0:
eqn6_212 := coeff( coeff( coeff(h6termx[1], x[2]), x[5]), x[6],4) = 0:
eqn6_213 := coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[3],3),
x[5]), x[6]) = 0:
258
eqn6_214 := coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[3],2),
x[4]), x[5],2) = 0:
eqn6_215 := coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[3],2),
x[5]), x[6],2) = 0:
eqn6_216 := coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[3]), x[5]),
x[6],3) = 0:
eqn6_217 := coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[4]),
x[5],2), x[6],2) = 0:
eqn6_218 := coeff( coeff( coeff( coeff( coeff(h6termx[1], x[2]), x[3]),
x[4]), x[5],2), x[6]) = 0:
eqn0s := eqn0:
eqn1s := eqn1:
eqn2s := eqn2:
eqn3s := eqn3 + 1/2*eqn2:
eqn4_1s := 2*(eqn4_1 - 1/6*eqn2s + 1/2*eqn3s):
eqn4_2s := eqn4_2 + 1/2*eqn4_1s:
eqn4_3s := eqn4_3 + eqn4_1s - 2*eqn4_2s:
eqn4_4s := eqn4_4 + 3/2*eqn4_1s - 3*eqn4_2s:
eqn4_5s := eqn4_5 + 1/2*eqn4_1s - eqn4_2s:
eqn4_6s := eqn4_6 + 1/2*eqn4_1s - eqn4_2s:
eqn4_7s := eqn4_7 + eqn4_1s - 2*eqn4_2s:
eqn4_8s := eqn4_8 + 1/2*eqn4_1s - eqn4_2s:
eqn4_9s := eqn4_9 + 1/2*eqn4_1s - eqn4_2s:
eqn4_10s := eqn4_10 + eqn4_1s - 2*eqn4_2s:
eqn4_11s := eqn4_11 + 1/2*eqn4_1s - eqn4_2s:
eqn4_12s := eqn4_12 + 1/2*eqn4_1s - eqn4_2s:
eqn4_13s := eqn4_13 + 1/2*eqn4_1s - eqn4_2s:
eqn4_14s := eqn4_14 + 1/2*eqn4_1s - eqn4_2s:
eqn4_15s := eqn4_15 + 1/2*eqn4_1s - eqn4_2s:
eqn4_16s := eqn4_16 + 1/2*eqn4_1s - eqn4_2s:
eqn4_17s := eqn4_17 + 1/2*eqn4_1s - eqn4_2s:
eqn4_18s := eqn4_18 + 1/2*eqn4_1s - eqn4_2s:
eqn4_19s := eqn4_19 + 1/2*eqn4_1s - eqn4_2s:
eqn5_1s := 6*(eqn5_1 + 1/24*eqn2s - 1/6*eqn3s + 1/4*eqn4_1s):
eqn5_3s := eqn5_3 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/2*eqn5_1s:
eqn5_4s := 2*(eqn5_4 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/6*eqn5_1s):
eqn5_2s := eqn5_2 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
1/2*eqn5_4s:
eqn5_5s := eqn5_5 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
1/2*eqn5_4s:
eqn5_6s := eqn5_6 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
1/2*eqn5_4s:
eqn5_7s := eqn5_7 - 5/4*eqn4_1s + 5/2*eqn4_2s + 3/2*eqn5_1s - 2*eqn5_3s
- 3/2*eqn5_4s:
eqn5_8s := eqn5_8 - 1/2*eqn4_1s + eqn4_2s + eqn5_1s - 2*eqn5_3s:
259
eqn5_9s := eqn5_9 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/2*eqn5_1s - eqn5_3s:
eqn5_10s := eqn5_10 - 3/4*eqn4_1s + 3/2*eqn4_2s + 1/2*eqn5_1s -
3/2*eqn5_4s:
eqn5_11s := eqn5_11 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
1/2*eqn5_4s:
eqn5_12s := eqn5_12 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/2*eqn5_1s -
eqn5_3s:
eqn5_13s := eqn5_13 - 3/2*eqn4_1s + 3*eqn4_2s + 2*eqn5_1s - 3*eqn5_3s -
3/2*eqn5_4s:
eqn5_14s := eqn5_14 - eqn4_1s + 2*eqn4_2s + 4/3*eqn5_1s - 2*eqn5_3s -
eqn5_4s:
eqn5_15s := 1/3*(eqn5_15 - 7/4*eqn4_1s + 7/2*eqn4_2s + 11/6*eqn5_1s -
2*eqn5_3s - eqn5_4s):
eqn5_16s := eqn5_16 - 7/4*eqn4_1s + 7/2*eqn4_2s + 13/6*eqn5_1s -
3*eqn5_3s - eqn5_4s - 2*eqn5_15s:
eqn5_17s := eqn5_17 - eqn4_1s + 2*eqn4_2s + 2/3*eqn5_1s - eqn5_4s -
2*eqn5_15s:
eqn5_18s := eqn5_18 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/2*eqn5_1s -
eqn5_3s:
eqn5_19s := eqn5_19 - 3/4*eqn4_1s + 3/2*eqn4_2s + 5/6*eqn5_1s - eqn5_3s
- 2*eqn5_15s:
eqn5_20s := eqn5_20 - 3/4*eqn4_1s + 3/2*eqn4_2s + 1/2*eqn5_1s - eqn5_4s
- eqn5_15s:
eqn5_21s := eqn5_21 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
eqn5_15s:
eqn5_22s := eqn5_22 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/6*eqn5_1s -
eqn5_15s:
eqn5_23s := eqn5_23 - eqn4_1s + 2*eqn4_2s + eqn5_1s - eqn5_3s -
3/2*eqn5_4s:
eqn5_24s := eqn5_24 - 1/4*eqn4_1s + 1/2*eqn4_2s + 1/2*eqn5_1s -
eqn5_3s:
eqn5_25s := eqn5_25 - 1/2*eqn4_1s + eqn4_2s + eqn5_1s - 2*eqn5_3s:
eqn5_26s := eqn5_26 - 3/4*eqn4_1s + 3/2*eqn4_2s + 1/2*eqn5_1s -
3/2*eqn5_4s:
eqn5_27s := eqn5_27 - eqn4_1s + 2*eqn4_2s + 4/3*eqn5_1s - 2*eqn5_3s -
eqn5_4s:
eqn5_28s := eqn5_28 - 1/2*eqn4_1s + eqn4_2s + eqn5_1s - 2*eqn5_3s:
eqn5_29s := eqn5_29 - eqn4_1s + 2*eqn4_2s + 4/3*eqn5_1s - 2*eqn5_3s -
eqn5_4s:
eqn5_30s := eqn5_30 - 1/2*eqn4_1s + eqn4_2s + 2/3*eqn5_1s - eqn5_3s -
1/2*eqn5_4s:
eqn5_31s := eqn5_31 - 7/4*eqn4_1s + 7/2*eqn4_2s + 3/2*eqn5_1s - eqn5_3s
- eqn5_4s - 4*eqn5_15s:
eqn5_32s := eqn5_32 - 5/4*eqn4_1s + 5/2*eqn4_2s + 7/6*eqn5_1s - eqn5_3s
- eqn5_4s - 2*eqn5_15s:
260
eqn5_33s := eqn5_33 - 5/4*eqn4_1s + 5/2*eqn4_2s + 5/6*eqn5_1s - eqn5_4s
- 3*eqn5_15s:
eqn5_34s := eqn5_34 - 7/4*eqn4_1s + 7/2*eqn4_2s + 13/6*eqn5_1s -
3*eqn5_3s - eqn5_4s - 2*eqn5_15s:
eqn5_35s := eqn5_35 - 5/4*eqn4_1s + 5/2*eqn4_2s + 3/2*eqn5_1s -
2*eqn5_3s - eqn5_4s - eqn5_15s:
eqn5_36s := eqn5_36 - 3/4*eqn4_1s + 3/2*eqn4_2s + 1/2*eqn5_1s - eqn5_4s
- eqn5_15s:
eqn5_37s := eqn5_37 - 2*eqn4_1s + 4*eqn4_2s + 8/3*eqn5_1s - 4*eqn5_3s -
4*eqn5_15s:
eqn5_38s := eqn5_38 - eqn4_1s + 2*eqn4_2s + 5/3*eqn5_1s - 3*eqn5_3s -
eqn5_15s:
eqn5_39s := eqn5_39 - 3/4*eqn4_1s + 3/2*eqn4_2s + 1/2*eqn5_1s - eqn5_4s
- eqn5_15s:
eqn5_40s := eqn5_40 - 5/4*eqn4_1s + 5/2*eqn4_2s + 5/6*eqn5_1s - eqn5_4s
- 3*eqn5_15s:
coef41 := eqn -> coeff(coeff(lhs(eqn), c2), a1, 2):
coef42 := eqn -> coeff(coeff(coeff(lhs(eqn), c3), a1), a2):
coef51 := eqn -> coeff(coeff(lhs(eqn), c2), a1, 3):
coef53 := eqn -> coeff(coeff(coeff(lhs(eqn), c3), a2, 2), a1):
coef54 := eqn -> coeff(coeff(coeff(lhs(eqn), c3), a1, 2), a2):
coef515 := eqn -> coeff(coeff(coeff(coeff(lhs(eqn), c4), a1), a2), a3):
simp5 := eqn -> eqn - coef41(eqn)*eqn4_1s - coef42(eqn)*eqn4_2s -
coef51(eqn)*eqn5_1s - coef53(eqn)*eqn5_3s - coef54(eqn)*eqn5_4s -
coef515(eqn)*eqn5_15s:
eqn5_41s := simp5(eqn5_41): eqn5_42s := simp5(eqn5_42):
eqn5_43s := simp5(eqn5_43): eqn5_44s := simp5(eqn5_44):
eqn5_45s := simp5(eqn5_45): eqn5_46s := simp5(eqn5_46):
eqn5_47s := simp5(eqn5_47): eqn5_48s := simp5(eqn5_48):
eqn5_49s := simp5(eqn5_49): eqn5_50s := simp5(eqn5_50):
eqn5_51s := simp5(eqn5_51): eqn5_52s := simp5(eqn5_52):
eqn5_53s := simp5(eqn5_53): eqn5_54s := simp5(eqn5_54):
eqn5_55s := simp5(eqn5_55): eqn5_56s := simp5(eqn5_56):
eqn5_57s := simp5(eqn5_57): eqn5_58s := simp5(eqn5_58):
eqn5_59s := simp5(eqn5_59): eqn5_60s := simp5(eqn5_60):
eqn5_61s := simp5(eqn5_61): eqn5_62s := simp5(eqn5_62):
eqn5_63s := simp5(eqn5_63): eqn5_64s := simp5(eqn5_64):
eqn5_65s := simp5(eqn5_65): eqn5_66s := simp5(eqn5_66):
eqn5_67s := simp5(eqn5_67):
eqn6_1s := 24*(eqn6_1 - 1/120*eqn2s + 1/24*eqn3s - 1/12*eqn4_1s +
1/12*eqn5_1s):
eqn6_2s := 2*(simp5(eqn6_2) + 1/4*eqn6_1s):
eqn6_3s := 6*(simp5(eqn6_3) + 1/24*eqn6_1s):
eqn6_4s := simp5(eqn6_4) + 7/24*eqn6_1s - 1/2*eqn6_2s - 1/6*eqn6_3s:
eqn6_5s := 2*(simp5(eqn6_5) + 5/24*eqn6_1s - 1/6*eqn6_3s):
261
coef61 := eqn -> coeff( coeff(lhs(eqn), c2), a1,4):
coef62 := eqn -> coeff( coeff( coeff(lhs(eqn), c3), a2,3), a1):
coef63 := eqn -> coeff( coeff( coeff(lhs(eqn), c3), a2), a1,3):
coef65 := eqn -> coeff( coeff( coeff(lhs(eqn), c3), a2,2), a1,2):
simp6 := eqn -> simp5(eqn) - coef61(eqn)*eqn6_1s - coef62(eqn)*eqn6_2s
- coef63(eqn)*eqn6_3s - coef65(eqn)*eqn6_5s:
eqn6_6s := simp6(eqn6_6): eqn6_7s := simp6(eqn6_7):
eqn6_8s := simp6(eqn6_8): eqn6_9s := simp6(eqn6_9):
eqn6_10s := simp6(eqn6_10): eqn6_11s := simp6(eqn6_11):
eqn6_12s := simp6(eqn6_12): eqn6_13s := simp6(eqn6_13):
eqn6_14s := simp6(eqn6_14): eqn6_15s := simp6(eqn6_15):
eqn6_16s := simp6(eqn6_16): eqn6_17s := simp6(eqn6_17):
eqn6_18s := simp6(eqn6_18): eqn6_29s := simp6(eqn6_29):
eqn6_22s := simp6(eqn6_22) - eqn6_29s:
eqn6_22s := sort(eqn6_22s, [c4,c5]):
eqn6_19s := 2*(simp6(eqn6_19) - eqn6_29s - eqn6_22s):
coef629 := eqn -> coeff( coeff( coeff( coeff(lhs(eqn), c4), a1), a2,2),
a3):
coef622 := eqn -> coeff( coeff( coeff( coeff(lhs(eqn), c4), a1), a2),
a3,2):
coef619 := eqn -> coeff( coeff( coeff( coeff(lhs(eqn), c4), a1,2), a2),
a3):
simp6_2 := eqn -> simp6(eqn) - coef629(eqn)*eqn6_29s -
coef622(eqn)*eqn6_22s - coef619(eqn)*eqn6_19s:
eqn6_20s := simp6_2(eqn6_20): eqn6_21s := simp6_2(eqn6_21):
eqn6_23s := simp6_2(eqn6_23): eqn6_24s := simp6_2(eqn6_24):
eqn6_25s := simp6_2(eqn6_25): eqn6_26s := simp6_2(eqn6_26):
eqn6_27s := simp6_2(eqn6_27): eqn6_28s := simp6_2(eqn6_28):
eqn6_30s := simp6_2(eqn6_30): eqn6_31s := simp6_2(eqn6_31):
eqn6_32s := simp6_2(eqn6_32): eqn6_33s := simp6_2(eqn6_33):
eqn6_34s := simp6_2(eqn6_34): eqn6_35s := simp6_2(eqn6_35):
eqn6_36s := simp6_2(eqn6_36): eqn6_37s := simp6_2(eqn6_37):
eqn6_38s := simp6_2(eqn6_38): eqn6_39s := simp6_2(eqn6_39):
eqn6_40s := simp6_2(eqn6_40): eqn6_41s := simp6_2(eqn6_41):
eqn6_42s := simp6_2(eqn6_42): eqn6_43s := simp6_2(eqn6_43):
eqn6_44s := simp6_2(eqn6_44): eqn6_45s := simp6_2(eqn6_45):
eqn6_46s := simp6_2(eqn6_46): eqn6_47s := simp6_2(eqn6_47):
eqn6_48s := simp6_2(eqn6_48): eqn6_49s := simp6_2(eqn6_49):
eqn6_50s := simp6_2(eqn6_50): eqn6_51s := simp6_2(eqn6_51):
eqn6_52s := simp6_2(eqn6_52): eqn6_53s := simp6_2(eqn6_53):
eqn6_54s := simp6_2(eqn6_54): eqn6_55s := simp6_2(eqn6_55):
eqn6_56s := simp6_2(eqn6_56): eqn6_57s := simp6_2(eqn6_57):
eqn6_58s := simp6_2(eqn6_58): eqn6_59s := simp6_2(eqn6_59):
eqn6_60s := simp6_2(eqn6_60): eqn6_61s := simp6_2(eqn6_61):
eqn6_62s := simp6_2(eqn6_62): eqn6_63s := simp6_2(eqn6_63):
262
eqn6_64s := simp6_2(eqn6_64): eqn6_65s := simp6_2(eqn6_65):
eqn6_66s := simp6_2(eqn6_66): eqn6_67s := simp6_2(eqn6_67):
eqn6_68s := simp6_2(eqn6_68): eqn6_69s := simp6_2(eqn6_69):
eqn6_70s := simp6_2(eqn6_70): eqn6_71s := simp6_2(eqn6_71):
eqn6_72s := simp6_2(eqn6_72): eqn6_73s := simp6_2(eqn6_73):
eqn6_74s := 1/4*(simp6_2(eqn6_74)):
coef674 := eqn -> coeff( coeff( coeff( coeff( coeff(lhs(eqn), c5), a4),
a3), a2), a1):
simp6_3 := eqn -> simp6_2(eqn) - coef674(eqn)*eqn6_74s:
eqn6_75s := simp6_3(eqn6_75): eqn6_76s := simp6_3(eqn6_76):
eqn6_77s := simp6_3(eqn6_77): eqn6_78s := simp6_3(eqn6_78):
eqn6_79s := simp6_3(eqn6_79): eqn6_80s := simp6_3(eqn6_80):
eqn6_81s := simp6_3(eqn6_81): eqn6_82s := simp6_3(eqn6_82):
eqn6_83s := simp6_3(eqn6_83): eqn6_84s := simp6_3(eqn6_84):
eqn6_85s := simp6_3(eqn6_85): eqn6_86s := simp6_3(eqn6_86):
eqn6_87s := simp6_3(eqn6_87): eqn6_88s := simp6_3(eqn6_88):
eqn6_89s := simp6_3(eqn6_89): eqn6_90s := simp6_3(eqn6_90):
eqn6_91s := simp6_3(eqn6_91): eqn6_92s := simp6_3(eqn6_92):
eqn6_93s := simp6_3(eqn6_93): eqn6_94s := simp6_3(eqn6_94):
eqn6_95s := simp6_3(eqn6_95):eqn6_96s := simp6_3(eqn6_96):
eqn6_97s := simp6_3(eqn6_97): eqn6_98s := simp6_3(eqn6_98):
eqn6_99s := simp6_3(eqn6_99): eqn6_100s := simp6_3(eqn6_100):
eqn6_101s := simp6_3(eqn6_101): eqn6_102s := simp6_3(eqn6_102):
eqn6_103s := simp6_3(eqn6_103): eqn6_104s := simp6_3(eqn6_104):
eqn6_105s := simp6_3(eqn6_105): eqn6_106s := simp6_3(eqn6_106):
eqn6_107s := simp6_3(eqn6_107): eqn6_108s := simp6_3(eqn6_108):
eqn6_109s := simp6_3(eqn6_109): eqn6_110s := simp6_3(eqn6_110):
eqn6_111s := simp6_3(eqn6_111): eqn6_112s := simp6_3(eqn6_112):
eqn6_113s := simp6_3(eqn6_113): eqn6_114s := simp6_3(eqn6_114):
eqn6_115s := simp6_3(eqn6_115): eqn6_116s := simp6_3(eqn6_116):
eqn6_117s := simp6_3(eqn6_117): eqn6_118s := simp6_3(eqn6_118):
eqn6_119s := simp6_3(eqn6_119): eqn6_120s := simp6_3(eqn6_120):
eqn6_121s := simp6_3(eqn6_121): eqn6_122s := simp6_3(eqn6_122):
eqn6_123s := simp6_3(eqn6_123): eqn6_124s := simp6_3(eqn6_124):
eqn6_125s := simp6_3(eqn6_125): eqn6_126s := simp6_3(eqn6_126):
eqn6_127s := simp6_3(eqn6_127): eqn6_128s := simp6_3(eqn6_128):
eqn6_129s := simp6_3(eqn6_129): eqn6_130s := simp6_3(eqn6_130):
eqn6_131s := simp6_3(eqn6_131): eqn6_132s := simp6_3(eqn6_132):
eqn6_133s := simp6_3(eqn6_133): eqn6_134s := simp6_3(eqn6_134):
eqn6_135s := simp6_3(eqn6_135): eqn6_136s := simp6_3(eqn6_136):
eqn6_137s := simp6_3(eqn6_137): eqn6_138s := simp6_3(eqn6_138):
eqn6_139s := simp6_3(eqn6_139): eqn6_140s := simp6_3(eqn6_140):
eqn6_141s := simp6_3(eqn6_141): eqn6_142s := simp6_3(eqn6_142):
eqn6_143s := simp6_3(eqn6_143): eqn6_144s := simp6_3(eqn6_144):
eqn6_145s := simp6_3(eqn6_145): eqn6_146s := simp6_3(eqn6_146):
263
eqn6_147s := simp6_3(eqn6_147): eqn6_148s := simp6_3(eqn6_148):
eqn6_149s := simp6_3(eqn6_149): eqn6_150s := simp6_3(eqn6_150):
eqn6_151s := simp6_3(eqn6_151): eqn6_152s := simp6_3(eqn6_152):
eqn6_153s := simp6_3(eqn6_153): eqn6_154s := simp6_3(eqn6_154):
eqn6_155s := simp6_3(eqn6_155): eqn6_156s := simp6_3(eqn6_156):
eqn6_157s := simp6_3(eqn6_157): eqn6_158s := simp6_3(eqn6_158):
eqn6_159s := simp6_3(eqn6_159): eqn6_160s := simp6_3(eqn6_160):
eqn6_161s := simp6_3(eqn6_161): eqn6_162s := simp6_3(eqn6_162):
eqn6_163s := simp6_3(eqn6_163): eqn6_164s := simp6_3(eqn6_164):
eqn6_165s := simp6_3(eqn6_165): eqn6_166s := simp6_3(eqn6_166):
eqn6_167s := simp6_3(eqn6_167): eqn6_168s := simp6_3(eqn6_168):
eqn6_169s := simp6_3(eqn6_169): eqn6_170s := simp6_3(eqn6_170):
eqn6_171s := simp6_3(eqn6_171): eqn6_172s := simp6_3(eqn6_172):
eqn6_173s := simp6_3(eqn6_173): eqn6_174s := simp6_3(eqn6_174):
eqn6_175s := simp6_3(eqn6_175): eqn6_176s := simp6_3(eqn6_176):
eqn6_177s := simp6_3(eqn6_177): eqn6_178s := simp6_3(eqn6_178):
eqn6_179s := simp6_3(eqn6_179): eqn6_180s := simp6_3(eqn6_180):
eqn6_181s := simp6_3(eqn6_181): eqn6_182s := simp6_3(eqn6_182):
eqn6_183s := simp6_3(eqn6_183): eqn6_184s := simp6_3(eqn6_184):
eqn6_185s := simp6_3(eqn6_185): eqn6_186s := simp6_3(eqn6_186):
eqn6_187s := simp6_3(eqn6_187): eqn6_188s := simp6_3(eqn6_188):
eqn6_189s := simp6_3(eqn6_189): eqn6_190s := simp6_3(eqn6_190):
eqn6_191s := simp6_3(eqn6_191): eqn6_192s := simp6_3(eqn6_192):
eqn6_193s := simp6_3(eqn6_193): eqn6_194s := simp6_3(eqn6_194):
eqn6_195s := simp6_3(eqn6_195): eqn6_196s := simp6_3(eqn6_196):
eqn6_197s := simp6_3(eqn6_197): eqn6_198s := simp6_3(eqn6_198):
eqn6_199s := simp6_3(eqn6_199): eqn6_200s := simp6_3(eqn6_200):
eqn6_201s := simp6_3(eqn6_201): eqn6_202s := simp6_3(eqn6_202):
eqn6_203s := simp6_3(eqn6_203): eqn6_204s := simp6_3(eqn6_204):
eqn6_205s := simp6_3(eqn6_205): eqn6_206s := simp6_3(eqn6_206):
eqn6_207s := simp6_3(eqn6_207): eqn6_208s := simp6_3(eqn6_208):
eqn6_209s := simp6_3(eqn6_209): eqn6_210s := simp6_3(eqn6_210):
eqn6_211s := simp6_3(eqn6_211): eqn6_212s := simp6_3(eqn6_212):
eqn6_213s := simp6_3(eqn6_213): eqn6_214s := simp6_3(eqn6_214):
eqn6_215s := simp6_3(eqn6_215): eqn6_216s := simp6_3(eqn6_216):
eqn6_217s := simp6_3(eqn6_217): eqn6_218s := simp6_3(eqn6_218):
eqn6_219s := simp6_3(eqn6_219): eqn6_220s := simp6_3(eqn6_220):
eqn0s := eqn0s; eqn1s := eqn1s; eqn2s := eqn2s; eqn3s := eqn3s;
eqn4_1s := eqn4_1s; eqn4_2s := eqn4_2s; eqn5_1s := eqn5_1s; eqn5_3s :=
eqn5_3s; eqn5_4s := eqn5_4s; eqn5_15s := eqn5_15s; eqn6_1s := eqn6_1s;
eqn6_2s := eqn6_2s; eqn6_3s := eqn6_3s; eqn6_5s := eqn6_5s;
eqn6_29s := eqn6_29s; eqn6_22s := eqn6_22s; eqn6_19s := eqn6_19s;
eqn6_74s := eqn6_74s;
264
Appendix D: Flowchart of the ARK34 Program
The following is the flowchart of the ARK34 program. It is deduced from the ODE23
and ODE45 programs. The original ODE23 and ODE45 algorightms are taken from
Matlab [35].
265
Figure D.1: Flowchart of the ARK34 variable step size numerical solver (part 1 of
5).
Get
r
from user, or default to 10
-3
Get
a
from user, or default to 10
-6
Requested Points ?
chunk = min[ max( 100, 50*refine ), refine + floor(2
13
/neq) ]
Yes
No
IC:
0 0
, y t
ODE23
h= min( h
max
, abs(t
2
-t
1
) )
First Time
Step
Computations
refine = max(1,user value)
0 0
, y y t t
old old
h
old
, k
old
y t , , stats
max( ,100eps(dataType))
rr
/
ar
th
h
max
= 0.1(t
f
- t
0
)
h
min
= 16 eps(t)
266
Figure D.2: Flowchart of the ARK34 variable step size numerical solver (part 2 of
5).
Get
r
from user, or default to 10
-3
Get
a
from user, or default to 10
-6
Requested Points ?
chunk = min[ max( 100, 50*refine ), refine + floor(2
13
/neq) ]
Yes
No
IC:
0 0
, y t
ODE23
h= min( h
max
, abs(t
2
-t
1
) )
First Time
Step
Computations
refine = max(1,user value)
0 0
, y y t t
old old
h
old
, k
old
y t , , stats
max( ,100eps(dataType))
rr
/
ar
th
h
max
= 0.1(t
f
- t
0
)
h
min
= 16 eps(t)
267
Figure D.3: Flowchart of the ARK34 variable step size numerical solver (part 3 of
5).
h * rh > 1 ? h = 1/rh
Yes
No
h < h
min
?
h
min
= 16 eps(t)
No
Yes
h = h
min
h / h
old
> r
max
?
h = r
max
h
old
Yes
No
h
min
= 16 eps(t)
h = min(h
max
, max(h
min
, h))
)
done?
No
Yes
1.1 h ≥ |t
f
- t| ?
h = t
f
– t
done
Yes
No
1. Print stats if requested.
2. Output solution.
3. Exit.
4 / 1
8 . 0
) , ( max / ) , ( max
r
i i i i
th y y t f
rh
268
Figure D.4: Flowchart of the ARK34 variable step size numerical solver (part 4 of
5).
Yes, Failure
Yes
No
old
h
h
r
) (r c c
i i
) , , , , , , (
) , , , , , , (
) , , ; (
3 3
4 4
i old old old new new
i old old old new new
i i
c k k h h y y y y
c k k h h y y y y
h y t f k k
) , , max(
3 4
th y y
y y
err
new
new new
?
r
err
1
st
failure ?
) 8 . 0 , max( :
4 / 1
min
err
h h h
r
) 2 / , max( :
min
h h h
No, Success
One Step Loop
done ?
t
new
= t
f
t
new
= t + h
h = t
new
- t
Yes
No
h ≤ h
min
?
No
1. Print failure error.
2. Print stats if requested.
3. Output solution.
4. Exit.
Yes
not done
269
Figure D.5: Flowchart of the ARK34 variable step size numerical solver (part 5 of
5).
Advance
Step
:
4
k k
y y
h h
y y
t t
old
old
old
new
new
Yes
No
failed
before ?
1. Print stats if requested.
2. Output solution.
3. Exit.
Increase size of output
with chunk if necessary.
done ?
Yes
No
4 / 1
8 . 0 :
err
h h
r
Yes
No
max
4 / 1
8 . 0 r
err
r
1 1 1
interp( , , , , , , , )
n n n n n n n
t h h r
y y f y f
Add interpolated y to output.
Stepped over
requested pts ?
No
Yes
270
Appendix E: Performance Statistics For ARK34
In integrating the standard initial value problems considered above using the ODE23,
ODE45, and ARK34 methods, some statistics are produced. These statistics include the
number of successful steps, number of failed attempts, and the number of function
evaluations performed by the numerical method. The statistics for three relative
tolerances are included in the tables below.
No. of Successful Steps
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P1
(scalar)
ODE23 8768 409 22
ARK34 (1) 2164 220 26
ARK34 (2) 2473 251 28
ODE45 174 30 11
P3
(Duffing)
ODE23 116786 5394 237
ARK34 (1) 25129 2503 257
ARK34 (2) 26624 2651 268
ODE45 1923 301 48
P4
(Euler)
ODE23 39549 1823 88
ARK34 (1) 11587 1187 149
ARK34 (2) 11852 1213 153
ODE45 1050 166 29
P5
(Robertson)
ODE23 38822 20389 20257
ARK34 (1) 74378 73255 73160
ARK34 (2) 45318 44173 44063
ODE45 26485 15331 15305
P6
(2 body 0)
ODE23 50622 2329 104
ARK34 (1) 10972 1136 149
ARK34 (2) 9844 1024 138
ODE45 1221 191 34
Table E.1: The number of successful steps taken by the ODE23, ODE45, and
ARK34 (parameter sets 1 and 2) methods for three different relative tolerances
(continued to next table). This table shows that higher order methods generally take
fewer steps.
271
No. of Successful Steps
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P7
(2 body 0.9)
ODE23 126718 5847 266
ARK34 (1) 27893 2805 314
ARK34 (2) 30979 3116 343
ODE45 2589 405 77
P8
(2 body 0.99)
ODE23 218553 10109 444
ARK34 (1) 10128 3805 428
ARK34 (2) 45749 4587 493
ODE45 3835 603 135
P9
(radioactive)
ODE23 37976 1768 115
ARK34 (1) 10107 1045 313
ARK34 (2) 10107 1045 217
ODE45 1102 185 69
P11
(rolling)
ODE23 1128929 50989 1881
ARK34 (1) NA 20950 1560
ARK34 (2) 301583 21388 1724
ODE45 23449 3377 199
P12
(5 planet)
ODE23 9095 409 16
ARK34 (1) 1814 181 19
ARK34 (2) 1621 163 17
ODE45 181 28 11
Table E.2: Continued from previous table.
272
No. of Failed Attempts
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P1
(scalar)
ODE23 11 8 4
ARK34 (1) 14 10 4
ARK34 (2) 14 9 4
ODE45 5 2 1
P3
(Duffing)
ODE23 17 26 25
ARK34 (1) 17 14 29
ARK34 (2) 20 17 19
ODE45 8 20 12
P4
(Euler)
ODE23 3 20 20
ARK34 (1) 0 0 0
ARK34 (2) 0 0 0
ODE45 0 2 3
P5
(Robertson)
ODE23 1833 9 5
ARK34 (1) 4 3 1
ARK34 (2) 4 4 2
ODE45 2 1218 3813
P6
(2 body 0)
ODE23 0 15 12
ARK34 (1) 0 0 0
ARK34 (2) 0 0 0
ODE45 1 2 0
Table E.3: The number of failed attempts made by the ODE23, ODE45, and ARK34
(parameter sets 1 and 2) methods for three different relative tolerances (continued to
next table). This table shows that ARK34 generally does not make any more failed
attempts than ODE23 or ODE45.
273
No. of Failed Attempts
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P7
(2 body 0.9)
ODE23 0 25 45
ARK34 (1) 16 6 23
ARK34 (2) 0 5 18
ODE45 3 10 21
P8
(2 body 0.99)
ODE23 3 9 36
ARK34 (1) 97 4 44
ARK34 (2) 90 1 20
ODE45 2 9 31
P9
(radioactive)
ODE23 0 0 4
ARK34 (1) 0 0 2
ARK34 (2) 0 0 1
ODE45 0 0 7
P11
(rolling)
ODE23 1926 935 249
ARK34 (1) NA 377 90
ARK34 (2) 22202 343 92
ODE45 371 32 11
P12
(5 planet)
ODE23 2 11 2
ARK34 (1) 5 2 1
ARK34 (2) 1 3 0
ODE45 0 0 0
Table E.4: Continued from previous table.
274
No. of Function Evaluations
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P1
(scalar)
ODE23 26338 1252 79
ARK34 (1) 6539 695 95
ARK34 (2) 7466 785 101
ODE45 1075 193 73
P3
(Duffing)
ODE23 350410 16261 787
ARK34 (1) 75443 7556 863
ARK34 (2) 79937 8009 866
ODE45 11587 1927 361
P4
(Euler)
ODE23 118657 5530 325
ARK34 (1) 34776 3566 452
ARK34 (2) 35561 3644 464
ODE45 6301 1009 193
P5
(Robertson)
ODE23 121966 61195 60787
ARK34 (1) 223151 219779 219488
ARK34 (2) 135971 132536 132200
ODE45 158923 99295 114709
P6
(2 body 0)
ODE23 151867 7033 349
ARK34 (1) 32921 3413 452
ARK34 (2) 29537 3077 419
ODE45 7333 1159 205
Table E.5: The number of function evaluations performed by the ODE23, ODE45,
and ARK34 (parameter sets 1 and 2) methods for three different relative tolerances
(continued to next table). This table shows that higher order methods generally
perform fewer function evaluations.
275
No. of Function Evaluations
Problem Method
Rel. Tol.
11
1 10
Rel. Tol.
7
1 10
Rel. Tol.
3
1 10
P7
(2 body 0.9)
ODE23 380155 17617 934
ARK34 (1) 83732 8438 1016
ARK34 (2) 92942 9368 1088
ODE45 15553 2491 589
P8
(2 body 0.99)
ODE23 1529879 70783 3182
ARK34 (1) 30680 11432 1421
ARK34 (2) 137522 13769 1544
ODE45 23023 3673 997
P9
(radioactive)
ODE23 113929 5305 358
ARK34 (1) 30326 3140 950
ARK34 (2) 30326 3140 659
ODE45 6613 1111 457
P11
(rolling)
ODE23 3392566 155773 6391
ARK34 (1) NA 63986 4955
ARK34 (2) 971360 65198 5453
ODE45 142921 20455 1261
P12
(5 planet)
ODE23 27292 1261 55
ARK34 (1) 5462 554 65
ARK34 (2) 4871 503 56
ODE45 1087 169 67
Table E.6: Continued from previous table.
276
Appendix F: Brief Description of Other Multi-step Methods
The main property of the structural form of ARK methods is that they are multi-step
methods. A brief description of other existing multi-step methods is given below. The
notations used in this appendix are separate from the notations used in the thesis.
The Adams methods are based on using the previously calculated function evaluations to
form an interpolant () t p , i.e.,
1 1 1 1
( ) ( , )
n k n k n k n k
tx
p f y f 1,2, , kv , (F.1)
and use it to approximate the solution
1
,1
1
( , ( ))
()
,
nn
n
nn
n
th
nn
t
th
n
t
v
n n v k n k
k
x x dx
x dx
hb
y y f y
yp
yf
(F.2)
where
, vk
b are given by the Lagrange polynomial
1
,
1 11
1
()
nn
n
th
v
nm
vk
m n n k n m t
mk
xt
b dx
h t t
.
277
When the starting value of the index in (F.1) and (F.2) is 1 k , the method is explicit,
and is called the Adams-Bashforth method. On the other hand, when it is 0 k , the
method is implicit, and is called the Adams-Moulton method. The Adams methods cost
only one function evaluation per step. Therefore, they are relatively efficient in solving
problems that are expensive (complicated and/or large) to evaluate. For constant step
sizes, the Adams methods become particularly attractive because the
, vk
b parameters are
constant and they can be calculated beforehand.
The Backward Differentiation Formulas (BDF) methods are also based on interpolation,
but they use the previously calculated solutions themselves, i.e.,
11
()
n k n k
t
py 0,1, , kv .
The BDF methods then take the form
11
0
v
n n n k n k
k
ha
y y y ,
where
1
,
1 11
1d
[ ( )]d
d
nn
n
th
v
nm
vk
m n n k n m t
mk
xt
ax
h x t t
.
The BDF methods are implicit and are suited for solving stiff problems.
278
The Linear Multi-step Methods are a combination of the Adams and BDF methods, and
have the general form
1 1 1
00
( , )
kk
i n i n i n i n i
ii
a h b t
y f y .
An implicit method can be paired with an explicit method to find an initial guess value of
the solution. These methods are called PCMs. For example,
1
1 1 1
ˆ
ˆ
ˆ ( , )
n n n
n n n
h
t
y y f
f f y
and then
11
ˆ
()
2
n n n n
h
y y f f .
Byrne and Lambert [12] are the first to introduce a two-step Runge-Kutta method. Their
method, named Pseudo-RK, has a more general form than the ARK methods. Their
fourth order method is given by
1 0 0 1 1 1 1 2 2 1 0 0 1 1 2 2
( ) ( ) ( ) ( ) ( ) ( )
n n n n n n n n
A A A B B B
y y k y k y k y k y k y k y ,
where
0 1 1
1 1 1 1 0 1
2 1 1 2 3 0 1 3 1 1
0
1 1 0
2 2 3 0 3 1
( ) ( )
( ) ( ( ))
( ) ( ( ) ( ) ( ))
( ) ( )
( ) ( ( ))
( ) ( ( ) ( ) ( ))
nn
n n n
n n n n
nn
n n n
n n n n
h
hu
h u u u
h
hu
h u u u
k y f y
k y f y k y
k y f y k y k y
k y f y
k y f y k y
k y f y k y k y
279
Costabile [18] studies methods which use function evaluations from the previous steps as
arguments for the function evaluations of the current step. He presents the two-step
Runge-Kutta methods of order four with three function evaluations given by
1 0 0, 1 1, 2 2, 0 0, 1 n n n n n n
y y k k k k ,
as well as the fourth order three-step method with two function evaluations given by
1 0 0, 1 1, 0 0, 1 1 1, 1 0 0, 2 n n n n n n n
y y k k k k k ,
and the third order method with two function evaluations given by
1 0 0, 1 1, 0 0, 1 n n n n n
y y k k k ,
where
0,
1, 0, 0, 1 0,
2, 1 1 0, 1 0, 1 0, 2 1, 0,
( , )
( , ( ))
( , ( ) ( )).
n n n
n n n n n n
n n n n n n n n
hx
h x h
h x h
k f y
k f y k k k
k f y k k k k k
Butcher introduces a class of two-step RK methods named Almost RK methods [8].
They have the form
280
[]
11
[ 1] [ ]
11
()
()
sr
n
i ij j j ij j
jj
sr
nn
i ij j j ij j
jj
ha u
hb v
Y f Y y
y f Y y
where s is the number of function evaluations required by the method.
Jackiewicz et. al. introduces the following form of a two-step RK method upto order 5
[32]. The arguments
j
n
Y are quite general because they can include all function
evaluations from previous and current steps.
1 1 1
1
11
1
(1 ) ( ) ( )
(1 ) ( ) ( )
m
jj
n n n j n j n
j
m
j s s
n j n j n js n js n
s
h v w
u u h a b
y y y f Y f Y
Y y y f Y f Y
281
Appendix G: End of Integration Accuracy Plots for Variable Step Size Methods
The accuracy of the variable step size ARK methods is illustrated in Section 4.7. The
error presented is the average of the norm of the global error over the entire integration
time span. Here, the accuracy is presented using the infinity norm of the global error at
the end of the integration time span. Although these plots are different than those in
Section 4.7, the trend is the same. In other words, ARK34 is generally more accurate
than ODE23 and ODE45.
Figure G.1: Accuracy plot for P1 (scalar non-autonomous problem) based on error at
end of time span.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-14
10
-12
10
-10
10
-8
10
-6
10
-4
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
282
Figure G.2: Accuracy plot for P3 (Duffing problem) based on error at end of time
span.
Figure G.3: Accuracy plot for P4 (Euler problem) based on error at end of time span.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-12
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
283
Figure G.4: Accuracy plot for P5 (Robertson problem) based on error at end of time
span.
Figure G.5: Accuracy plot for P6 (2 body eccentricity 0 problem) based on error at
end of time span.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-16
10
-14
10
-12
10
-10
10
-8
10
-6
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-10
10
-8
10
-6
10
-4
10
-2
10
0
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
284
Figure G.6: Accuracy plot for P7 (2 body eccentricity 0.9 problem) based on error at
end of time span.
Figure G.7: Accuracy plot for P8 (2 body eccentricity 0.99 problem) based on error
at end of time span.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-10
10
-8
10
-6
10
-4
10
-2
10
0
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-8
10
-6
10
-4
10
-2
10
0
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
285
Figure G.8: Accuracy plot for P9 (radioactive decay chain problem) based on error
at end of time span.
Figure G.9: Accuracy plot for P11 (rolling ball problem) based on error at end of
time span (the smallest tolerance is not used for this problem because of insufficient
memory).
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-14
10
-12
10
-10
10
-8
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
10
1
10
2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
286
Figure G.10: Accuracy plot for P12 (5 planet problem) based on error at end of time
span.
10
-11
10
-10
10
-9
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-10
10
-8
10
-6
10
-4
10
-2
Relative Tolerance
ANGE
ARK34 par. set 1
ARK34 par. set 2
ODE23
ODE45
287
Appendix H: System Used in Rolling Simulations and Experiments
In the simualtions and experiments performed in this study, a spherical ball rolls non-slip
on a cylindrical surface. In this appendix, the matrices and vectors representing the
equations of motion of the unconstrained system and the equations of constraint for this
system are listed. Also included is the rank of A and the matrix given by (4.61), as well
as the determination of dependency of the constraints.
In writing the Lagrange equations for the unconstrained system, the inertial matrix of the
ball is used, which in the case of the spherical ball used in the simulations and
experiments here is ( , , ) Diag J J J J . Here,
2
2
3
J mr is the rotational inertia of the
ball, which is a shell (a ping-pong ball in the experiment).
The equations of motion of the unconstrained system are written in the form
ˆ
Mq Q .
The mass matrix M is given by
12
M M M , where
288
1
2 2 2
1 2 3
01
02
03
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 4
0 0 0 0 0 0 4
0 0 0 0 0 0 4
0 0 0 0 0 0 4
m
m
m
J e e e
e e J
e e J
e e J
M ,
and
2
0 1 0 2 0 3
2 2 2
0 2 3 1 2 1 3
2 2 2
1 2 0 1 3 2 3
2 2 2
1 3 2 3 0 1 2
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
4 4 4
4 4 4
4 4 4
4 4 4
e e J e e J e e J
J e e e e e J e e J
e e J J e e e e e J
e e J e e J J e e e
M .
The mass matrix is singular because the system coordinate vector q includes the
coordinates of a massless point. Looking at the M matrix and Q vector (given below),
it is seen that the equations of motion of this point in the unconstrained system are
289
00 x , 00 y , and 00 z . In other words, the path on the surface traced by the point
of contact is represented by a massless point with no forces acting on it. The vector Q is
2 2 2
0 1 2 3 0 1 1 2 2 3 3
2 2 2
1 0 2 3 1 0 0 2 2 3 3
2 2 2
2 0 1 3 2 0 0 1 1 3 3
2 2 2
3 0 1 2 3 0 0 1 1 2 2
0
0
0
0
0
8
8
8
8
mg
J e e e e e e e e e e e
J e e e e e e e e e e e
J e e e e e e e e e e e
J e e e e e e e e e e e
Q
.
The equations of constraint are written in the form Aq b . The matrix A is given by
12
A A A ,
where
290
0
1
2
13
2
0 0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0 2 ( )
0 0 0 0 0 2 ( )
0 0 0 0 0 2
e
u w R
R r R
RR
R r R
R r R w e
R r R w e ue
R rue
A ,
and
1 2 3
2
3 0 1
0 2 3 1 2 0
3 0 1
0 0 0
0 0 0
0 0 0
0 0 0
2 ( ) 2 ( ) 2 ( )
2 ( ) 2 ( ) 2 ( )
2 2 2
e e e
re R w re R w re R w
r R w e ue r R w e ue r R w e ue
rue rue rue
A .
291
The b vector is
2 2 2 2
0 1 2 3
22
0 2 1 3 2 0 3 1
0 3 2 1 3 0 1 2 0 1 3 2 2 3 1 0
0 2 1 3 2 0 3 1
0
0
0
2
2
2
e e e e
uw
rw e e e e e e e e
r u e e e e e e e e w e e e e e e e e
ru e e e e e e e e
b .
Recall that in order for the fundamental equation to give the correct (and unique)
acceleration of the constrained system, the matrix
M
A
(H.1)
must have full rank. The prove that, the above matrix is reduced to row echelon form
using Gaussian elimination in Maple to get
12
M MM
A 00
,
where
292
1
2 2 2
1 2 3 0 1
22
23
2 2 2
1 2 3
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0
( )( )
0 0 0 0 0 0 0
0 0 0 0 0 0 4 ( ) 4
4 ( )
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
m
m
m
u w R
R
R r R w
u
J e e e Je e
J e e
e e e
M ,
and
2 0 2 0 3
13 12
2 2 2 2 2 2
1 2 3 1 2 3
2
3 2 3
2 2 2 2
2 3 2 3
3
00
00
00
00
00
00
44
4 4
44
1
0
Je e Je e
Je e Je e
e e e e e e
Je Je e
e e e e
e
M .
293
The determinant of
12
MM is
3
3
64 ( )( ) JRm R r R w e .
In the simulation and experiments in this study, rR and wR . Therefore, the
determinant is non-zero for
3
0 e , and the matrix (H.1) has full rank, i.e., 10. However,
if
3
0 e , the determinant goes to zero and this matrix has a rank smaller than 10. This
needs to be investigated further.
When
3
0 e , the determinant of the original matrix (H.1) upon Gaussian elimination
yields
3
2
64 ( )( ) JRm R r R w e ,
which is non-zero for
2
0 e , and the matrix has full rank. Furthermore, when
23
0 ee
, the original matrix (H.1) upon Gaussian elimination yields the determinant
3
1
64 ( )( ) JRm R r R w e ,
which is non-zero for
1
0 e , and the matrix has full rank. Lastly, when
1 2 3
0 e e e ,
the original matrix (H.1) upon Gaussian elimination yields the determinant
294
3 3 7
0
64 ( )( ) J Rm R r R w e .
This last determinant does not go to zero because of constraint (4.67). Therefore, the
matrix (H.1) always has full rank.
To find the rank of A , its transpose is reduced to row echelon form using Gaussian
elimination, which gives the 10 by 8 matrix
0 2 1 3 2
0 0 0 0 2 ( ) 2 ( ( ) ) 2
0 0 0 0 0 0
( )( )
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
e re R w r e R w ue rue
u r R
R w R r
rR
u
RR
RR
Ru
R
Rw
R
.
The determinant of the top-left 7 element square submatrix in the matrix above is
4
0
( )( ) R e R w R r , (H.2)
which is non-zero for
0
0 e , and matrix A has rank 7. When
0
0 e in the orignial
matrix A , the determinant of the submatrix upon Gaussian elimination yields
295
32
12
2 ( ) ( ) R re e R w R r , (H.3)
which is non-zero for
12
0, 0 ee , and rank of A is 7. Furthermore, when
0 1 2
0 e e e in the original matrix A , the determinant of the submatrix upon Gaussian
elimination yields
2 2 3 2
3
4 ( ) ( ) R r ue R w R r , (H.4)
which is non-zero for
3
0, 0 eu , so rank of A is 7. Because of constraint (4.67),
3
1 e . Furthermore, when
0 1 2
0 e e e u in the original matrix A , the determinant
of the submatrix upon Gaussian elimination yields
3 2 2
3
2 ( ) ( ) R re w R r R , (H.5)
which does not go to zero. Therefore, rank of A is always 7. Therefore, there are 7
independent constraints and one dependent constraint.
It is now shown that the one dependent constraint out of eight in A is the 3rd component
of the tangency constraint (4.69). The 5th row of matrix A which represents this scalar
constraint is removed to produce a 7 by 10 matrix A . Then a similar procedure (using
Gaussian elimination) used above to find the rank of A is performed for A . The same
four steps and the same corresponding four determinants seen above for A , given by
296
(H.2) to (H.5), are produced for A . Hence, the rank of A is found to be 7, and all rows
of A are independent, which shows that the 3rd component of the tangency constraint is
the dependent (redundant) constraint.
Abstract (if available)
Abstract
Presented here are the new Accelerated Runge-Kutta (ARK) numerical integration methods for the solution of initial value problems described by ordinary differential equations. A thorough analysis of these methods is given that includes motivation, derivation, parameter selection, accuracy, speed, stability and convergence studies. Also presented, is a new methodology for modeling the dynamics of non-slip rolling of a spherical ball and the path traced on an arbitrary smooth surface along with a comparison of simulation and experimental results.
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
Flexible formation configuration for terrain following flight: formation keeping constraints
PDF
Development and evaluation of high‐order methods in computational fluid dynamics
PDF
Application of the fundamental equation to celestial mechanics and astrodynamics
PDF
An analytical dynamics approach to the control of mechanical systems
Asset Metadata
Creator
Farahani, Artin (author)
Core Title
Accelerated Runge-Kutta methods and non-slip rolling
School
Andrew and Erna Viterbi School of Engineering
Degree
Doctor of Philosophy
Degree Program
Aerospace
Publication Date
08/31/2010
Publisher
University of Southern California
(original),
University of Southern California. Libraries
(digital)
Tag
dense output accuracy,Matlab ODE23 ODE45 solvers,multi-step methods,non-holonomic constraints,non-slip rolling,numerical integration,OAI-PMH Harvest,path of contact,rolling ball experiment,Runge-Kutta methods
Language
English
Contributor
Electronically uploaded by the author
(provenance)
Advisor
Udwadia, Firdaus E. (
committee chair
), Kanso, Eva (
committee member
), Wang, Chunming (
committee member
)
Creator Email
afarahan@usc.edu,artin.farahani@gmail.com
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-m3416
Unique identifier
UC1138598
Identifier
etd-Farahani-4038 (filename),usctheses-m40 (legacy collection record id),usctheses-c127-395201 (legacy record id),usctheses-m3416 (legacy record id)
Legacy Identifier
etd-Farahani-4038.pdf
Dmrecord
395201
Document Type
Dissertation
Rights
Farahani, Artin
Type
texts
Source
University of Southern California
(contributing entity),
University of Southern California Dissertations and Theses
(collection)
Repository Name
Libraries, University of Southern California
Repository Location
Los Angeles, California
Repository Email
cisadmin@lib.usc.edu
Tags
dense output accuracy
Matlab ODE23 ODE45 solvers
multi-step methods
non-holonomic constraints
non-slip rolling
numerical integration
path of contact
rolling ball experiment
Runge-Kutta methods