Questions tagged [numerical-integration]
Questions on the use of numerical functions NIntegrate and NDSolve.
3,358
questions
0
votes
0
answers
23
views
ParallelTable stuck
I have Mathematica 12.1. I generate a data dat in the form x1, x2, x3, x4, func[x1,x2,x3,x4], then interpolate it obtaining a ...
3
votes
2
answers
344
views
How can I speed up calculation of the integral?
Is it possible to speed up the calculation of the Kx integral?
...
3
votes
1
answer
44
views
Strange output of NIntegrate when constraining the precision with $Pre
One can constrain the precision of NIntegrate by setting PrecisionGoal:
...
1
vote
1
answer
69
views
How to speedup integration of interpolated function with logarithmized data?
Consider some dataset corresponding to the grid x1, x2, function[x1,x2]:
...
0
votes
0
answers
28
views
NDSolve coupled ODEs with data
If I have a system of coupled ODEs, say { x'[t]=expr1[x,y,z] , y[t]=expr2[x,y,z],with proper initial conditions } , along with a set of data of (y,z) in the whole relevant region we want to study. ...
2
votes
1
answer
129
views
NDSolve with parametric endpoint
I want to solve numerically a system of ODEs of the form:
$$\ddot{y}+3\frac{\dot{b}}{b}\dot{y}=2Cy(y^2-1)$$
and
$$\dot{b}^{2}=1-b^{2}+\frac{D}{2\sqrt{C}}b^{2}\left(\dot{y}^{2}-C(y^{2}-1)^{2}\right)$$
...
0
votes
0
answers
44
views
Numerically Solving a System of Coupled Integro-Differential Equations
I want to solve a system of coupled Integro-Differential equations in the form below:
With $k_{min} = 10^{-14} , k_{max} = 10^{-7}$
$\eta_{min} = 10^{13} , \eta_{max} = 10^{15}$
And there is already ...
0
votes
0
answers
45
views
Calculating double integrals from a very big function
I need to compute integrals (for different value of i and j) of a function named se in this post. We need to double differentiate from se related to i and j and then compute double integrals over the ...
2
votes
0
answers
54
views
Efficient powers of DPR1 matrices
I'm looking to compute the following quantity for $A$ where $A$ is a convergent positive definite $d\times d$ diagonal + rank1 matrix (DPR1).
$$f(s)=\operatorname{Tr}(A^s)$$
Earlier answer answer by ...
0
votes
1
answer
64
views
Is it possible to run an integral as a batch and output the results to an excel file?
I'm running the following integral in Mathematica:
...
1
vote
1
answer
113
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
0
answers
45
views
Inverting Laplace transform numerically for a set of points
Computing inverse of Laplace transform numerically in Mathematica seems very slow and requires $k$ calls for $k$ points. Is there a faster way to do it for a set of $k$ points, ie $k\approx 1000$?
<...
0
votes
0
answers
46
views
How to plot solution and approximate solution in one graph?
I want to solve a BVP $y^{\prime\prime}(t)+y^{2}(t)-t^{4}-2=0$, with BCs $y(0)=0, y(1)=1$. Solving $x^{\prime\prime}=0$ with the BCs, we get the initial approximation $x_{0}=t$. The exact solution is ...
0
votes
0
answers
55
views
Double integral problem with infinite integral
double numerical integral as show in the follow:
$-\frac{4 \sqrt{\frac{3}{8}-\epsilon ^2} \text{sgn}(w) \sin \left(\frac{3 w}{2}\right) \cos (100 w) \left(\frac{4 \epsilon \left(-\frac{10000}{3} \...
1
vote
3
answers
171
views
Mathematica cannot NIntegrate
I want to evaluate a numerical integral:
NIntegrate[
Exp[-2*Pi*I*Integrate[EllipticTheta[3, (-Pi)*u, 0.4], {u, 0, t}]]*
Exp[2*Pi*I*t], {t, 0, 1}]
Then, error ...
3
votes
1
answer
72
views
Why two the same integrals give different values?
Why two the same integrals give different values?
...
0
votes
1
answer
72
views
Plotting No-Fermi scaling function
Given the function below
How can one plot with x in the horizontal and g(x) in the vertical axis for different values of ...
0
votes
0
answers
50
views
How to solve boundary value problem?
Is it possible to solve a boundary value problem like this?
...
0
votes
0
answers
62
views
Solving coupled system with nonlinear 3rd order ODEs, over range from zero to infinity
I need help solving this system with the fifth-order Runge Kutta Fehlberg integration scheme.
my code is
`
...
4
votes
3
answers
146
views
How to numerically solve a differential equation which has integration in it?
I am trying to solve the following differential equation which has integration in it. It is not giving any results. Can anyone help?
...
2
votes
1
answer
159
views
When p ranges from 0 to infinity, S is obtained by numerical integration
The parameters and functions are loaded as follows:
...
1
vote
2
answers
119
views
Integration over region yields wrong answer?
From an electricity and magnetism question, I want to evaluate:
\begin{equation}
E = \frac{k}{4 \pi \epsilon_0} \int_{-d}^{d} \int_{-d}^{d} \frac{-y^2}{(x^2 + y^2 + z^2)^{3/2}} dx dy
\end{equation}
...
1
vote
3
answers
161
views
Speeding up the time of integration calculation
I am going to integrate from Chebyshev orthogonal functions that is in the form of:
...
0
votes
1
answer
50
views
NIntegrate MonteCarlo with phase-space constraints
I wanted to use NIntegrate in Mathematica to perform a multi-dimensional Monte-Carlo integration numerically.
I am a physics student, and I want to calculate probabilty (cross-section) of a high ...
0
votes
0
answers
29
views
Why occur a giant increasing of absolute value of minimal eigenvalue with rise of the basis functions number?
I have the following code:
code 1
...
1
vote
1
answer
151
views
Post-process NDSolveValue result
For example, after solving the Poisson equation $-\nabla^2 T = 1$ on the unit circle using NDSolveValue and the following code
...
0
votes
0
answers
59
views
Numerical solution of the integral for the profile of a vortex
I am trying to solve numerically the integral extracted from the article by Vanyó et al. (https://doi.org/10.1103/PhysRevE.90.013002)
$$
h(r') = \int_{0}^{r^{\prime}} \frac{\partial p}{\partial r} / \...
2
votes
0
answers
65
views
Why does different nondimensionalizations give different results? Although the results should be the same
I have some problems with the non-dimensionalization of the Hamiltonian of motion in a Coulomb field.
The Hamiltonian has a following form:
$$H=-\frac{\hbar^2}{2\mu^*} \Delta_r-\frac{e^2}{\epsilon_0 r}...
0
votes
2
answers
72
views
Calculating Length of an Elliptical Arc [closed]
I am trying to calculate the arclength of a section of an ellipse, given the correspoding parametrization angle $\phi$. While doing so, I am running into problems with elliptic integrals. The ...
1
vote
1
answer
117
views
Wolfram Mathematica Monte Carlo for integrals approximation
I wanted to implement the Monte Carlo method for multiple integrals approximation in Wolfram Mathematica. Namely I wanted to let the user insert as input the dimension of the integral and the number ...
5
votes
2
answers
174
views
NIntegrate a discrete data set with uncertainties
Consider a data set with some numerical uncertainty in the y-values, such as the following
...
0
votes
0
answers
27
views
How to span a non-zero parameter space for integral?
https://github.com/adeelaafzal/Effective_degrees_of_freedom/find/main
I am working on the following code,
...
0
votes
0
answers
56
views
Bessel Function Numerical Integration: Invalid Limit of Integration
I am new to the Mathematica and trying to compute numerically value that involves Bessel function and its derivate.
Here ae+- (in code it's Xplus and ...
0
votes
1
answer
143
views
Find trajectory of particle solving ODE containg integral
Please suggest how to solve below linear ODE (I want to plot the r vs t graph), I am trying using Integrate:
...
0
votes
1
answer
216
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 ...
1
vote
1
answer
105
views
Creating a variable-length list of integral equations using a loop
I need to automatically form a list of equations that later will be used in FindRoot. The number of equations (NN) is variable, so I need to use a For loop. When I ...
0
votes
0
answers
49
views
Numerical integration of complicated multivariable expression with divergencies
I've been working on a weird case for some time now and I'm stumped. Any help would be appreciated.
The problem
I'm trying to calculate a 5-dimensional integral of a pretty complicated function (which ...
0
votes
0
answers
52
views
Can you plot the expressions in a list without Evaluate[]?
Plot is forcing me to choose between two bad options.
I have a function g that is a numerical integral which I want to plot for multiple values of a parameter.
<...
1
vote
1
answer
48
views
A problem about the integration of blackbody radiation law using FormulaData. QuantityVariable limits
I am trying to integrate blackbody radiation law under 1500 Kelvin using the FormulaData command.
The integration seems not to work properly after I designate the ...
5
votes
5
answers
232
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{\...
0
votes
0
answers
40
views
Can I use FoldList or NestList with solutions of ParametricNDSolve?
I have a problem where I need to solve a system of nonlinear differential equations piece by piece, and for each piece, I need to use the results of the previous system as input for the initial ...
1
vote
1
answer
97
views
How to improve accuracy of the integration in the following case?
Consider the following function dsPrimakovdtnucleus:
...
0
votes
1
answer
66
views
Integration is not correct for the expression with a fraction?
What value Px2[16, 4] or N[Px22[16, 4]] is correct?
...
1
vote
1
answer
63
views
Obtaining different answers when using NDSolve vs ParametricNDSolveValue
I am obtaining two different answers for a curve when solving the same exact system of differential equations when using NDSolve vs when using ParametricNDSolveValue. Here it is when using NDSolve:
<...
0
votes
1
answer
37
views
Issues plotting the solutions from NDSolve
I am having an issue with the functions that I have defined using the solutions given by NDSolve. The easiest way to explain my issue is through the code itself, so here it is:
...
0
votes
0
answers
27
views
Error of boundary condition is not specified on a single edge
I am trying to solve a PDE, but Mathematica is showing a strange message which is saying" boundary condition is not specified on a single edge"
...
0
votes
0
answers
54
views
I need advice to solve system of integral equations of convolution type numerically
I have two known matrices:
...
0
votes
1
answer
68
views
How to solve this ODE by NDSolve?
I am trying to solve an ODE using NDSolve, but I get a division by zero error. I am not sure how to fix this and obtain a solution:
...
0
votes
0
answers
54
views
How to code my data by using Richardson Extrapolation?
The cardiac output of this patient can be calculated using the Stewart Hamilton equation. To do this, we will first use the Trapezoidal Rule to find the value of the concentrations (C(t)),I1,I2 and I3 ...
0
votes
1
answer
61
views
How to solve this nonlinear ODE? [Imposing that $f>0$]
I am trying to solve an ODE of the following form
$$\frac{f'(r)}{\sqrt{1+r^2 f'(r)^2}} = a'r^3 + b'r^2+c'$$
for some constants $a'=8/60,b'=-1/4,c'=-1/2$ and $r>0$ and $f(r)\in [0,\pi]$ for all $r&...