Skip to content

Commit

Permalink
WIP #1034 new ClenshawCurtisRule, GaussLobattoRule,NewtonCotesRule
Browse files Browse the repository at this point in the history
method options for NIntegrate
  • Loading branch information
axkr committed Aug 1, 2024
1 parent 265a626 commit adcc033
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static double integrate(String method, IAST list, final double min, final
}
// NIntegrate failed to converge after `1` refinements in `2` in the region `3`.
throw new ArgumentTypeException("ncvi", F.List(F.ZZ(result.evaluations), xVar, list.rest()));
} else if ("GaussLobatto".equalsIgnoreCase(method)) {
} else if ("GaussLobattoRule".equalsIgnoreCase(method)) {
Quadrature quadrature = new GaussLobatto(Config.SPECIAL_FUNCTIONS_TOLERANCE, 1000);
QuadratureResult result = quadrature.integrate(f, min, max);
if (result.converged) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void testIntegrate() {
@Test
public void testNIntegrate() {
// avoid Indeterminate at 0
checkNumeric("NIntegrate(1/Sqrt(x), {x, 0.001, 1}, Method -> \"GaussLobatto\")", //
checkNumeric("NIntegrate(1/Sqrt(x), {x, 0.001, 1}, Method -> \"GaussLobattoRule\")", //
"1.9367544467966367");
checkNumeric("NIntegrate(1/Sqrt(x), {x, 0.001, 1}, Method -> \"NewtonCotesRule\")", //
"1.936754446797901");
Expand Down

0 comments on commit adcc033

Please sign in to comment.