# Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

3,140 questions
Filter by
Sorted by
Tagged with
32 views

### NIntegrate failed to converge to prescribed accuracy for integral contain Bessel function of first kind

I am new in Mathematica, I try to find the following numerical integral. but I get the error message ( NIntegrate failed to converge to prescribed accuracy ...), I know that there is a divergence ...
1 vote
36 views

### NIntegrate::nlim: * is not a valid limit of integration

The following numerical integral within a numerical integral: ...
246 views

### Fractional PDE with CaputoD

I'm trying to solve this fractional PDE ...
1 vote
50 views

### Why this integral is calculated incorrectly？

Input: Integrate[1/y - Floor[1/y], {y, 0, 1}] N[Integrate[1/y - Floor[1/y], {y, 0, 1}]] Output: Integrate[1/y - Floor[1/y], {y, 0, 1}] 0.418638 The above code is ...
77 views

### Mathematica vs other languages such as C or Python [closed]

I need your valuable opinion on a very controversial question regarding Mathematica versus other languages, in particular C or C++. For computation, analytical or numerical in physics or other areas, ...
1 vote
27 views

### NDSolve error in Functional Delay Diff Eq

I'm trying to use Mathematica to study an equation that has an unusual dependence on past states, i.e. some kind of a Delay Diff Eq. For the sake of this post, we can say that the equation I would ...
722 views

### Reap and Sow From NDSolve solution

I want to get the answer of my NDSolve in the form of table (the value of each x and y). Let'...
1k views

### Using external variable as a variable inside WhenEvent & NDSolve

I'm trying to use the new WhenEvent functionality of NDSolve in Mathematica 9, in order to perform an action when a variable in the system reaches a certain value. I would like this variable to come ...
335 views

### Numerical solution of singular non-linear integral equation

I want to extend this collocation method based mathematica scheme to solve following non-linear integral equation (Cauchy/Carleman type): $$B(v)/(1-v) \int_{0}^{1} \mathrm{d}x B(x) (1-x)/(v-x) = 1$$ ...
626 views

### Mathematica or math question: why my own Monte Carlo gives different result from the Mathematica's one?

Consider some function of arguments x,y,z, where the latter have some domain of definition $\mathcal{R}$: ...
1 vote
28 views

### Multi-NIntegral with a compiled function: Why not improved so much?

I want to compute the multi-dimensional integral by using NIntegral with the compiled function. I have compiled an integrand function. It made the computation time of the integrand about 100 times ...
163 views

### Need help to speed up the Gaussian quadrature

I am trying to compute the $L_2$-norm of the solution $y(z,t)$ of a PDE with Gauss quadrature using the following code, where $z$ is space position and $t$ is time, then to construct it as a function ...
156 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
128 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. ...
177 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 ...
226 views

### Principal value of a double integral numerically

I have several integrals of the form : where and . where a,b,wc and T are constants and PV denotes the Cauchy principal value I tried to integrate one of this form using NIntegrate however when ...
236 views

### How to write more simple variable-step Runge Kutta algorithm to solve this differential equation?

Here is a case of Runge Kutta algorithm with variable-step size: ...
32 views

### Memory Allocation Error with Principal Value Integral

I'm getting a SystemException["MemoryAllocationFailure"] error with some arguments to S[x] in the following ...
71 views

### Numerical solution of differential equation with DiracDelta fit boundary condition at zero poorly

I need to solve: $x^2y''(x)+(2x+1)y'(x)-x^2\omega^2y(x)=\frac{-\omega^2\delta(x-x_0)}{4\pi},x\in[0,\infty)$ with boundary conditions:$y(0)=1,\ y(\infty)=0$ , $\omega$ is a function of this form: ...
1 vote
53 views

### How to improve the integration accuracy without significant reduction in the speed?

Consider some distribution: ...
2k views

### How to integrate a Bézier function?

I have: points = {{0, 100}, {250, 0}, {0, 300}, {500, 500}} And I want to know the area below the curve, so I came to: ...
117 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 ...
2k views

### How can I use fast Fourier transform (FFT) to solve a PDE (heat equation)?

I'm trying to solve a one-dimensional heat equation (PDE) with the Fourier transform numerically, in the way it was done here. The equation: , is subject to the initial condition: , where U(x,t) is ...
2k views

### Plotting multivariable integration

If I have a multivariable integration like NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}] But I need to plot its result in terms of ...
1 vote
32 views

### Discrepancies in NDSolve Solution Between 4D and its Reduced 3D Counterpart

I have two systems, a 4D system and a 3D system. The 3D system is a reduction of the 4D system in such a way that: ...
85 views

### Why the output curve is not smooth?

tmr is the output funciton which is a complex integral, and afa is the variable. If gama is a real number, for example, gama=-410^(-29)(1 - Cos[6afa]), A2 and A3 can be infinity, and there will ...
116 views

### The Range of a Function

I would like to see minimum and maximum for this example! g[x_]:=(3 a - 2)/((2 + 3 b - 3 a) x^2) + f*x^(-3 a + 3 b + 2) also for those parameters "1 < a &...
52 views

### How to create and plot a function involving NIntegrate

I am interested in understanding the growth of the following function for $n\geq 2$ $$I(n) = \int_{0}^{1/2}\frac{ds}{s^{1-1/n}+(1-s)^{1-1/n}-1}.$$ I can explicitly compute $I(n)$ for various values of ...
1 vote
232 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 ...
2k views

### Find arc length

I am trying to find the arc length for using ...
714 views

### Numerical solution to a nonlinear Ordinary Differential Equation

I am trying to solve the following ODE for $f(x)$: $$x f' - f = \frac{(f')^2}{\gamma^2}[1-({f}')^\gamma]^2$$ where $\gamma < 0$ and real, which makes the ODE highly nonlinear. Since I am not ...
78 views

### NDSolve for Fluid Flow - Monitor Residuals

I'm using NDSolve for fluid flow and would like to monitor the convergence of the solution more closely. I have a simple stationary case set up. NDSolve should return the solutions for u,v and p. ...
445 views

### Maxwell construction problem with FindRoot

A Maxwell construction is just an integral of area and then solving for a root to find vapor pressure. This must be exactly the same value as where the Gibbs energy plot crosses at a point. I found ...
174 views

### Integrate and NIntegrate give different results

Good morning, i computed the following integral using Integrate and i get a different result from the one obtained with NIntegrate. Here is the integrand ...
182 views

### Crank-Nicolson solver for heat equation

My ultimate goal is to solve the 1D radial diffusion equation $$\frac{\partial u(t,x)}{\partial x}=x^2\frac{\partial}{\partial x} \left(\frac{D(t)}{x^2} \frac{\partial u(t,x)}{\partial x } \right)$$ ...
90 views

...
103 views

### Trouble plotting particle geodesic trajectory on wormhole embedding

I'm having tremendous trouble plotting geodesic trajectories on wormhole embedding. I'm attaching the article from which I am trying to re-create the trajectories (https://arxiv.org/pdf/1404.7210.pdf)....
70 views

### Problem with parametric integral with variable bounds

d[p_, B_] := \!$$\*SubsuperscriptBox[\(\[Integral]$$, $$-B$$, $$+B$$]$$Cos[ p\ x] \[DifferentialD]x$$\) Plot[d[x, 2], {x, -10, 10}, PlotRange -> Full] I ...
71 views

### Attempt to code an Integro-Differential Equation Solver

I'm interested in constructing a code that is able to numerically integrate a function at discrete points in order to implement into a numerical solver for a set of Integro-Differential Equation. In ...
86 views

### Double NIntegrate

The functions I have are ...
156 views

### How to make this kind of integration with the trigonometric function?

I am trying to make the following integration. But I am not sure about the result obtained as follows. Is there some way to get more reliable and accurate results? Thanks. ...
40 views

### Multiple Integration of a function defined for a list of arguments [closed]

I want to calculate, by Mathematica, the following integral of a function defined with a list of arguments. $$\int_1^2\int_1^2\int_1^2 (x+y+z)^4 \, dx\, dy \, dz$$ as follows: ...
130 views

### Iterative pde solution NDSolve && NIntegrate

I try to solve a diffusion pde depending on a timedependent argument. Step by step I have no problem to evaluate several solutions: first step (timefunction 0): ...
130 views

### Wrong derivative in delay differential equation initial data returned by NDSolve

I have an DDE: sol = NDSolve[{x'[t] + x[t - 1] == 0, x[t /; t <= 0] == t^2}, x, {t, -1, 5}] And result (take the curve on the time interval $-1<t<0$) <...
1 vote
107 views

### Trouble evaluating an expression [closed]

I am currently trying to numerically evaluate an expression which is the following. The expression IntD0 is being plotted, but the next line is not. I thought it ...