You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/SciML/ColPrac)
9
+
[](https://github.com/SciML/ColPrac)
**SymbolicNumericIntegration.jl** is a hybrid symbolic/numerical integration package that works on the [Julia Symbolics](https://github.com/JuliaSymbolics/Symbolics.jl) expressions.
@@ -26,19 +26,29 @@ using SymbolicNumericIntegration
26
26
27
27
@variables x
28
28
29
-
julia>integrate(3x^3+2x -5)
29
+
integrate(3x^3+2x -5)
30
+
```
31
+
32
+
```
30
33
(x^2 + (3//4)*(x^4) - (5x), 0, 0)
31
34
```
32
35
33
36
# Citation
37
+
34
38
If you use SymbolicNumericIntegration.jl in your research, please cite [this paper](https://arxiv.org/abs/2201.12468):
39
+
35
40
```
36
-
@article{Iravanian2022,
37
-
author = {Shahriar Iravanian and Carl Julius Martensen and Alessandro Cheli and Shashi Gowda and Anand Jain and Julia Computing and Yingbo Ma and Chris Rackauckas},
38
-
doi = {10.48550/arxiv.2201.12468},
39
-
month = {1},
40
-
title = {Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression},
41
-
url = {https://arxiv.org/abs/2201.12468v2},
42
-
year = {2022},
41
+
42
+
@article{Iravanian2022,
43
+
author = {Shahriar Iravanian and Carl Julius Martensen and Alessandro Cheli and Shashi Gowda and Anand Jain and Julia Computing and Yingbo Ma and Chris Rackauckas},
44
+
doi = {10.48550/arxiv.2201.12468},
45
+
month = {1},
46
+
title = {Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression},
**SymbolicNumericIntegration.jl** is a hybrid symbolic/numerical integration package that works on the [Julia Symbolics](https://docs.sciml.ai/Symbolics/stable/) expressions.
3
4
4
-
**SymbolicNumericIntegration.jl** uses a randomized algorithm based on a hybrid of the *method of undetermined coefficients* and *sparse regression* and is able to solve a large subset of basic standard integrals (polynomials, exponential/logarithmic, trigonometric and hyperbolic, inverse trigonometric and hyperbolic, rational and square root).
5
-
The basis of how it works and the theory of integration using the Symbolic-Numeric methods refer to [Basis of Symbolic-Numeric Integration](docs/theory.ipynb).
5
+
**SymbolicNumericIntegration.jl** uses a randomized algorithm based on a hybrid of the *method of undetermined coefficients* and *sparse regression* and can solve a large subset of basic standard integrals (polynomials, exponential/logarithmic, trigonometric and hyperbolic, inverse trigonometric and hyperbolic, rational and square root).
6
+
The basis of how it works and the theory of integration using the Symbolic-Numeric methods refer to [Basis of Symbolic-Numeric Integration](https://github.com/SciML/SymbolicNumericIntegration.jl/blob/main/docs/theory.ipynb).
6
7
7
8
Function `integrate` returns the integral of a univariate expression with *constant* real or complex coefficients. `integrate` returns a tuple with three values. The first one is the solved integral, the second one is the sum of the unsolved terms, and the third value is the residual error. If `integrate` is successful, the unsolved portion is reported as 0.
8
9
10
+
## Installation
11
+
12
+
To install SymbolicNumericIntegration.jl, use the Julia package manager:
`integrate` has the form `integrate(y; kw...)` or `integrate(y, x; kw...)`, where `y` is the integrand and the optional `x` is the variable of integration. The keyword parameters are:
62
74
63
-
*`abstol` (default `1e-6`): the error tolerance to accept a solution.
64
-
*`symbolic` (default `true`): if true, pure symbolic integration is attempted first.
65
-
*`bypass` (default `false`): if true, the whole expression is considered at once and not per term.
66
-
*`num_steps` (default `2`): one plus the number of expanded basis to check (if `num_steps` is 1, only the main basis is checked).
67
-
*`num_trials` (default `5`): the number of attempts to solve the integration numerically for each basis set.
68
-
*`show_basis` (default `false`): print the basis set, useful for debugging. Only works if `verbose` is also set.
69
-
*`homotopy` (default: `true` as of version 0.7.0): uses the continuous Homotopy operators to generate the integration candidates.
70
-
*`verbose` (default `false`): if true, prints extra (and voluminous!) debugging information.
71
-
*`radius` (default `1.0`): the starting radius to generate random test points.
72
-
*`opt` (default `STLSQ(exp.(-10:1:0))`): the optimizer passed to `sparse_regression!`.
73
-
*`max_basis` (default `110`): the maximum number of expression in the basis.
74
-
*`complex_plane` (default `true`): random test points are generated on the complex plane (only over the real axis if `complex_plane` is `false`).
75
+
-`abstol` (default `1e-6`): the error tolerance to accept a solution.
76
+
-`symbolic` (default `true`): if true, pure symbolic integration is attempted first.
77
+
-`bypass` (default `false`): if true, the whole expression is considered at once and not per term.
78
+
-`num_steps` (default `2`): one plus the number of expanded basis to check (if `num_steps` is 1, only the main basis is checked).
79
+
-`num_trials` (default `5`): the number of attempts to solve the integration numerically for each basis set.
80
+
-`show_basis` (default `false`): print the basis set, useful for debugging. Only works if `verbose` is also set.
81
+
-`homotopy` (default: `true` as of version 0.7.0): uses the continuous Homotopy operators to generate the integration candidates.
82
+
-`verbose` (default `false`): if true, prints extra (and voluminous!) debugging information.
83
+
-`radius` (default `1.0`): the starting radius to generate random test points.
84
+
-`opt` (default `STLSQ(exp.(-10:1:0))`): the optimizer passed to `sparse_regression!`.
85
+
-`max_basis` (default `110`): the maximum number of expression in the basis.
86
+
-`complex_plane` (default `true`): random test points are generated on the complex plane (only over the real axis if `complex_plane` is `false`).
75
87
76
88
## Testing
77
89
@@ -80,29 +92,29 @@ julia> integrate(exp(x^2))
80
92
Additionally, 12 test suites from the *Rule-based Integrator* ([Rubi](https://rulebasedintegration.org/)) are included in the `/test` directory. For example, we can test the first one as below ([Axiom](http://www.axiom-developer.org/) refers to the format of the test files)
81
93
82
94
```julia
83
-
using SymbolicNumericIntegration
84
-
include("test/axiom.jl") # note, you may need to use the correct path
95
+
using SymbolicNumericIntegration
96
+
include("test/axiom.jl") # note, you may need to use the correct path
85
97
86
-
L =convert_axiom(:Apostle) # can also use L = convert_axiom(1)
0 commit comments