Skip to content

Commit baa288e

Browse files
Merge pull request #12 from ArnoStrouwen/main
move readme to docs
2 parents d27efa5 + 7523374 commit baa288e

File tree

9 files changed

+145
-121
lines changed

9 files changed

+145
-121
lines changed

.github/workflows/Documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- 'release-'
78
tags: '*'
89
pull_request:
910

README.md

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
**SymbolicNumericIntegration.jl** is a hybrid symbolic/numerical integration package that works on the [Julia Symbolics](https://github.com/JuliaSymbolics/Symbolics.jl) expressions.
44

5-
**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).
6-
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).
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.
9-
105
```julia
116
using Symbolics
127
using SymbolicNumericIntegration
@@ -15,107 +10,4 @@ using SymbolicNumericIntegration
1510

1611
julia> integrate(3x^3 + 2x - 5)
1712
(x^2 + (3//4)*(x^4) - (5x), 0, 0)
18-
19-
julia> integrate((5 + 2x)^-1)
20-
((1//2)*log((5//2) + x), 0, 0.0)
21-
22-
julia> integrate(1 / (6 + x^2 - (5x)))
23-
(log(x - 3) - log(x - 2), 0, 3.339372764128952e-16)
24-
25-
y = integrate(1 / (x^2 - 16))
26-
((1//8)*log(x - 4) - ((1//8)*log(4 + x)), 0, 1.546926788028958e-16)
27-
28-
julia> integrate(x^2/(16 + x^2))
29-
(x + 4atan((-1//4)*x), 0, 1.3318788420751984e-16)
30-
31-
julia> integrate(x^2/sqrt(4 + x^2))
32-
((1//2)*x*((4 + x^2)^0.5) - ((2//1)*log(x + sqrt(4 + x^2))), 0, 8.702422633074313e-17)
33-
34-
julia> integrate(x^2*log(x))
35-
((1//3)*log(x)*(x^3) - ((1//9)*(x^3)), 0, 0)
36-
37-
julia> integrate(x^2*exp(x))
38-
(2exp(x) + exp(x)*(x^2) - (2x*exp(x)), 0, 0)
39-
40-
julia> integrate(tan(2x))
41-
((-1//2)*log(cos(2x)), 0, 0)
42-
43-
julia> integrate(sec(x)*tan(x))
44-
(cos(x)^-1, 0, 0)
45-
46-
julia> integrate(cosh(2x)*exp(x))
47-
((2//3)*exp(x)*sinh(2x) - ((1//3)*exp(x)*cosh(2x)), 0, 7.073930088880992e-8)
48-
49-
julia> integrate(cosh(x)*sin(x))
50-
((1//2)*sin(x)*sinh(x) - ((1//2)*cos(x)*cosh(x)), 0, 4.8956233716268386e-17)
51-
52-
julia> integrate(cosh(2x)*sin(3x))
53-
(0.153845sinh(2x)*sin(3x) - (0.23077cosh(2x)*cos(3x)), 0, 4.9807620877373405e-6)
54-
55-
julia> integrate(log(log(x))*(x^-1))
56-
(log(x)*log(log(x)) - log(x), 0, 0)
57-
58-
julia> integrate(exp(x^2))
59-
(0, exp(x^2), Inf) # as expected!
60-
```
61-
62-
`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:
63-
64-
* `abstol` (default `1e-6`): the error tolerance to accept a solution.
65-
* `symbolic` (default `true`): if true, pure symbolic integration is attempted first.
66-
* `bypass` (default `false`): if true, the whole expression is considered at once and not per term.
67-
* `num_steps` (default `2`): one plus the number of expanded basis to check (if `num_steps` is 1, only the main basis is checked).
68-
* `num_trials` (default `5`): the number of attempts to solve the integration numerically for each basis set.
69-
* `show_basis` (default `false`): print the basis set, useful for debugging. Only works if `verbose` is also set.
70-
* `homotopy` (default: `true` as of version 0.7.0): uses the continuous Homotopy operators to generate the integration candidates.
71-
* `verbose` (default `false`): if true, prints extra (and voluminous!) debugging information.
72-
* `radius` (default `1.0`): the starting radius to generate random test points.
73-
* `opt` (default `STLSQ(exp.(-10:1:0))`): the optimizer passed to `sparse_regression!`.
74-
* `max_basis` (default `110`): the maximum number of expression in the basis.
75-
* `complex_plane` (default `true`): random test points are generated on the complex plane (only over the real axis if `complex_plane` is `false`).
76-
77-
## Testing
78-
79-
`test/runtests.jl` contains a test suite of 160 easy to moderate test integrals (can be run by calling `test_integrals`). Currently, **SymbolicNumericIntegration.jl** solves more than 90% of its test suite.
80-
81-
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)
82-
83-
```julia
84-
using SymbolicNumericIntegration
85-
include("test/axiom.jl") # note, you may need to use the correct path
86-
87-
L = convert_axiom(:Apostle) # can also use L = convert_axiom(1)
88-
test_axiom(L, false; bypass=false, verbose=false, homotopy=true)
89-
```
90-
91-
The test suites description based on the header of the files in the Rubi directory are
92-
93-
| name | id | comment |
94-
|-------------|----|------------------------------------------|
95-
|:Apostle | 1 | Tom M. Apostol - Calculus, Volume I, Second Edition (1967) |
96-
|:Bondarenko | 2 | Vladimir Bondarenko Integration Problems |
97-
|:Bronstein | 3 | Manuel Bronstein - Symbolic Integration Tutorial (1998) |
98-
|:Charlwood | 4 | Kevin Charlwood - Integration on Computer Algebra Systems (2008) |
99-
|:Hearn | 5 | Anthony Hearn - Reduce Integration Test Package |
100-
|:Hebisch | 6 | Waldek Hebisch - email May 2013 |
101-
|:Jeffrey | 7 | David Jeffrey - Rectifying Transformations for Trig Integration (1997) |
102-
|:Moses | 8 | Joel Moses - Symbolic Integration Ph.D. Thesis (1967) |
103-
|:Stewart | 9 | James Stewart - Calculus (1987) |
104-
|:Timofeev | 10 | A. F. Timofeev - Integration of Functions (1948) |
105-
|:Welz | 11 | Martin Welz - posts on Sci.Math.Symbolic |
106-
|:Webster | 12 | Michael Wester |
107-
108-
## Citation
109-
110-
If you use **SymbolicNumericIntegration.jl**, please cite [Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression](https://arxiv.org/abs/2201.12468):
111-
112-
```
113-
@article{Iravanian2022,
114-
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},
115-
doi = {10.48550/arxiv.2201.12468},
116-
month = {1},
117-
title = {Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression},
118-
url = {https://arxiv.org/abs/2201.12468v2},
119-
year = {2022},
120-
}
12113
```

docs/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[deps]
2+
SymbolicNumericIntegration = "78aadeae-fbc0-11eb-17b6-c7ec0477ba9e"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
5+
[compat]
6+
Documenter = "0.27"

docs/make.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
using Documenter
2-
using SymbolicNumericIntegration
1+
using Documenter, SymbolicNumericIntegration
2+
3+
include("pages.jl")
34

45
makedocs(
5-
sitename="SymbolicNumericIntegration",
6-
format=Documenter.HTML(),
7-
modules=[SymbolicNumericIntegration]
6+
sitename="SymbolicNumericIntegration.jl",
7+
authors="Shahriar Iravanian",
8+
modules=[SymbolicNumericIntegration],
9+
clean=true,doctest=false,
10+
format = Documenter.HTML(analytics = "UA-90474609-3",
11+
assets = ["assets/favicon.ico"],
12+
canonical="https://symbolicnumericintegration.sciml.ai/stable/"),
13+
pages=pages
814
)
915

10-
# Documenter can also automatically deploy documentation to gh-pages.
11-
# See "Hosting Documentation" and deploydocs() in the Documenter manual
12-
# for more information.
1316
deploydocs(
14-
repo="https://github.com/SciML/SymbolicNumericIntegration.jl";
15-
push_preview=true
17+
repo = "github.com/SciML/SymbolicNumericIntegration.jl.git";
18+
push_preview = true
1619
)

docs/pages.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Put in a separate page so it can be used by SciMLDocs.jl
2+
3+
pages=[
4+
"Home" => "index.md",
5+
"symbolicnumericintegration.md"
6+
]

docs/src/assets/favicon.ico

1.36 KB
Binary file not shown.

docs/src/assets/logo.png

26 KB
Loading

docs/src/index.md

Lines changed: 116 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,120 @@
11
# SymbolicNumericIntegration.jl
2+
**SymbolicNumericIntegration.jl** is a hybrid symbolic/numerical integration package that works on the [Julia Symbolics](https://github.com/JuliaSymbolics/Symbolics.jl) expressions.
23

3-
Documentation for SymbolicNumericIntegration.jl
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).
6+
7+
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+
```julia
10+
using Symbolics
11+
using SymbolicNumericIntegration
12+
13+
@variables x
14+
15+
julia> integrate(3x^3 + 2x - 5)
16+
(x^2 + (3//4)*(x^4) - (5x), 0, 0)
17+
18+
julia> integrate((5 + 2x)^-1)
19+
((1//2)*log((5//2) + x), 0, 0.0)
20+
21+
julia> integrate(1 / (6 + x^2 - (5x)))
22+
(log(x - 3) - log(x - 2), 0, 3.339372764128952e-16)
23+
24+
y = integrate(1 / (x^2 - 16))
25+
((1//8)*log(x - 4) - ((1//8)*log(4 + x)), 0, 1.546926788028958e-16)
26+
27+
julia> integrate(x^2/(16 + x^2))
28+
(x + 4atan((-1//4)*x), 0, 1.3318788420751984e-16)
29+
30+
julia> integrate(x^2/sqrt(4 + x^2))
31+
((1//2)*x*((4 + x^2)^0.5) - ((2//1)*log(x + sqrt(4 + x^2))), 0, 8.702422633074313e-17)
32+
33+
julia> integrate(x^2*log(x))
34+
((1//3)*log(x)*(x^3) - ((1//9)*(x^3)), 0, 0)
35+
36+
julia> integrate(x^2*exp(x))
37+
(2exp(x) + exp(x)*(x^2) - (2x*exp(x)), 0, 0)
38+
39+
julia> integrate(tan(2x))
40+
((-1//2)*log(cos(2x)), 0, 0)
41+
42+
julia> integrate(sec(x)*tan(x))
43+
(cos(x)^-1, 0, 0)
44+
45+
julia> integrate(cosh(2x)*exp(x))
46+
((2//3)*exp(x)*sinh(2x) - ((1//3)*exp(x)*cosh(2x)), 0, 7.073930088880992e-8)
47+
48+
julia> integrate(cosh(x)*sin(x))
49+
((1//2)*sin(x)*sinh(x) - ((1//2)*cos(x)*cosh(x)), 0, 4.8956233716268386e-17)
50+
51+
julia> integrate(cosh(2x)*sin(3x))
52+
(0.153845sinh(2x)*sin(3x) - (0.23077cosh(2x)*cos(3x)), 0, 4.9807620877373405e-6)
53+
54+
julia> integrate(log(log(x))*(x^-1))
55+
(log(x)*log(log(x)) - log(x), 0, 0)
56+
57+
julia> integrate(exp(x^2))
58+
(0, exp(x^2), Inf) # as expected!
59+
```
60+
61+
`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+
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+
76+
## Testing
77+
78+
`test/runtests.jl` contains a test suite of 160 easy to moderate test integrals (can be run by calling `test_integrals`). Currently, **SymbolicNumericIntegration.jl** solves more than 90% of its test suite.
79+
80+
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+
82+
```julia
83+
using SymbolicNumericIntegration
84+
include("test/axiom.jl") # note, you may need to use the correct path
85+
86+
L = convert_axiom(:Apostle) # can also use L = convert_axiom(1)
87+
test_axiom(L, false; bypass=false, verbose=false, homotopy=true)
88+
```
89+
90+
The test suites description based on the header of the files in the Rubi directory are
91+
92+
| name | id | comment |
93+
|-------------|----|------------------------------------------|
94+
|:Apostle | 1 | Tom M. Apostol - Calculus, Volume I, Second Edition (1967) |
95+
|:Bondarenko | 2 | Vladimir Bondarenko Integration Problems |
96+
|:Bronstein | 3 | Manuel Bronstein - Symbolic Integration Tutorial (1998) |
97+
|:Charlwood | 4 | Kevin Charlwood - Integration on Computer Algebra Systems (2008) |
98+
|:Hearn | 5 | Anthony Hearn - Reduce Integration Test Package |
99+
|:Hebisch | 6 | Waldek Hebisch - email May 2013 |
100+
|:Jeffrey | 7 | David Jeffrey - Rectifying Transformations for Trig Integration (1997) |
101+
|:Moses | 8 | Joel Moses - Symbolic Integration Ph.D. Thesis (1967) |
102+
|:Stewart | 9 | James Stewart - Calculus (1987) |
103+
|:Timofeev | 10 | A. F. Timofeev - Integration of Functions (1948) |
104+
|:Welz | 11 | Martin Welz - posts on Sci.Math.Symbolic |
105+
|:Webster | 12 | Michael Wester |
106+
107+
## Citation
108+
109+
If you use **SymbolicNumericIntegration.jl**, please cite [Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression](https://arxiv.org/abs/2201.12468):
4110

5-
```@autodocs
6-
Modules = [SymbolicNumericIntegration]
7111
```
112+
@article{Iravanian2022,
113+
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},
114+
doi = {10.48550/arxiv.2201.12468},
115+
month = {1},
116+
title = {Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression},
117+
url = {https://arxiv.org/abs/2201.12468v2},
118+
year = {2022},
119+
}
120+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# API
2+
3+
```@docs
4+
integrate
5+
```

0 commit comments

Comments
 (0)