Skip to content

Commit 70444a9

Browse files
Merge pull request #148 from DanielVandH/parameters2
Simpler initial example, also highlight parameters
2 parents ee89c14 + ba4d1f6 commit 70444a9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,20 @@ the documentation, which contains the unreleased features.
2727

2828
## Examples
2929

30-
For basic multidimensional quadrature we can construct and solve a `IntegralProblem`:
30+
To perform one-dimensional quadrature, we can simply construct an `IntegralProblem`. The code below evaluates $\int_{-2}^5 \sin(xp)~\mathrm{d}x$ with $p = 1.7$. This argument $p$ is passed
31+
into the problem as the fourth argument of `IntegralProblem`.
32+
33+
```julia
34+
using Integrals
35+
f(x, p) = sin(x*p)
36+
p = 1.7
37+
prob = IntegralProblem(f, -2, 5, p)
38+
sol = solve(prob, QuadGKJL())
39+
```
40+
41+
For basic multidimensional quadrature we can construct and solve a `IntegralProblem`. Since we are using no arguments `p` in this example, we omit the fourth argument of `IntegralProblem`
42+
from above. The lower and upper bounds are now passed as vectors, with the `i`th elements of
43+
the bounds giving the interval of integration for `x[i]`.
3144

3245
```julia
3346
using Integrals

0 commit comments

Comments
 (0)