Questions tagged [numerical-integration]
Questions on the use of numerical functions NIntegrate and NDSolve.
3,502
questions
1
vote
0
answers
49
views
How to decrease the computation timing while using NIntegrate?
I'm trying to calculate the $A$ and $F$ values by using this code,
...
0
votes
3
answers
88
views
+50
Properly define function from outcome of NSolve and FindRoot
We have the function $\gamma(u,v)$ defined implicitly as the solution of
\begin{align}
\sin\gamma(u,v)=g\left(u-v\cos\gamma(u,v) \right),
\end{align}
being $g$ a given function. I can solve for $\...
0
votes
0
answers
19
views
Integrating a function that one obtains from using several ND Solve [closed]
I have a vector field , and I wanna figure out its flow , for this I use NDSolve , this is $\mathbb{R}^8$. Now for each dimension I obtain a function in $\mathbb{R}$. Then I want to use these ...
2
votes
0
answers
56
views
Speeding up the nested NIntegration consisted of `Exp' and `Bessel' functions
I got stuck with optimizing the nested numerical integration of function with a high number of Bessel functions (first and second kinds) summed and several exponents. I will appreciate any suggestions ...
0
votes
1
answer
32
views
Integrate & Unit: unable to determine the units of quantities
In a Wolfram Notebook,
I declare a function F1[x]=1/x where x is in "Meters"
F1[X_] = With[{x=Quantity[X,"Meters"]},1/x]
I integrate F1. ...
2
votes
1
answer
147
views
How to Optimize Integro-Differential Equation Solving Time in Mathematica?
I'm trying to solve an integro-differential equation numerically in Mathematica that models the evolution of a physical system . However, the computation takes a very long time and doesn't yield a ...
0
votes
1
answer
48
views
Trying to use NIntegrate and my code works intermittently - Throws one error consistently, but only gives me a partial result [closed]
I'm trying to do some calculations/simulations of pulse autocorrelations of non-integer orders and when I try to use NIntegrate it only works intermittently, and when it does work it only gives me a ...
2
votes
1
answer
77
views
NIntegrate underestimate the area under the graph [closed]
I want to find the area under this graph,
I used NIntegrate for this purpose and here is my script,
...
5
votes
5
answers
520
views
Monte Carlo Integration
I need to find the center of mass of a bar of length 12 using basic Monte Carlo integration. The mass distribution $ m(x) = .06x^2-3x+36$ and the definition of the center of mass is
$x_{com} = \frac{\...
1
vote
1
answer
106
views
Partial integro-differential equation
I want to solve the following partial integro-differential equation for $\delta(x,t)$:
$$
1-B \cdot \frac{\partial \delta(x, t)}{\partial t}=\frac{1}{\pi} \int_{-1}^1 \frac{\partial \delta(s, t)}{\...
3
votes
1
answer
64
views
Integral of interpolation function is not evaluated
I am having a misunderstanding with Mathematica about integration of InterpolatingFunction. Consider this example:
...
1
vote
3
answers
299
views
Non-linear PDE coefficients problem
I'm trying to solve the following PDE
...
0
votes
2
answers
71
views
Comparing Closed-form to Numerical Integral Result
When I numerically calculate this integral
NIntegrate[(1/2)*Log[1 + Sin[x]]^2, {x, 0, Pi}]
The result is $0.416217488896557$ and I verified it using another tool....
0
votes
2
answers
90
views
How to chose appropriate finite limits for NIntegrate?
I want to NIntegrate a function using finite limits so it gives a result as close as possible to a result which I would get making the limit ...
1
vote
0
answers
69
views
Numerically solving a non-linear and with infinite domain integro-differential equation
I have tried NDsolve but failed. Would there be any way to solve this equation numerically using Mathematica?
Here is the code:
...
8
votes
2
answers
157
views
FindRoot changes results from ParametricNDSolve
I solve numerically an equation, and I get the expected behaviour like the following graph
But if I use FindRoot to get the roots before plotting, the plot of my ...
2
votes
3
answers
211
views
Convergence and efficiency of 5-dimensional numerical integral using “GlobalAdaptive”
We have a 5-dimensional integral arising as a solution to a physics problem, where two dimensions of the integration space cover the spherical and azimuthal angle, and three dimensions are needed to ...
1
vote
1
answer
247
views
NIntegrate methods with region
As of Mathematica version 10, one can integrate over regions (see https://www.wolfram.com/mathematica/new-in-10/symbolic-geometry/integrate-over-regions.html )
As a toy example, I am using this from ...
1
vote
1
answer
176
views
How to numerically integrate the time of two oscillatory functions from NDEigensystem
I am trying to numerically integrate phi*psi. And no matter which method I chose, the NIntegrate failed.
...
0
votes
1
answer
109
views
Numerical Fourier transform
I am having issues trying to numerically Fourier transform the following function
\begin{equation}
f(x) =\frac{1}{x^6}\sqrt{4m^2x^2+x^4}\log\biggm(\frac{2m^2 + x^2 + \sqrt{4m^2x^2+x^4}}{2m^2}\biggm)
\...
4
votes
1
answer
328
views
Looking for an appropriate method of NDSolve for dynamical system
I am dealing with the numerical solutions of a variety of dynamical systems with integrals of motion.
As the example, let me consider the Kuramoto model, which equations of motion are
...
1
vote
2
answers
103
views
Iterated integral numerically
I am trying to calculate a double integral. However, after a long time, Mathematica does not give me any outputs. Has someone any ideas how to calculate this?
...
0
votes
1
answer
334
views
How to obtain the convolution of these functions?
I am starting to use Mathematica. I wanted to compute
$$\nabla F*\phi(x),\;x\in\mathbb{R^2}$$
where $F(x)=\ln\|x\|$ and $\phi(x)=\chi_{B(0,2)}(x)$.
I am a new user of this software, so I don't know ...
4
votes
2
answers
414
views
Extract and solve complex solutions from ContourPlot/FindRoot
I have to solve a complicated equation numerically f(z,k)=0 with z = x + i y a complex variable and ...
2
votes
0
answers
38
views
Different answers from `NSurfaceIntegrate` if using `ImplicitRegion`
I want to find the surface area of a region defined as $x^2+y^2\le1$ and $z=ln(x^2+y^2+2)$.
I can transform it into cylindrical coordinates and write $z=ln(r^2+2)$. Using ...
1
vote
1
answer
308
views
Evaluate 3D- and 5D-constrained integrals for absolute separability probabilities
In a recent posting,
TwoQubits
user JimB, employing a change-of-transformations put forth by N. Tessore, was able to confirm a formula for the "two-qubit absolute separability Hilbert-Schmidt ...
0
votes
1
answer
98
views
How to incorporate boundary conditions?
I have this linearized PDE problem:
$$\lambda a^\ast+\bar{a}v^\ast_z+\bar{a}_zv^\ast+\bar{v}a^\ast_z+\bar{v}_za^\ast=0$$
$$\lambda \bar a h^\ast -\bar a \bar h v^\ast_z-\bar a \bar v_z h^\ast - \bar h ...
5
votes
4
answers
266
views
Solving the system of nonlinear PDE
I have never used Mathematica before.
I am trying to solve the system of PDE
\begin{array}{l} \frac{\partial u}{\partial t} = D_u \nabla^2 u - \beta \chi_u \nabla ( u \nabla \pi_u) + u (\pi_u - \...
1
vote
2
answers
134
views
Problem with evaluation of integral
My code is creating an error when I try to evaluate an integral. Could I ask you to reproduce this code and see what is wrong? Thank you.
Here I simply define two variables:
Find ...
0
votes
0
answers
30
views
Numerical integrate a matrix valued function whose arguments limited to be numerical
I'm encountering non-numerical errors when using NIntegrate to integrate a matrix-valued function whose arguments are restricted to numerical values. Setting ...
0
votes
1
answer
118
views
Confusing behaviour of EvaluationMonitor in NIntegrate when integrating on a implicit region
I am dealing with some complex integral and I just need an approximate result(have a precision of about 4 digits) for it. Thus I just need to do the integral by sampling at as less points as possible ...
3
votes
2
answers
144
views
3
votes
1
answer
106
views
Asymptotic integral expansion at infinity [closed]
Define for all $n\in\mathbb{N}$, a definite double integral, $$I_n= \int_{0}^{1}\int_{0}^{1}\left(\frac{x^2(1-x)y^2(1-y)}{1+x^2 y^2}\right)^n\frac{\cos((2n+1)\tan^{-1}(xy))}{\sqrt{1+x^2y^2}}\ dxdy$$
...
0
votes
1
answer
135
views
2
votes
1
answer
38
views
Nested NIntegrate with limit variable dependance
Hope you are doing great!
I am trying to solve a double Integral of a function let's say f(w,q).
My upper and lower limits are
...
1
vote
1
answer
37
views
Not able to integrate function involving scalar product
For given $h=0.2,D=1.5$, let $w_{i}(x):=\frac{1}{\pi D}\exp^{-||\frac{x-hi}{\sqrt{D}h}||^{2}}$ where $x\in \mathbb{R}^{2}$ and $i\in I \subset \mathbb{Z}^{2}.$ For $x\in \mathbb{R}^{2}$ ,let $v(x):=-...
0
votes
1
answer
266
views
Plot all real and imaginary roots of FindRoot (2)
Following the comment of our friend @Bob Hanlon's in my post Plot all real and imaginary roots of FindRoot vrs `k`, which I would like to thank again for the assistance it gave, I'm creating a new ...
2
votes
1
answer
96
views
Incredibly slow NIntegrate
I define the following function
$$
f(x,y,z) = \frac{\sin x}{\pi \sqrt{\Big[ \cos x - \cos (y-z) \Big] \Big[ \cos (y+z) - \cos (x) \Big]}}
$$
where $y, z$ are all between $0, \pi/2$ and $ |y-z| < x &...
1
vote
0
answers
78
views
Which rule to choose for NIntegrate?
I would like to know how to choose the right rule among several (TrapezoidalRule, NewtonCotesRule, ...) to compute correctly an ...
1
vote
1
answer
158
views
How to make the NIntegate of two variables as efficient as possible?
I asked my question here (Multivariable NIntegrate gives different value if I integrate it separately), I think the best way to get help is by putting the original code here. So, my question is how ...
0
votes
2
answers
131
views
Integrating over an interval
I have a function I want to integrate, which is $v(t)$.
solv = NDSolve[{v'[t] + (v[t])^2 + f == 0, v[0] == -I*k55},
v[t], {t, 0, 150}]
Also, I have a range ...
4
votes
1
answer
119
views
NIntegrate returns TerminatedEvaluation["RecursionLimit"] when called in another function
I try to perform some numerical integration with high precision on version
In[1]:= $Version
Out[1]= "13.3.1 for Linux x86 (64-bit) (July 24, 2023)"
Here ...
1
vote
0
answers
60
views
Numerically integrating an interpolation function and its derivative
I am working with a differential equation I cannot solve analytically. I solved it numerically. I have data representing position versus time in a list. I have working code that generates an ...
1
vote
1
answer
96
views
Question about numerical integration of a double integral
I am trying to numerically integrate the following double integral in Mathematica for different values of t.
...
0
votes
1
answer
154
views
Matrix as the discretization of a function $u$ over a rectangle in 3D, how to fastly integrate along the axes?
I have a function $u$ from 3D to 1D approximated in a list uu and I want to calculate e.g.
$$\int_0^1 x\cdot u(x,y,z)dx$$
or
$$\int_0^1\int_0^1\int_0^1 u(x,y,z)...
0
votes
2
answers
116
views
What is the value of this integral?
Let us consider the definite integral $$\int\limits_0^1\frac{1}{-\sin \left(\frac{355 x}{113}\right)-\sin (\pi x)+2}\,dx.$$
The integrand has the sharp maximum at approximately ...
1
vote
1
answer
43
views
How can I fix NIntegrate::inumr warning message?
I have this code:
...
0
votes
0
answers
135
views
Unable to compute integral on implicit region
I am new to Mathematica. I need to deal with the following computation
...
8
votes
2
answers
188
views
Numerical integral does not agree with analytic integral
I am trying to evaluate a function, that I've now reduced to its minimum (not) working example. Unless I am doing something very wrong, it appears that NIntegrate ...
2
votes
1
answer
215
views
Implementing and testing boundary conditions in polar coordinates for convection-diffusion equation
I am modeling a system using the convection-diffusion equation on a 2D, radially symmetric space. I wanted to do some sanity checks to make sure I am coding it correctly. I set up a situation where I ...