Questions tagged [numerical-integration]
Questions on the use of numerical functions NIntegrate and NDSolve.
3,676 questions
3
votes
1
answer
167
views
Mathematica ODE question
I am trying to solve an iterative matrix ODE of the form $f_k'(x)=T.f_k(x)+B(x)*S.f_{k-1}(x)$, where f is an $n$ dimension column, T and S are $n \times n$ matrices, and $B(x)$ is a function. The ...
2
votes
0
answers
74
views
Event is not triggered in NDSolve
I'm solving an ODE system with multiple events and find the discrete variable not updated as expected because one of the events is not triggered. During narrowing down the problem, I find something ...
3
votes
0
answers
125
views
Efficiently Finding Optimal Configurations of Lofted Solids
A lofted solid is like a solid cylinder with two different end caps.
A natural set of questions given a lofted solid using two shapes would be if we were to be able to rotate an end around the ends ...
5
votes
2
answers
313
views
NDSolve exceedingly slow
I the following ODE with parameters
\begin{align}
B_e\: \theta''(s)+2(s-1)\cos\theta(s)=S_e\: f\left(\theta(s)\right),
\end{align}
with $0\leq s\leq 1$ and
\begin{align}
\theta(0)=0\:\:\:\text{and}\:\:...
3
votes
1
answer
194
views
circumventing apparent errors in Integrate and NIntegrate
I have been working on a wiki page about asymptotic Laurent series for derangements, and recently learned that the converse of Watson's lemma often holds, allowing one to represent such series as ...
1
vote
2
answers
175
views
Numerical integration with Singularity
I have an integral that I want to integrate over the whole $\mathbb{C}$ plane, say parametrized by $(z,\bar{z})$. The integrand is of the following form
$$ \frac{f(z,\bar{z})}{|1-z|^2} - \frac{C}{|1-z|...
0
votes
0
answers
75
views
Increasing the working precision gives me an error message in NIntegrate
I am hitting a problem with numerical integration. I have a function (a4xinteg in this expression below), the expression is quite long so below you can find a plot of it:
I would like to integrate ...
5
votes
0
answers
147
views
"Glueing" interpolating functions
Suppose we have two interpolating functions with exactly touching domains, in our case {-1, 1} and {1, 2}.
How to "glue&...
5
votes
2
answers
273
views
Extract information from NDSolve during evaluation
I want to find for which t any of these holds: x[t] + y[t] == 0.25, x[t] + y[t] == 0.5, <...
0
votes
0
answers
88
views
Unexpected linear decay in gravitational waveform amplitude using NDSolve—how to fix?
I'm solving the Regge–Wheeler equation in Schwarzschild spacetime
D[u[t, x], {t, 2}] + Vsx[x]*u[t, x] == D[u[t, x], {x, 2}],
with the potential
...
0
votes
0
answers
54
views
integrand to non-numerical values when doing numerical integration of numerical integrations [duplicate]
Could someone please explain me why these errors happen and if it's possible to solve them?
Here's my code
...
0
votes
2
answers
265
views
Error on numerical integration
Is there a way to obtain the error on a numerical integration using NIntegrate ?
I have try this answer https://mathematica.stackexchange.com/a/102469/111297, ...
4
votes
1
answer
244
views
Generating Poincaré sections
I would like to reproduce the Poincaré sections presented in this and this papers, which look like
The figures are for energy values of E=0.2 (a) and E=0.25 (b) in the Hamiltonian, which reads
$$H=\...
6
votes
1
answer
672
views
How do you increase the precision and accuracy of the numerical approximation of the Volchkov integral?
There is a need to increase the number of correct decimal digits from this integral:
...
7
votes
6
answers
632
views
NDSolve not able to adjust condition in ODE
I'm trying to solve the equation
\begin{align}
\epsilon_b\:\theta''(s)-(l-s)\cos\theta(s)=\epsilon_\gamma\sin\theta(s)\cos\theta(s),
\end{align}
with $0\leq s\leq l$ and
\begin{align}
\theta(0)=0\:\:\:...
0
votes
0
answers
144
views
How to solve a regular integral with divergence analytically
I want to analytically integrate this integration
$$\int_0^{1 - 3/rs}\left(\frac{9 \sqrt{3} \sqrt{\frac{1}{\left(1-\frac{2}{\eta }\right) \eta ^2 \left(\frac{\eta
^2}{1-\frac{2}{\eta }}-27\right)}}}...
3
votes
1
answer
181
views
Effective numerical integration inside triangle
I want to integrate a function like
NIntegrate[f[x1] g[x2], {x1, 0, L}, {x2, x1, L}]
which is a triangle region. For every x1, ...
3
votes
2
answers
234
views
NDSolveValue giving nlnum warning for ODE with discontinuity
The following code
...
8
votes
1
answer
291
views
Generating natural structures with Mathematica
I am interested in Fomes Fomentarius or "Tinder Polypore" mushroom patterns
(original photo, diagrams of Voronoi and Delaunay):
At first it seems something simple, like a sunflower seed ...
2
votes
1
answer
145
views
Integrate and Plot
I have a function which I want to integrate and then plot. The function is a complicated one and getting an error SystemException["MemoryAllocationFailure"]. Can any one fix this? The code ...
2
votes
1
answer
282
views
Nested NIntegrate Iterations
I'm working on finding the limit of a function that involves nested integration.
I've written the code, and it's running an iterative procedure.
However, each iteration currently takes about 24 hours ...
0
votes
1
answer
257
views
How to avoid singularity during integration? [closed]
I applied the recommendations from my previous question, the calculation time was reduced. Thank you very much!
Now I have a question regarding the calculation of some matrix elements, for example <...
1
vote
0
answers
140
views
Possible ways to increase the speed of integral calculations
The code below is used to calculate the matrix elements He. However, the calculation of each element takes a very long time.
Question: How can the speed of these ...
3
votes
2
answers
300
views
Solution to a two-dimensional integration equation
I was hoping to solve a two dimensional integration equation, which is actually a simplified Schrodinger equation in momentum space:
$$ (x^2-3)f(x,y)-\int_0^\infty du\int_0^{\pi}dv\frac{u^2\sin{v}f(...
1
vote
0
answers
141
views
Looking for Gaussian quadrature rules for triangle and tetrahedron
edited
The gaussian quadrature rules are very helpful in solving many numerical problems.
Unfortunately Mathematica only provides the one dimensional rules in the package ...