Skip to content

Commit

Permalink
Start new catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-Roberts committed Aug 16, 2021
1 parent 23f0256 commit ea3ea35
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Integreat/Internal/Catalog.wl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ BeginPackage["Integreat`Internal`Catalog`"];

Integreat`Internal`Catalog::usage = "Package containing functions for using method catalogs";
AddCatalog::usage = "Adds catalog and search functionality to a symbol";
AddCatalogSearch::usage = "";
CatalogEntry::usage = "";


Begin["`Private`"];
Expand All @@ -15,6 +17,25 @@ AddCatalog[type_Symbol, c__List] := (
type[name_String] := Normal[type[][SelectFirst[StringMatchQ[name, #Names, IgnoreCase -> True] &], "Method"]];
);

AddCatalogSearch[type_Symbol] := (
type[name_String] := type[][SelectFirst[StringMatchQ[name, #Names, IgnoreCase -> True] &], "Method"];
);

CatalogEntry[names:{__String}, method_, notes_String, title_String, authors:{__String}, year_Integer, url_String, extra___Rule] := <|
"Names" -> names,
"Method" -> method,
"Source" -> <|
"Title" -> title,
"Authors" -> authors,
"Year" -> year,
"URL" -> url,
extra
|>,
"Notes" -> notes
|>;

CatalogSearch[type_, name_] := type[][SelectFirst[StringMatchQ[name, #Names, IgnoreCase -> True] &], "Method"]


End[];
EndPackage[];
2 changes: 1 addition & 1 deletion Integreat/Kernel/init.wl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<<Integreat`Rk`Methods`;
<<Integreat`Rk`Catalog`;
<<Integreat`Rk`Catalog2`;
<<Integreat`Rk`Validation`;
<<Integreat`Rk`LinearStability`;
<<Integreat`Rk`NonlinearStability`;
Expand Down
334 changes: 334 additions & 0 deletions Integreat/Rk/Catalog2.wl
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
(* ::Package:: *)

BeginPackage["Integreat`Rk`Catalog`"];
Integreat`Rk`Catalog::usage = "Package containing Runge-Kutta methods from the literature";


Begin["`Private`"];
Needs["Integreat`Rk`Methods`"];
Needs["Integreat`Internal`Catalog`"];


AddCatalogSearch[Rk];

Rk[] := Rk[] = Dataset[{
(* Explicit *)
(* Order 1 *)
CatalogEntry[
{"Euler's method", "Euler method", "Forward Euler", "Explicit Euler", "FE"},
Rk[
{{0}},
{\[FormalTheta]},
{0}
],
"Euler's method is the simplest of all Runge\[Dash]Kutta methods. While its stability and accuracy are limited, it is of great historical significance and serves as the foundation for many time integration methods. Dense output is included as it is trivially available.",
"Institutiones calculi integralis",
{"Leonhard Euler"},
1768,
"https://archive.org/details/institutionescal020326mbp",
"Volume" -> "1"
],
CatalogEntry[
{"Fehlberg's 1(2) method", "Runge\[Dash]Kutta\[Dash]Fehlberg 1(2)", "RKF1(2)", "RKF12"},
Rk[
{{0, 0, 0}, {1/2, 0, 0}, {1/256, 255/256, 0}}, {1/256, 255/256, 0},
{0, 1/2, 1},
{1/512, 255/256, 1/512}
],
"Fehlberg designed this method so that the embedded method is one order higher than the primary method.",
"Low-order classical Runge-Kutta formulas with stepsize control and their application to some heat transfer problems",
{"Erwin Fehlberg"},
1969,
"https://archive.org/details/NASA_NTRS_Archive_19690021375",
"Report" -> "NASA TR R-315"
],
(* Order 2 *)
CatalogEntry[
{"Explicit trapezoidal method", "Heun's method", "Improved Euler's Method", "Modified Euler's Method"},
Rk[
{{0, 0}, {1, 0}},
{1/2, 1/2},
{0, 1}
],
"This method is an extension of the trapezoidal rule used to approximate definite integrals. It was rediscovered by Carl Runge in 1895.",
"Ueber die numerische Aufl\[ODoubleDot]sung von Differentialgleichungen",
{"Gaspard-Gustave de Coriolis"},
1837,
"https://archive.org/details/s1journaldemat02liou",
"Journal" -> "Journal de Math\[EAcute]matiques Pures et Appliqu\[EAcute]es",
"Volume" -> "2",
"Pages" -> "229\[Dash]244"
],
CatalogEntry[
{"Explicit midpoint method", "Explicit midpoint rule"},
Rk[
{{0, 0}, {1/2, 0}},
{0, 1},
{0, 1/2}
],
"This method is an extension of the midpoint rule used to approximate definite integrals.",
"Ueber die numerische Aufl\[ODoubleDot]sung von Differentialgleichungen",
{"Carl Runge"},
1895,
"https://doi.org/10.1007/BF01446807",
"Journal" -> "Mathematische Annalen",
"Volume" -> "46",
"Pages" -> "167\[Dash]178"
],
CatalogEntry[
{"3-stage explicit trapezoidal method"},
Rk[
{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}},
{1/2, 0, 1/2},
{0, 1, 1}
],
"This method is an extension of the trapezoidal rule used to approximate definite integrals.",
"Ueber die numerische Aufl\[ODoubleDot]sung von Differentialgleichungen",
{"Carl Runge"},
1895,
"https://doi.org/10.1007/BF01446807",
"Journal" -> "Mathematische Annalen",
"Volume" -> "46",
"Pages" -> "167\[Dash]178"
],
CatalogEntry[
{"Ralston's method", "Ralston's second order method"},
Rk[
{{0, 0}, {2/3, 0}},
{1/4, 3/4},
{0, 2/3}
],
"Ralson derived this method so that it has the smallest error among two-stage, second order, explicit Runge\[Dash]Kutta methods.",
"Runge-Kutta Methods with Minimum Error Bounds",
{"Anthony Ralston"},
1962,
"https://doi.org/10.2307/2003133",
"Journal" -> "Mathematics of Computation",
"Volume" -> "16",
"Number" -> "80",
"Pages" -> "431\[Dash]437"
],
CatalogEntry[
{"Fehlberg's 2(3) method", "Runge\[Dash]Kutta\[Dash]Fehlberg 2(3)", "RKF2(3)", "RKF23"},
Rk[
{{0, 0, 0}, {1, 0, 0}, {1/4, 1/4, 0}},
{1/2, 1/2, 0},
{0, 1, 1/2},
{1/6, 1/6, 2/3}
],
"Fehlberg designed this method so that the embedded method is one order higher than the primary method.",
"Low-order classical Runge-Kutta formulas with stepsize control and their application to some heat transfer problems",
{"Erwin Fehlberg"},
1969,
"https://archive.org/details/NASA_NTRS_Archive_19690021375",
"Report" -> "NASA TR R-315"
],
CatalogEntry[
{"Fehlberg's 2(3)b method", "Runge\[Dash]Kutta\[Dash]Fehlberg 2(3)b", "RKF2(3)b", "RKF23b"},
Rk[
{{0, 0, 0, 0}, {1/4, 0, 0, 0}, {-189/800, 729/800, 0, 0}, {214/891, 1/33, 650/891, 0}},
{214/891, 1/33, 650/891, 0},
{0, 1/4, 27/40, 1},
{533/2106, 0, 800/1053, -1/78}
],
"Fehlberg designed this method so that the embedded method is one order higher than the primary method.",
"Low-order classical Runge-Kutta formulas with stepsize control and their application to some heat transfer problems",
{"Erwin Fehlberg"},
1969,
"https://archive.org/details/NASA_NTRS_Archive_19690021375",
"Report" -> "NASA TR R-315"
],
CatalogEntry[
{"Sofroniou\[Dash]Spaletta 2(1)", "Sofroniou and Spaletta 2(1)"},
Rk[
{{0, 0, 0}, {1, 0, 0}, {1/2, 1/2, 0}},
{1/2, 1/2, 0},
{0, 1, 1},
{1, -1/6, 1/6}
],
"This method is designed to have minimal error while having stiffness detection capabilities. It is an extension of Heun's method to have the FSAL property and include an embedded method.",
"Construction of Explicit Runge-Kutta Pairs with Stiffness Detection",
{"Mark Sofroniou", "Giulia Spaletta"},
2004,
"https://doi.org/10.1016/j.mcm.2005.01.010",
"Journal" -> "Mathematical and Computer Modelling",
"Volume" -> "40",
"Number" -> "11\[Dash]12",
"Pages" -> "1157\[Dash]1169"
],
(* Order 3 *)
CatalogEntry[
{"Runge's third order Simpson's Rule"},
Rk[
{{0, 0, 0, 0}, {1/2, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}},
{1/6, 2/3, 0, 1/6},
{0, 1/2, 1, 1}
],
"This method is Runge's attempt to extend Simpson's rule for definite integrals to differential equations. It can be expressed as M+(T'-M)/3, where M is the explicit midpoint method and T' is the 3-stage explicit trapezoidal method.",
"Ueber die numerische Aufl\[ODoubleDot]sung von Differentialgleichungen",
{"Carl Runge"},
1895,
"https://doi.org/10.1007/BF01446807",
"Journal" -> "Mathematische Annalen",
"Volume" -> "46",
"Pages" -> "167\[Dash]178"
],
CatalogEntry[
{"Heun's third order method"},
Rk[
{{0, 0, 0}, {1/3, 0, 0}, {0, 2/3, 0}},
{1/4, 0, 3/4},
{0, 1/3, 2/3}
],
"Heun considered methods in which a stage is only used in the subsequent stage.",
"Neue Methode zur approximativen Integration der Differentialgleichungen einer unabh\[ADoubleDot]ngigen Ver\[ADoubleDot]nderlichen",
{"Karl Heun"},
1900,
"https://archive.org/details/zeitschriftfrma01runggoog",
"Journal" -> "Zeitschrift f\[UDoubleDot]r Mathematik und Physik",
"Volume" -> "45",
"Pages" -> "23\[Dash]38"
],
CatalogEntry[
{"Ralston's third order method"},
Rk[
{{0, 0, 0}, {1/2, 0, 0}, {0, 3/4, 0}},
{2/9, 1/3, 4/9},
{0, 1/2, 3/4}
],
"Ralson derived this method so that it has the smallest error among three-stage, third order, explicit Runge\[Dash]Kutta methods.",
"Runge-Kutta Methods with Minimum Error Bounds",
{"Anthony Ralston"},
1962,
"https://doi.org/10.2307/2003133",
"Journal" -> "Mathematics of Computation",
"Volume" -> "16",
"Number" -> "80",
"Pages" -> "431\[Dash]437"
],
CatalogEntry[
{"Sofroniou\[Dash]Spaletta 3(2)", "Sofroniou and Spaletta 3(2)"},
Rk[
{{0, 0, 0, 0}, {1/2, 0, 0, 0}, {-1, 2, 0, 0}, {1/6, 2/3, 1/6, 0}},
{1/6, 2/3, 1/6, 0},
{0, 1/2, 1, 1},
{(22-Sqrt[82])/72, (14+Sqrt[82])/36, (Sqrt[82]-4)/144, (16-Sqrt[82])/48}
],
"This method is designed to have minimal error while having stiffness detection capabilities.",
"Construction of Explicit Runge-Kutta Pairs with Stiffness Detection",
{"Mark Sofroniou", "Giulia Spaletta"},
2004,
"https://doi.org/10.1016/j.mcm.2005.01.010",
"Journal" -> "Mathematical and Computer Modelling",
"Volume" -> "40",
"Number" -> "11\[Dash]12",
"Pages" -> "1157\[Dash]1169"
],
CatalogEntry[
{"Bogacki\[Dash]Shampine method", "Bogacki\[Dash]Shampine 3(2)", "BS(2,3)", "ode23"},
Rk[
{{0, 0, 0, 0}, {1/2, 0, 0, 0}, {0, 3/4, 0, 0}, {2/9, 1/3, 4/9, 0}},
{2/9, 1/3, 4/9, 0},W

This comment has been minimized.

Copy link
@reid-g

reid-g Aug 16, 2021

Member

Mistype a W here

{0, 1/2, 3/4, 1},
{7/24, 1/4, 1/3, 1/8}
],
"This extends Ralston's optimal third order method by adding an embedded method and the FSAL property. It is perhaps best known from MATLAB's ode23 function.",
"A 3(2) pair of Runge - Kutta formulas",
{"Lawrence F. Shampine", "Przemyslaw Bogacki"},
1989,
"https://doi.org/10.1016/0893-9659(89)90079-7",
"Journal" -> "Applied Mathematics Letters",
"Volume" -> "2",
"Number" -> "4",
"Pages" -> "321\[Dash]325"
],
(* Order 4 *)
CatalogEntry[
{"RK4", "Classic Runge\[Dash]Kutta Method", "Classical Runge\[Dash]Kutta Method", "The Runge\[Dash]Kutta Method"},
Rk[
{{0, 0, 0, 0}, {1/2, 0, 0, 0}, {0, 1/2, 0, 0}, {0, 0, 1, 0}},
{1/6, 1/3, 1/3, 1/6},
{0, 1/2, 1/2, 1}
],
"RK4 is the most well-known Runge\[Dash]Kutta method.",
"Beitrag zur na\:0308herungsweisen Integration totaler Differentialgleichungen",
{"Wilhelm Kutta"},
1901,
"https://archive.org/details/zeitschriftfrma12runggoog",
"Journal" -> "Zeitschrift f\[UDoubleDot]r Mathematik und Physik",
"Volume" -> "46",
"Pages" -> "435\[Dash]453"
],
CatalogEntry[
{"3/8-rule"},
Rk[
{{0, 0, 0, 0}, {1/3, 0, 0, 0}, {-1/3, 1, 0, 0}, {1, -1, 1, 0}},
{1/8, 3/8, 3/8, 1/8},
{0, 1/3, 2/3, 1}
],
"???",

This comment has been minimized.

Copy link
@reid-g

reid-g Aug 16, 2021

Member

Perhaps a optimum description would be "This method provides the best approximation due to symmetry but, is less popular to RK4"

"Beitrag zur na\:0308herungsweisen Integration totaler Differentialgleichungen",
{"Wilhelm Kutta"},
1901,
"https://archive.org/details/zeitschriftfrma12runggoog",
"Journal" -> "Zeitschrift f\[UDoubleDot]r Mathematik und Physik",
"Volume" -> "46",
"Pages" -> "435\[Dash]453"
],
CatalogEntry[
{"Gill's Method", "Gill's fourth order method", "Runge\[Dash]Kutta\[Dash]Gill method"},
Rk[
{{0, 0, 0, 0}, {1/2, 0, 0, 0}, {(Sqrt[2]-1)/2, 1-Sqrt[2]/2, 0, 0}, {0, -Sqrt[2]/2, 1+Sqrt[2]/2, 0}},
{1/6, (2-Sqrt[2])/6, (2+Sqrt[2])/6, 1/6},
{0, 1/2, 1/2, 1}
],
"Using Wilhelm Kutta's parameterization of fourth order Rugne\[Dash]Kutta methods, Gill searched for a method that can use three registers per variable instead of four. Of the two he found, this is the more accurate.",
"A process for the step-by-step integration of differential equations in an automatic digital computing machine",
{"Stanley Gill"},
1951,
"https://doi.org/10.1017/S0305004100026414",
"Journal" -> "Mathematical Proceedings of the Cambridge Philosophical Society",
"Volume" -> "47",
"Number" -> "1",
"Pages" -> "96\[Dash]108"
],
CatalogEntry[
{"Merson's method", "Merson 4(\"5\")", "Runge\[Dash]Kutta\[Dash]Merson method"},
Rk[
{{0, 0, 0, 0, 0}, {1/3, 0, 0, 0, 0}, {1/6, 1/6, 0, 0, 0}, {1/8, 0, 3/8, 0, 0}, {1/2, 0, -3/2, 2, 0}},
{1/6, 0, 0, 2/3, 1/6},
{0, 1/3, 1/3, 1/2, 1},
{1/10, 0, 3/10, 2/5, 1/5}
],
"The embedded method is order three for general, nonlinear problems but order five for linear problems.",
"An operational method for the study of integration processes",
{"Robert H. \"Robin\" Merson"},
1957,
"https://www.massey.ac.nz/~rmclachl/DPACM", (* Is there a more stable url? *)
"Proceedings" -> "Proceedings of Conference on Data Processing and Automatic Computing Machines",
"Volume" -> "1",
"Pages" -> "110-1 to 110-26"
],
CatalogEntry[
{"Sofroniou\[Dash]Spaletta 4(3)", "Sofroniou and Spaletta 4(3)"},
Rk[
{{0, 0, 0, 0, 0}, {2/5, 0, 0, 0, 0}, {-3/20, 3/4, 0, 0, 0}, {19/44, -15/44, 10/11, 0, 0}, {11/72, 25/72, 25/72, 11/72, 0}},
{11/72, 25/72, 25/72, 11/72, 0},
{0, 2/5, 3/5, 1, 1},
{1251515/8970912, 3710105/8970912, 2519695/8970912, 61105/8970912, 119041/747576}
],
"This method is designed to have stiffness detection capabilities, simple coefficients, and minimal error.",
"Construction of Explicit Runge-Kutta Pairs with Stiffness Detection",
{"Mark Sofroniou", "Giulia Spaletta"},
2004,
"https://doi.org/10.1016/j.mcm.2005.01.010",
"Journal" -> "Mathematical and Computer Modelling",
"Volume" -> "40",
"Number" -> "11\[Dash]12",
"Pages" -> "1157\[Dash]1169"
]
}];


End[];
EndPackage[];

0 comments on commit ea3ea35

Please sign in to comment.