# Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

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

### When can I assume that all decimal digits returned by Mathematica are provably correct?

How to Control the Precision and Accuracy of Numerical Results Arbitrary-Precision Numbers Mathematica works with exact numbers and with two different types of approximate numbers: machine-...
13k views

### Nested NIntegrate

Suppose that we have the given simple integral expression $$\int_{-5}^{5} x \int_{-\infty}^{x} e^{\int_{0}^{z} -y dy} dz dx$$ Writing this out in Mathematica we obtain: ...
6k views

### Complex valued 2+1D PDE Schrödinger equation, numerical method for NDSolve?

Based on the heat equation of the Mathematica Manual tutorial, I wrote the complex counterpart (Schrödinger) equation, for the free particle propagation of an initial wavepacket. ...
2k views

### How to implement custom integration rules for use by NIntegrate?

How can NIntegrate be extended with custom implementation of integration rules? This answer of the question "Monte Carlo integration with random numbers generated ...
5k views

### Determining which rule NIntegrate selects automatically

I need to numerically integrate a highly oscillatory function over the semi-infinite domain $(0,\infty)$: $$\int_0^\infty \frac{\sin^2(x) \sin^2(1000 x)}{x^{5/2}}\mathrm dx$$ Since the Levin rule (...
7k views

### Numerical integration --- Mathematica vs Python (w/ Scipy) performance

I'm about to tackle a problem that involves a lot of (multi-dimensional) numerical integrations and also subsequent optimizations, and so I want to make sure at least the integration step is as fast ...
2k views

### How to use NDSolve to track equilibrium?

I am looking for an extension of NDSolve where integration runs until certain variables are settled at an equilibrium. Now I have a working solution in my sleeves ...
5k views

I have to solve the following set of ODEs and just can't get good results using Mathematica $$r\frac{d}{dr}\left(\frac{1}{r}\frac{d}{dr}A(r)\right)-\xi^2F(r)^2\left(A(r)-1\right)=0$$ $$\frac{1}{r}\... 30 votes 3 answers 3k views ### 1D Euler equations (fluid dynamics) with NDSolve Is it possible to accurately solve the 1D Euler equations in Mathematica using NDSolve? For example, let us consider the Sod shock tube problem. Introduction to ... 29 votes 3 answers 5k views ### Programming a numerical method in the functional style I am new to Mathematica and I would like to learn a bit more about functional programming. At the moment I have assignments like programming different numerical methods (for integration: ... 29 votes 1 answer 947 views ### Publishing results obtained in Mathematica I've been using Mathematica to solve nonlinear partial differential equations for my doctoral research for the last 2 years or so. I am not an expert in Mathematica or mathematics and I am an engineer ... 28 votes 1 answer 3k views ### Gillespie Stochastic Simulation Algorithm The Gillespie SSA is a Monte Carlo stochastic simulation algorithm to find the trajectory of a dynamic system described by a reaction (or interaction) network, e.g. chemical reactions or ecological ... 27 votes 1 answer 7k views ### How to solve a non-linear integral equation? I have a non-linear integral equation that I'd like to solve with Mathematica:$$ \int_{0}^{1} \mathrm{d}x \frac{B(x) v}{(B(x) + B(v))^2} = 1$$... 25 votes 3 answers 7k views ### Solving a Volterra integral equation numerically I would like to solve for P(t), in Mathematica, a Volterra integral equation of the 2nd kind. It is:$$P(t) = R_0(t) + \int_0^t P(t') R_0(t-t')dt'$$I know the function R_0 and would ... 25 votes 2 answers 2k views ### 3D orbits and inaccuracy over time I wrote a little program to use Newton's Law of Universal Gravitation to animate 3 planets orbiting a central star, but I have run into a problem. Here is the code that I used to create the program (I ... 25 votes 2 answers 3k views ### Using a compiled function inside NIntegrate gives "CompiledFunction::cfsa" message The following function is defined for Real input: ... 24 votes 5 answers 12k views ### Numerical Fourier transform of a complicated function Say I have a function f(x) that is given explicitly in its functional form, and I want to find its Fourier transform. If f is too complicated to have an analytic expression for \hat f(k), how ... 24 votes 3 answers 924 views ### Is there any possibility to implement a structure like a ProgressIndicator into NDSolve? It is already formulated in the title. NDSolve takes sometimes a considerable piece of time. It would be very practical to have some information on how long it is still to wait. So, any ideas? To ... 24 votes 2 answers 3k views ### I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve The fluid here has been assumed as single component perfect gas i.e. it obeys the equation p=ρ R T, the thermal conductivity is assumed as a constant, so the equation set is: ... 24 votes 4 answers 5k views ### How to integrate functions of linearly interpolated data? At first, consider integration of pure InterpolatingFunction. Importing some data (works in v.9, for earlier versions one can use this link to download zipped <... 24 votes 2 answers 3k views ### Optimizing a Numerical Laplace Equation Solver Laplace's Equation is an equation on a scalar in which, given the value of the scalar on the boundaries (the boundary conditions), one can determine the value of the scalar at any point in the region ... 24 votes 2 answers 2k views ### Easy way to plot ODE solutions from NDSolve? Inspired by the closed question Beautify a NDSolve Graph ! and a comment someone made to me not too long ago: Is there some quick way to plot NDSolve results ... 24 votes 1 answer 778 views ### Is there an NDSolveProcessEquations analog for NIntegrate? NDSolve has an interface for repeatedly solving an equation with different initial conditions without having to analyze the equation and set up the solving ... 23 votes 1 answer 1k views ### Implement fractional Laplacian What is a way to implement the Fractional Laplacian with Mathematica? How can we apply such implementation to numerically solve the problem$$(-\Delta)^su = 1 \text{ in } B_1(0), \\ u = 0 \text{ in ... 5k views

### Plotting separatrices for nonlinear system

Consider the system: \begin{align*} x'&=(1-x-y)x\\ y'&=(4-7x-3y)y \end{align*} The system has a saddle point at (1/4,3/4). How can I plot the separatrices on the phase portrait having domain ...
1k views

### Numerical inverse Laplace-Hankel transform

When trying to reproduce the result of this paper about numerical solution of Lamb's problem, I encountered the following double integral (to be more precise, the 0-order inverse Hankel-Laplace ...
5k views

### How to speed up the plot of NIntegrate?

Here is a toy example: f[t_] := NIntegrate[Sin[x], {x, 0, t}]; Plot[f[t], {t, 0, 10}] // Timing Even such a simple example will take 2.8 seconds on my computer. ...
2k views

### Only final result from NDSolve

Finally, I started to play with differential equations in Mathematica. And I have faced the problem, which seems to me so basic that I'm afraid this question is going to be closed soon. However, I'...
4k views

### How to calculate the volume of a convex hull?

Given a spatial curve represented by a parametric equation, is it possible in Mathematica 9 to calculate symbolically (or at least numerically) the volume of its convex hull?
1k views

### NDSolve uses different difference order for different spatial derivative when solving PDE

I found something this tutorial for method of line doesn't tell us. Consider the following toy example: ...
677 views

### More efficient method to compute moments of the Johnson $S_B$ distribution

Here is a very specific feature request. I need Mean[JohnsonDistribution["SB", γ, δ, 0, 1]] When I issue e.g. ...
2k views