Questions tagged [numerical-integration]
Questions on the use of numerical functions NIntegrate and NDSolve.
546
questions with no upvoted or accepted answers
9
votes
0
answers
501
views
Solving the 2D Schrödinger equation with eigensystem, then verifying orthonormality of eigenfunctions with NIntegrate
I am solving the time-independent 2D Schrödinger equation for an interacting electron and hole in the case of anisotropic electron and hole masses, where the interaction is described a modified form ...
9
votes
0
answers
452
views
Spurious Error Messages from NDSolve when Using WhenEvent with Time Delays
Bug introduced between versions 10.1 and 10.4, and resolved in 11.3.
Using either 11.2 or 10.4 on Windows 10 (64 bit), I am unable to reproduce the answer by March to question 99576. Specifically,
...
9
votes
0
answers
1k
views
Modelling Hysteresis with a Differential Equation
I want to implement the bulk ferromagnetic hysteresis model (mostly the Jiles-Atherton Model), see http://drum.lib.umd.edu/bitstream/1903/6043/1/PhD_99-1.pdf page 44 equation (30).
The needed ...
8
votes
0
answers
119
views
Bug in integral related to beta distribution
I've encountered a problem, which I'm pretty sure is a bug. I've contacted Wolfram's support and they were less than helpful. I'd like to bring the issue up here to get either a confirmation that it ...
8
votes
0
answers
2k
views
Using NDSolve for Integro-Differential Equations
I have a fairly complicated set of coupled non-linear integro-differential equations that I am trying to solve using NDSolve. The equations are:
$\dot{x}=\big|y(t)-x(t)\big|^{1/n}\left[\text{Sign}[y(...
7
votes
0
answers
390
views
Integrating rational functions of several variables over $\mathbb{H}^4$
Let $W$ be a rational function of $8$ variables $a,b,c,d,e,f,g,h$ from this file, e.g.:
...
6
votes
0
answers
6k
views
What's the most difficult multidimensional integral that Mathematica has solved?
I am interested in benchmarking numerical integration methods and am trying to develop a wider set of difficult multivariate examples. For my particular methods, I only want to look at non-negative-...
6
votes
0
answers
118
views
Details of NDSolve calling LSODA
Inspired by my question regarding the computation time of NDSolve using the LSODA backend I was wondering how NDSolve is actually calling LSODA (what arguments are sent to LSODA), i.e. what are the ...
6
votes
0
answers
135
views
Modify NDSolve`StateData (if possible)
I am trying to solve a PDE that needs to be scaled constantly (refer to this). @andre suggests I modify NDSolve`StateData.
Now, the problem is, I'm not used to ...
5
votes
0
answers
64
views
Are there any dedicated built-in methods to NIntegrate over the unit sphere or the 3D rotational group?
As part of a molecular-physics calculation, I need to perform an integral to find the average of a certain function over all the possible orientations of the molecule,
$$
\langle f(\mathbf v)\rangle = ...
5
votes
0
answers
125
views
Numerical verification of the estimate:
How to verify numerically with considerable accuracy in Mathematica the following :
$$\int_2^x\dfrac{1}{z\Gamma(\sin^2[π\Gamma(z)/(2z)])}dz\sim\ln(\ln(x))$$
?
I need more suitable and better code ...
5
votes
0
answers
175
views
StiffSystem or Singularity - a system of second order ODEs in the problem of geodesics
I would be extremely grateful for any help regarding the following code I wrote and the errors it produces. In this code I am investigating the behaviour of a massive particle trapped in the vicinity ...
5
votes
0
answers
67
views
How can I make this function definition more efficient?
I have a function $g(E)$ that is defined by a very complicated expression but that only involves built-in functions and integrations. I would like to define it in the absolute most efficient way ...
5
votes
0
answers
964
views
Solving a system of differential algebraic equations (DAE)
I am trying to solve a system of 8 differential algebraic equations, where equations 3 and 5 are differential equations and the rest are constraints which need to be satisfied. Also I only know the ...
5
votes
0
answers
192
views
Using NIntegrate and DiscretePlot to visualize pseudodifferential operators
In harmonic analysis, pseudodifferential operators are a way to generalize the notions of derivatives, through the use of Fourier transforms. The basic idea being,
Let $u(x)\in\mathcal{S}(\mathbb{R}^...
5
votes
0
answers
991
views
Solve integral equation for upper bound
I need to find the upper bound of an integral knowing the value of the lower bound and the result of the integral.
Here is my function:
f[t_] = Sqrt[1 + E^(-2 t)]
...
5
votes
0
answers
534
views
NDSolve PDE, not enough boundary condition?
The PDE that I want to solve is:
$$
\frac{\partial f}{\partial t} + \frac{1}{m} \left( p_x \frac{\partial f}{\partial x} + p_y \frac{\partial f}{\partial y} + p_z \frac{\partial f}{\partial z} \right) ...
5
votes
0
answers
373
views
What are good/best practices to take the Fourier transform of an InterpolatingFunction?
I have a function which I have obtained from numerical integration of a differential equation, and I would like to take its Fourier transform. What are good practices for doing this?
To make things ...
5
votes
0
answers
4k
views
NDSolve: methods and step size choosing
I am looking into the documentation of NDSolve[]; more precisely how this function chooses the StepSize and how it chooses which ...
4
votes
0
answers
85
views
Why am I losing photons in a window?
I'm trying to model a window.
For some distribution of light rays hitting the window, I'd like to determine the output angles, and the number of photons which are reflected or transmitted. I'd like ...
4
votes
0
answers
49
views
What are the valid options for the "ParametricCaching" option in ParametricNDSolve?
I am using ParametricNDSolve as part of the calculation of an objective function for an optimization, so I am trying to strike a balance between memory usage and ...
4
votes
0
answers
64
views
Cant find options which get NIntegrate[] to give an accurate answer
I'm trying to numerically evaluate an integral (specifically an integral of a function of an integral), and I cannot find a set of options for NIntegrate which ...
4
votes
0
answers
50
views
NDSolve`ProcessEquations inside Manipulate
NDSolve and NDSolve`ProcessEquations can handle equations with vectors on each side like this one:
...
4
votes
0
answers
151
views
DSolve, NDSolve with WhenEvent Give Incorrect Solution for Simple ODE
NDSolve Results
On the course of addressing question 181974, I encountered the following problem.
...
4
votes
0
answers
182
views
What Are the Changes in Working Precision in NIntegrate From Mathematica 10.2 to 11.3?
I have a simulation code I developed in Mathematica 10.2. I use Nintegrate to calculate some values. It works fine and each run takes about 170s.
However When I run it in my university's computer (...
4
votes
0
answers
153
views
Good Textbook on Boundary Integral Equation or Boundary Element Methods Using Mathematica
Is there a good textbook out there that treats Boundary Integral Equations or Boundary Element Methods Using Mathematica? I have scouted around a bit and could not find a good textbook that treats ...
4
votes
0
answers
376
views
How to perform multiple NIntegrate in an efficient way?
Consider the following function of 3 variables:
f[x_,y_,teta_] := Pflip[Sqrt[m^2 + x^2] Sqrt[M^2 + y^2] - 2 x y Cos[teta]]
where Pflip has been obtained by ...
4
votes
0
answers
529
views
Integrate function over a 2D implicit surface
I have the following problem. Let's say we have a 2D region, let me be very explicit:
...
4
votes
0
answers
869
views
Implementing the Numerov method for solving ODEs with NDSolve
I'd like to implement the Numerov scheme for solving an ODE (Scroedinger Eq time-independent) with NDSolve. I tried in analogy with the Runge Kutta example in the ...
4
votes
0
answers
323
views
Avoid Evaluation of Function at NDSolve
I have a huge "black-box" f function, which I want to integrate. Let's define it:
f[x_,y_,a_]:=a*Exp[-(a*10000)(x^3+y^3)]
as ...
4
votes
0
answers
262
views
What am I missing in this highly oscillatory integral?
I want to numerically integrate this equation (in python without calling Mathematica):
$\int_0^\infty {\rm d}k f(k) J_v(r k) J_n(s k)$
where $f(k)$ is a non-smooth function, $J_v$ are the Bessel ...
4
votes
0
answers
102
views
NIntegrate::ncvbr: How should we interpret and handle this error not mentioned in any documentation?
I have some user-defined module describing my integrand which has to be computed numerically (it's much more complicated than this but bear with me):
...
4
votes
0
answers
237
views
Nested NIntegrate of vector function
I am trying to perform a nested integration where the upper limit of the inner integral depends on the value of the outer integral, like in this question: Nested NIntegrate.
Just like the linked ...
4
votes
0
answers
434
views
How to specify the time variable for NDSolve
I recall that it is possible to specify which independent variable is the "time" variable in NDSolve, but I can't find it documented anywhere. Does anyone recall ...
3
votes
0
answers
69
views
Solve PDE with consraints
I am trying to solve the following problem of the free fall dynamics under gravity of a inextensible horizontal string attached at its end, in a 2D vertical plane. If I'm right, that is the governing ...
3
votes
0
answers
62
views
What's the best method to use when NIntegrating a sinx + cosx type function?
I'm having some problems when trying to NIntegrate a sinx + cosx type function. I have already tryed several combinations of ...
3
votes
0
answers
67
views
Solution to differential equation only starts at random times (numerical error?)
I am solving a set of differential equations with an oscillatory forcing (square wave). Instead of the solution starting to oscillate immediately it stays still until some time. That varies with small ...
3
votes
0
answers
96
views
ParametricNDSolveValue causes kernel to crash
In the course of answering question 228693, I found that
...
3
votes
0
answers
137
views
Discrepancy between the results of NIntegrate with different methods and options
I am trying to perform a numerical integration on a function defined through a sum of exponential terms. The summation is given by:
...
3
votes
0
answers
37
views
Integration $\int dx f(x,y)$ by replacing $\int dx f(x,\xi)$ for some transcendental number $\xi$
Sometimes when I'm doing a hard integral $\int dx f(x,y)$ where $y$ is a parameter, I replace $y$ with, say, the transcendental number $\zeta(\pi)$, Mathematica will evaluate it more easily, and I'll ...
3
votes
0
answers
150
views
BVP of coupled ODEs with unknown initial values
I want to solve the following 2nd order coupled ODEs:
$$
\begin{align}
f^{\prime \prime} (r) + \frac{2}{r} f^{\prime} (r) + f (r) g (r)^2 - f (r) + f (r)^3 - \frac{1}{5} f (r)^5 &= 0 \\
g^...
3
votes
0
answers
136
views
Unable to turn off error messages using Parallelize
I am running 11.1 and would like to run NIntegrate and turn off the error message NIntegrate::ncvb but when I run the integrations in parallel, they are not being turned off. For example, consider ...
3
votes
0
answers
117
views
Can this integral equation problem $\int_\Gamma \frac{e^{ik|x-y|}}{4\pi|x-y|}\varphi(y) \, \mathrm{d} y = u_{x_0}^{in}(x)$ be solved?
I am not sure if Mathematica is capable of solving integral equations in 2D/3D. I found this page in the documentation, but this is just for 1D.
The following is what I would like to solve, it can ...
3
votes
0
answers
514
views
How can I do a faster integration?
I have this part of my code, which takes forever to run. Does anybody know how to make it faster?
Using NIntegrate I face error:
"NIntegrate::eincr: The global error of the strategy GlobalAdaptive ...
3
votes
0
answers
458
views
System of coupled PDEs: “Repeated convergence test failure” error
I am trying to solve the following system of coupled PDEs but I am getting an error.
...
3
votes
0
answers
2k
views
How does Mathematica numerically integrate to infinity?
Suppose you have a function that can only be evaluated numerically. I.e., you call $f[x]$ with a particular value of $x$ and get a value after a brief amount of time, but there is no good way of ...
3
votes
0
answers
45
views
Determine the method that has been used for numerical solution of elliptical PDEs
I am using the following script to solve a system of PDEs:
...
3
votes
0
answers
100
views
Extract explicit region (integration bounds) from ImplicitRegion
Using an ImplicitRegion in NIntegrate by far best performance is obtained by using ...
3
votes
0
answers
147
views
Unexpected Behavior of Parametric Sensitivity in ParametricNDSolveValue
Bug introduced in 10.4 or earlier and continuing through 11.3
Submitted as CASE:3916971
While exploring alternative methods of solving 33538, I encountered difficulties with the parametric ...
3
votes
0
answers
175
views
Improve accuracy of NIntegrate with GlobalAdaptive over ImplicitRegion?
Let's say that I want to integrate some arbitrarily "nice" function (uniformly $C^{\infty}$-smooth, for example) over an ImplicitRegion in more than three dimensions. For example, let's consider the ...