Linked Questions
16 questions linked to/from How to implement custom integration rules for use by NIntegrate?
159
votes
9
answers
16k
views
General strategies to write big code in Mathematica?
I think after six months of exposure to Mathematica and the Wolfram Language I am fairly OK with writing short codes and snippets. However, what are some general strategies to use in order to write ...
52
votes
9
answers
14k
views
About multi-root search in Mathematica for transcendental equations
I have some questions for multiroot search for transcendental equations. Is there any clever solution to find all the roots for a transcendental equation in a specific range?
Perhaps ...
38
votes
2
answers
6k
views
Determining which rule NIntegrate selects automatically
I need to numerically integrate a highly oscillatory function over the semi-infinite domain $(0,\infty)$:
$$\int_0^\infty \frac{\sin^2(x) \sin^2(1000 x)}{x^{5/2}}\mathrm dx$$
Since the Levin rule (...
11
votes
6
answers
840
views
How to calculate this integral with highly oscillating integrand?
I mean
$$\int_ 0^{2\pi}\frac {\sin (10050 t)\sin (10251 t)\cos (2022 t)}
{\sin (50 t)\sin (51 t)} dt.$$
Here is my unsuccessful trial:
...
14
votes
2
answers
3k
views
Monte Carlo integration with random numbers generated from a Gaussian distribution
I want to do numerical integration of some functions using the Monte Carlo method.
The default setting for the Monte Carlo method is to use a uniform distribution as far as I know.
How can I change ...
21
votes
1
answer
509
views
How to implement custom NIntegrate integration strategies?
How can new integration strategies algorithms be used with NIntegrate?
This is a different type of extension than the extensions with new integration rules, as ...
13
votes
1
answer
870
views
How to calculate the numerical integral more efficiently?
Rencently, I ecountered the following numerical intergral:
$$
\begin{cases}
\mathbf I_1=\displaystyle \int_{t}\mathbf N' {\mathbf N'}^{\text T}{\rm d}t\\
\mathbf I_2=\displaystyle \int_{t}\mathbf N'' {...
9
votes
4
answers
428
views
How to avoid repetitive calculation when doing numerical integral?
Suppose I have a function f[x] which is very complicated, together with a function g[f[x]]+h[x] to integrate. That is:
...
7
votes
2
answers
339
views
NIntegrate of a vector-valued InterpolatingFunction gives "not numerical"
If I construct a vector-valued InterpolatingFunction, say with
f = Interpolation[{{0, {1,1}}, {1, {0,0}}, {2, {0,1}}, {3, {1,0}}}]
plotting the result works just ...
4
votes
2
answers
267
views
Why do I get number with Precision larger than error estimate?
I'm trying to integrate a large function like this
...
4
votes
2
answers
2k
views
Numerical Integration Via Adaptive Simpson's Method
I have written a code that uses the Adaptive Simpson's method to approximate integration. For those who are unaware of this Adaptive Simpson's method; Adaptive Simpson's method
In my code, I count ...
3
votes
1
answer
461
views
Understanding difference between `NIntegrate` result and home-cooked Simpson's rule
In this question I am asking about the different results I get between NIntegrate-ing a function of two variables vs. "doing it myself" with my own implementation ...
0
votes
4
answers
278
views
Choosing points of integration in NIntegrate (integrating a function given by a list without interpolation)
When using NIntegrate, say in two-dimensions, is it possible to specify the points of the grid Mathematica will use? For example, if the integrand was a function <...
1
vote
0
answers
155
views
How do I write an integral solver [closed]
How would you write a code that solves $\int Sin(y)dy$ (integral is from 0 to x)? The method it uses for solving doesn't really matter, although my go-to would be the Riemann sum. I need the code to ...
1
vote
1
answer
64
views
Can I configure a guaranteed precision for NIntegrate on a monotone function?
I know there are some great posts already about why PrecisionGoal->n doesn't guarantee the result of NIntegrate will actually ...