Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
90 views

Convergence in NIntegrate

I wish to understand how to cope with the following error messages: ...
0
votes
0answers
88 views

How to solve boundary value problem with singularities at boundaries?

I have a boundary value problem, solving a system of differential equations with a singular boundary condtion (V[0] = 1/s, s->0) ...
2
votes
0answers
63 views

NIntegrate over statistical variables with parameter

Essentially, what I am trying to do is the following: Integrate a function which contains the parameter k ...
0
votes
1answer
149 views

NIntegrate with variable limit of integration [duplicate]

Hey guys Im working with this integral and I can´t get it right. ...
-1
votes
1answer
293 views

Follow up: how to plot a function under NDSolve domain

Here is the details of the code to plot. ...
2
votes
0answers
110 views

integration of a list of gaussian type orbitals (GTO)

I am currently trying to integrate various components of a current density (j={jx,jy,jz}) over space. The problem is that the current j is extracted from a quantum chemical computation and is a sum of ...
0
votes
2answers
77 views

Fit a polynomial/curve to an NIntegrate result

I want to NIntegrate a function which also contains some parameter. In the end, I would like to plot the result as a function of one of these parameters. The thing ...
2
votes
2answers
235 views

Attempting to use NDSolve to plot harmonic oscillator solutions

NDSolve[{ (-y''[r]/1880) + (470 (0.04077)^2 r^2 - 48 + 1/(1880 r^2)) y[r] == 0, y[0] = 0, y'[0] = 0}, y, {r, -4, 4}] I use this but get errors and am ...
5
votes
1answer
129 views

A 1D numerical integral Mathematica cannot compute, from physics

A well know result in theoretical physics is that a sum over Matsubara fermionic frequencies, i.e.: $$ S = \sum_{n=-\infty}^{\infty} h(\omega_n) \hspace{32pt} \omega_n=(2n+1)\frac{\pi}{\beta} $$ can ...
1
vote
2answers
138 views

Trapezoid Integration over a list of pairs [duplicate]

I have two very connected questions: Is there really no built-in function to integrate a list of pairs without converting to a function? Something like: ...
0
votes
2answers
182 views

Solving non-linear differential equation

For my research project I need to solve the following integral ...
1
vote
1answer
102 views

Problem with NIntegrate and FindFit [closed]

I fit the experimental curve with the model using the following equation, ...
1
vote
0answers
48 views

Problem with curve fit using integral [closed]

I need fitting a Langevin function on a experimental data, but one parameter must be firstly optimized by using a Lognormal distribution. The complete expression could be written as: The integrate ...
7
votes
2answers
235 views

How to locate the position of a periodic orbit

These are the equations of the dynamical system ...
1
vote
2answers
115 views

Can't NIntegrate my NDSolve results

I want to NIntegrate my NDSolve result. I don't have a exact function form because it is coming from the ...
2
votes
1answer
59 views

WhenEvent stops working after first instance

I'm modelling a very simple physical situation is which an object is rested on two moving fingers. Sometimes the object moves with one finger while sliding over the other, while at other critical ...
0
votes
0answers
51 views

NIntegrate within NMinimize - how to optimize the code?

How I can optimize these numerical calculations? Most annoying is encountering instabilities (numerical errors). I have a predefined function: ...
3
votes
2answers
108 views

Numerical integration of oscillatory function

I am trying to evaluate the following oscillatory integration numerically but the answers are wrong or not accurate enough. I don't know what the problem is. ...
7
votes
2answers
273 views

NIntegrate fails to converge under almost any PrecisionGoal, MinRecursion etc. How can I trust the result?

I have been getting some ideas by reading other related questions in the forum, but the integral I have to do is not converging in many cases. The integrand is of the form: ...
2
votes
2answers
97 views

numerical integration of equation obtained by ParametricNDSolve

I am trying to find a definite integral of the solution obtained using ParametricNDSolve (i.e. y[x,a,b]) from 0 to 1 and plot ...
16
votes
1answer
1k 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 ...
1
vote
0answers
60 views

Continuous integration of a tensor function using discrete density values

Hei, I am wondering is it possible to implement continuous integration using Integrate() of a fourth order tensor with discrete density values. ...
5
votes
4answers
253 views

error with NIntegrate and RegionPlot

Bug introduced in 10.2 or earlier and persisting through 10.2 or later Here's a simplified example of what I'm trying to do: ...
3
votes
1answer
226 views

Backward in time numerical integration with fixed time step

Consider simple use of NDSolve[] function used to solve an ODE backward in time ...
5
votes
3answers
137 views

Differentiate a numerically defined function

My function is f[a_, b_] := NIntegrate[Sqrt[(Cos[t] - a)^2 + b^2], {t, 0, Pi}] I want to calculate g[1,1] where ...
1
vote
1answer
55 views

NIntegrate option for FourierSeries

I would like to use FourierSeries but it is very slow. My guess is that it is because it uses symbolic integration: ...
1
vote
2answers
141 views

How to determine the parameter in a differential equation with some fixed solution

Assuming that I have a ODE system with undetermined parameter $$x''(t) == y(t) x(t)$$ $$y'(t) == 2 - a x(t)$$ and I have some fixed solution condition $$x(0)=0$$ $$x(10)=8$$ $$y(10)=3.5$$ Is there ...
1
vote
2answers
187 views

How do I exclude regions from numeric integration on Mathematica?

The part of the equation that is giving me trouble is below: f[t_,v_]:= Exp[-(1/Log[1-t/v]^2)]*(v-t) I need to integrate this function over the ranges .1 <...
3
votes
0answers
126 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. ...
5
votes
2answers
162 views

Why am I getting different answers for an integral depending on method?

I'm trying to carry out an integral and I'm finding different answers depending on which method I choose to integrate with. I assume this has something to do with divergent pieces but I don't ...
3
votes
2answers
165 views

Maximizing a function defined using NIntegrate [duplicate]

I have two functions fn[x,y,z] which is in integral form and I have another function gn[x,y] which is also in integral form ...
7
votes
2answers
255 views

How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
10
votes
1answer
96 views

How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated ...
2
votes
1answer
100 views

Three Dimensional Plot of Numerical Integral with Delta Function

I want to plot the definite integral of the following function ...
0
votes
1answer
84 views

Integrate works but NIntegrate doesn't

I have a complicated integral function that I'm trying to evaluate, which will have to be done numerically. I wanted to try a simpler one first, one that has an analytic form, because I could check ...
4
votes
2answers
209 views

How to speed up a high dimensional numerical integration of Gaussian-form integrand [duplicate]

My integral has the following form: $$\int \sin(\theta) d\theta d\phi\left| \int d^3p_1 d^3p_2d^3p_3 \frac{f(p,\theta,\phi)}{g(p,\theta,\phi)}e^{-\frac{1}{2}(p^\mathrm{T} .A.p)}\right |^2,$$ where $p=...
1
vote
0answers
64 views

Plotting roots for a singular numerically-only integrable equation [closed]

In my problem I need to plot roots with respect to a parameter. But the condition for root is det(Function)=0. This function cannot be solved symbolically. So I need to put in a parameter value and ...
2
votes
3answers
169 views

slwcon and eincr in integrating multivariate Gaussian random variables

Why is the following integration involving multivariate Gaussian distribution so slow and generating an error? Is there a better integration strategy? All that I'm doing is considering $(X_1,X_2,X_3,...
0
votes
1answer
80 views
4
votes
2answers
277 views

Postprocessing of CFD results in Mathematica

I was trying to perform computational fluid dynamics (CFD) post-processing in Mathematica after solving primitive variables from Navier-Stokes equation, mainly $(u,v)$, $(Px,Py)$. Since I am not an ...
4
votes
3answers
637 views

Nonlinear differential equation: numerical solution

I have to find and plot a numerical solution for this second order differential equation: u''[x] + (u'[x]/x) - (u[x]/(x^2)) + u[x] - u[x]^3 = 0 where $0\leq x &...
0
votes
0answers
44 views

Evaluation stops, no error

I'm trying to iterate NIntegrate using Table so that I can plot the result as a function of an external angle. It's an oscillatory function so it gives some error on the estimate for the value, but ...
11
votes
1answer
453 views

Nintegrate has memory leak

Bug introduced in 6.0 and fixed in 10.2.0 NIntegrates uses memory and does not release it. For long loops with NIntegrate ...
0
votes
1answer
96 views

NIntegrate and memory use [duplicate]

I wonder why NIntegrate uses memory. I have a long integral computation repeated thousands times. The memory use then goes up and speed goes down. I think I spot a ...
2
votes
0answers
97 views

Nasty integral advice

I have a pretty ferocious integral to solve, and since it doesn't seem I'll be able to do much analytically, I've taken to Mathematica to get some information. Mainly, I want to see if there are any ...
4
votes
1answer
115 views

Does not evaluate the Integral and a plane plot

I am trying to compute a ContourPlot and a VectorPlot using the following functions: ...
-2
votes
1answer
136 views

Plot the result of NIntegrate for different parameter values

I want to plot the result of a numerical integration containing a parameter in terms of the parameter. The code is: ...
0
votes
0answers
56 views

Is there a IsDefinedQ function? [duplicate]

I have a function which is a bit expensive to calculate. I want to translate and integrate. I want to translate by values on a grid, store the values of the integral and refine the grid. That is, I ...
0
votes
0answers
64 views

What am I missing in this integration?

Trying to solve diff.eq.has led me to: ...
2
votes
0answers
285 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 ...