Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

363 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
258 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
337 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, ...
7
votes
0answers
102 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 ...
7
votes
0answers
364 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.: ...
7
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 ...
7
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(...
6
votes
0answers
68 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
156 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
62 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
687 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
167 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
817 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
516 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) ...
4
votes
0answers
38 views

NDSolve`ProcessEquations inside Manipulate

NDSolve and NDSolve`ProcessEquations can handle equations with vectors on each side like this one: ...
4
votes
0answers
123 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
162 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
138 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
224 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
269 views

N[Integrate] failing to return an accurate result from an interpolated integrand

I need to N[Integrate] a function Cos[alpha*x]*f(x) between x=0 and 30 at increasing alpha-values. Here f(x) is an interpolated function derived from a set of 120 ...
4
votes
0answers
441 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
196 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
232 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
95 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
214 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
351 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 ...
4
votes
0answers
277 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 ...
4
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 ...
3
votes
0answers
121 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
208 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
252 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
43 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
80 views

Extract explicit region (integration bounds) from ImplicitRegion

Using an ImplicitRegion in NIntegrate by far best performance is obtained by using ...
3
votes
0answers
132 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
109 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
170 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
62 views

“ParallelDo” does not calculate the function well

Now, I'm solving utility maximization problem. ...
3
votes
0answers
83 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 ...
3
votes
0answers
92 views

How can one achieve the most accurate estimates of certain six-dimensional integrals under specific constraints?

I have three positivity constraints (f1, f2, f3): ...
3
votes
0answers
83 views

Integrate gives wrong result?

Computing the integral of the Euclidian distance of two points in a plane, Mathematica seems to give a wrong result. This is a simple integral that should not be tricky and can easily be computed by ...
3
votes
0answers
164 views

Help on using NIntegrate Method -> {Automatic, “SymbolicProcessing” -> 0}

I'm trying to take an integral of a super oscillatory function as follows. It takes a long time to solve it with the NIntegrate so I added the option ...
3
votes
0answers
588 views

Integration error from Plot3D

I am trying to visualize diffusion distribution from an equilateral triangle with 45 degrees. Assuming that diffusion is a Gaussian with sigma=1 this should do: <...
3
votes
0answers
664 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 ...
3
votes
0answers
268 views

NSolve doesn't work on an equation containing a numerical integral and constraints

I'm having trouble getting Mathematica to solve equations numerically. I know that its important to specify the type of variables for pattern testing (see e.g. here) but this doesn't seem to work. ...
3
votes
0answers
705 views

NDSolve fixed step problem

Working example here: Drive folder (have both files in the same directory! Notice: the line <<variables' in the file seems to throw an error for me, but ...
3
votes
0answers
438 views

Function with a sharp resonance which Mathematica fails to integrate. Why?

I'm a new user of Mathematica and I'm trying to use it to calculate the collisional cross-section as a function of energy for a given potential and decay rate. I know that the resulting function ...
3
votes
0answers
623 views

Global vs local adaptive integration: lattice propagator

I was doing the first exercise in the paper Lattice QCD for Novices. This is the expected result: With the default "GlobalAdaptive" method for NIntegrate it threw errors saying that the error had ...
3
votes
0answers
127 views

ParametricNDSolve and ProcessEquations

I have a question regarding NDSolve`ProcessEquations and ParametricNDSolve. When using the regular NDSolve we have the option to divide the integration into the three steps ProcessEquations, Iterate ...
3
votes
0answers
234 views

Whether NIntegrate evaluation is multithreaded or not?

About MultiThread evaluation I am talking about here, see this post I am NIntegrate the function grarm[e, 3, dimension, 1, 1, 0.005]. There is matrix operation in ...
3
votes
0answers
620 views

Numerically solving PDE with high precision

I want to numerically solve the PDE $\partial_t u(t,x)=c\partial_x u(t,x)+(mx-l)u(t,x)$ with some initial and boundary conditions and given parameters $c$, $m$ and $l$. Consider the code ...

1 2 3 4 5 8