Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

527 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
470 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
0answers
430 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
0answers
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
0answers
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
0answers
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
0answers
385 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
0answers
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
0answers
109 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
0answers
134 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
0answers
53 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
0answers
124 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
0answers
172 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
0answers
66 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
0answers
927 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
0answers
185 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
0answers
963 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
0answers
530 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
0answers
352 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
0answers
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
0answers
42 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
0answers
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
0answers
48 views

NDSolve`ProcessEquations inside Manipulate

NDSolve and NDSolve`ProcessEquations can handle equations with vectors on each side like this one: ...
4
votes
0answers
148 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
0answers
180 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
0answers
151 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
0answers
355 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
0answers
509 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
0answers
852 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
0answers
303 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
0answers
260 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
0answers
101 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
0answers
232 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
0answers
419 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
0answers
63 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
0answers
91 views

ParametricNDSolveValue causes kernel to crash

In the course of answering question 228693, I found that ...
3
votes
0answers
133 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
0answers
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
0answers
145 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
0answers
115 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
0answers
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
0answers
464 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
0answers
441 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
0answers
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
0answers
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
0answers
97 views

Extract explicit region (integration bounds) from ImplicitRegion

Using an ImplicitRegion in NIntegrate by far best performance is obtained by using ...
3
votes
0answers
146 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
0answers
160 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 ...
3
votes
0answers
172 views

worst performance in numerical integration in ver. 11.1

I would like to know if anyone of you have experienced slow down performance in numerical integration. I have tested this code in ver. 11 and ver. 11.1: ...
3
votes
0answers
67 views

"ParallelDo" does not calculate the function well

Now, I'm solving utility maximization problem. ...
3
votes
0answers
118 views

Building integrators and how they compare across platforms

I'm interested in building some numerical integrators. Specifically symplectic integrators. Now, my Mathematica has been coming along, day by day, slowly but surely. Still not at a stage where I can ...

1
2 3 4 5
11