# 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
1 vote
36 views

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

The following numerical integral within a numerical integral: ...
• 57
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 ...
• 157
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, ...
• 99
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 ...
• 203
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}$: ...
• 4,060
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 ...
• 11
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 ...
• 723
246 views

### Fractional PDE with CaputoD

I'm trying to solve this fractional PDE ...
• 93
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 ...
• 345
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: ...
• 4,060
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: ...
• 419
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 ...
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 ...
• 91
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. ...
• 197
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 ...
• 133
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)....
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)$$ ...
• 93
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 ...
• 173
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: ...
• 31
48 views

67 views

• 83
173 views

### Why this integral gives zero?

I would like to compute this integral for a =100, ... ,1500 $$\int_1^\infty \dfrac{\left(x^2-1\right)^{3/2}}{x} \,e^{-ax}\, dx$$ ...
• 621
115 views

### Solving this system of differential equation with NDSolve

I'm trying to solve this system of differential equation (the ones in yellow markers are just constants): The initial conditions for this system are n(0) = NN, na(0) = Na, n'(0) = q(0) = 0, q'(0) = ...
39 views

### Analytical integral running slow

I am calculating an integral with Mathematica, but it is running super slow! Do you think there is a way to speed up the computation of A3? Maybe I should define my functions in a different way, but I ...
• 51
82 views

### Need help solving iterativelly a set of transcendental equations with NIntegrate

I have two sets of equations: $q = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}F(q,\phi;z,\beta,\Delta, J)$ $\phi = \frac{1}{\sqrt{2 \pi}}\int dz~ e^{-z^2/2}G(q,\phi;z,\beta, \Delta, J)$ As you may see ...
51 views

### Why does NDSolve[] want to treat my equations as Delay Differential Equations?

I use NDSolve command (method->equation simplification -> residual) to solve different sets of Ordinary differential equations (ODEs). It had worked alright till I added rather a simple ...
• 57
78 views

...
224 views

### Problem with a DAE and DiscreteVariables

Cross-posted in Wolfram Community. I am solving an DAE problem with NDSolve. It is a physical problem related to friction forces: one mass on the X axis and ...
• 145
239 views

### NIntegrate fails to converge to desired accuracy

I am calculating an integral with Mathematica. This is the code I am using: ...
• 51
1 vote
103 views

### How to make an integral and reproduce its graph

How by Mathematica we can make the integral, equation (101) in arxiv:1307.5949 \$ H_0(t-t_0) = \int^{\frac{a}{a_0}}_1 ~ \frac{da’}{\sqrt{ \frac{\Omega_r}{a’^2} + \frac{\Omega_m}{a’} + \Omega_\Lambda ...
• 179
1 vote