Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 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 ...
  • 5,112
3 votes
2 answers
300 views

How can I speed up calculation of the integral?

Is it possible to speed up the calculation of the Kx integral? ...
  • 771
3 votes
1 answer
40 views

Strange output of NIntegrate when constraining the precision with $Pre

One can constrain the precision of NIntegrate by setting PrecisionGoal: ...
  • 2,754
1 vote
1 answer
63 views

How to speedup integration of interpolated function with logarithmized data?

Consider some dataset corresponding to the grid x1, x2, function[x1,x2]: ...
  • 5,112
0 votes
0 answers
26 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. ...
1 vote
0 answers
30 views

Solving a three-dimensional Gross-Pitaevskii equation

Continuing with my previous question, I want to reproduce the resluts in the article Emergence of a Turbulent Cascade in a Quantum Gas. Specifically, $n(k)$ in figure 3 or extended Data Figure 2 is ...
  • 177
2 votes
1 answer
80 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
37 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
39 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
48 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
62 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
86 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
41 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
33 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
52 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
1 vote
3 answers
168 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 ...
  • 1,009
3 votes
1 answer
61 views

Why two the same integrals give different values?

Why two the same integrals give different values? ...
  • 771
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 ...
  • 247
0 votes
0 answers
46 views

How to solve boundary value problem?

Is it possible to solve a boundary value problem like this? ...
  • 195
0 votes
0 answers
51 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
136 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? ...
  • 195
2 votes
0 answers
139 views

When p ranges from 0 to infinity, S is obtained by numerical integration

The parameters and functions are loaded as follows: ...
  • 309
1 vote
2 answers
118 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
157 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
43 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
27 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 ...
  • 771
1 vote
1 answer
144 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 ...
  • 479
0 votes
0 answers
55 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
62 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}...
  • 771
0 votes
2 answers
67 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
102 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 ...
  • 11
5 votes
2 answers
152 views

NIntegrate a discrete data set with uncertainties

Consider a data set with some numerical uncertainty in the y-values, such as the following ...
  • 2,049
0 votes
0 answers
26 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
53 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: ...
  • 1,013
0 votes
1 answer
204 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 ...
  • 693
1 vote
1 answer
99 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 ...
  • 173
0 votes
0 answers
46 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 ...
  • 67
0 votes
0 answers
48 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
46 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
184 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,147
0 votes
0 answers
38 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 ...
  • 69
1 vote
1 answer
94 views

How to improve accuracy of the integration in the following case?

Consider the following function dsPrimakovdtnucleus: ...
  • 5,112
0 votes
1 answer
65 views

Integration is not correct for the expression with a fraction?

What value Px2[16, 4] or N[Px22[16, 4]] is correct? ...
  • 771
1 vote
1 answer
60 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: <...
  • 69
0 votes
1 answer
36 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: ...
  • 69
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
53 views

I need advice to solve system of integral equations of convolution type numerically

I have two known matrices: ...
  • 1
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: ...
  • 93
0 votes
0 answers
46 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 ...

1
2 3 4 5
67