Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

626 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 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 ...
John's user avatar
  • 273
9 votes
0 answers
762 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 ...
Matthew Brunetti's user avatar
9 votes
0 answers
494 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, ...
bbgodfrey's user avatar
  • 61.3k
8 votes
0 answers
128 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 ...
Meni Rosenfeld's user avatar
7 votes
0 answers
402 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.: ...
Ricardo Buring's user avatar
6 votes
0 answers
130 views

ParametricNDSolveValue causes kernel to crash

Bug introduced in 12.1.1 and persisting through 13.2.0. In the course of answering question 228693, I found that ...
bbgodfrey's user avatar
  • 61.3k
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-...
ben18785's user avatar
  • 3,167
6 votes
0 answers
157 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 ...
Markus Roellig's user avatar
6 votes
0 answers
445 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 ...
Emilio Pisanty's user avatar
6 votes
0 answers
138 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 ...
wdg's user avatar
  • 1,189
5 votes
0 answers
59 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 ...
Michael Seifert's user avatar
5 votes
0 answers
149 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 = ...
Emilio Pisanty's user avatar
5 votes
0 answers
134 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 ...
bambi's user avatar
  • 213
5 votes
0 answers
189 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 ...
K.T.'s user avatar
  • 151
5 votes
0 answers
70 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 ...
Arturo don Juan's user avatar
5 votes
0 answers
1k 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 ...
Branka's user avatar
  • 51
5 votes
0 answers
206 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}^...
Patch's user avatar
  • 201
5 votes
0 answers
550 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) ...
user29165's user avatar
  • 565
5 votes
0 answers
5k 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 ...
Sos's user avatar
  • 2,168
4 votes
1 answer
84 views

NIntegrate returns TerminatedEvaluation["RecursionLimit"] when called in another function

I try to perform some numerical integration with high precision on version In[1]:= $Version Out[1]= "13.3.1 for Linux x86 (64-bit) (July 24, 2023)" Here ...
SimonM's user avatar
  • 41
4 votes
0 answers
92 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 ...
Tomi's user avatar
  • 4,366
4 votes
0 answers
66 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 ...
ComptonScattering's user avatar
4 votes
0 answers
58 views

NDSolve`ProcessEquations inside Manipulate

NDSolve and NDSolve`ProcessEquations can handle equations with vectors on each side like this one: ...
Michael E2's user avatar
  • 234k
4 votes
0 answers
282 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 ...
Dominic's user avatar
  • 2,904
4 votes
0 answers
665 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 ...
Delaram Nematollahi's user avatar
4 votes
0 answers
159 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. ...
bbgodfrey's user avatar
  • 61.3k
4 votes
0 answers
555 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. ...
acalore88's user avatar
4 votes
0 answers
187 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 (...
diegoturenne's user avatar
4 votes
0 answers
937 views

Wormhole embedding diagrams

I am trying to reproduce the embedding diagrams for the evolution of a Schwarzschild wormhole described in this paper. Following the paper notation, we denote the Kruskal coordinates by $(v,u)$. For a ...
ASM's user avatar
  • 41
4 votes
0 answers
166 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 ...
D. Andrew's user avatar
  • 423
4 votes
0 answers
467 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 ...
Elsa's user avatar
  • 61
4 votes
0 answers
963 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 ...
jset's user avatar
  • 41
4 votes
0 answers
392 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 ...
gurluk's user avatar
  • 475
4 votes
0 answers
271 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 ...
Jorge's user avatar
  • 141
4 votes
0 answers
103 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): ...
induvidyul's user avatar
4 votes
0 answers
249 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 ...
David Creech's user avatar
  • 1,108
4 votes
0 answers
492 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 ...
Rico Picone's user avatar
3 votes
0 answers
218 views

How to solve the following integrodifferential equation by generic approach?

Consider the following equation: $$ \frac{\partial f}{\partial t} - p H(t)\frac{\partial f}{\partial p} = \mathcal{I}[p,t], \tag 1 $$ Here, f = f[p,t], with p being ...
John Taylor's user avatar
  • 5,387
3 votes
0 answers
96 views

Area / NIntegrate over a Region fails depending on variable name

I'm trying to plot how the Area of an ImplicitRegion defined by four (ugly) inequalities depends on parameters. It seems I need ...
Chris K's user avatar
  • 20.1k
3 votes
0 answers
156 views

Problem with a DAE and DiscreteVariables (II)

I continue with a DAE problem similar to another one posted here some days ago. @bbgodfrey offered a solution for the DiscreteVariables problem but now I have a ...
art's user avatar
  • 155
3 votes
1 answer
305 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 ...
Artem Alexandrov's user avatar
3 votes
0 answers
65 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 ...
Caroline Sodré's user avatar
3 votes
0 answers
78 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 ...
Tomás Alvim's user avatar
3 votes
0 answers
152 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: ...
SaMaSo's user avatar
  • 231
3 votes
0 answers
39 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 ...
Dwagg's user avatar
  • 183
3 votes
0 answers
174 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^...
boo_takagi's user avatar
3 votes
0 answers
123 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 ...
ManUtdBloke's user avatar
3 votes
0 answers
4k 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 ...
Daniel's user avatar
  • 499
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: ...
Mikhail Genkin's user avatar
3 votes
0 answers
114 views

Extract explicit region (integration bounds) from ImplicitRegion

Using an ImplicitRegion in NIntegrate by far best performance is obtained by using ...
NicolasW's user avatar
  • 393

1
2 3 4 5
13