Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
108 views

Changing ParametricNDSolveValue options for only part of the run

Here is an example of the system that I am running, ...
1
vote
1answer
253 views

Simpson's rule with ListConvolve or ListCorrelate

I have a function that's represented as a long list of values that I want to integrate. I can do it procedurally with Simpson's rule. ListConvolve generally runs faster then procedural code, so i ...
1
vote
1answer
203 views

NIntegrate converging too slowly when increasing size of array

I have a problem with a numerical integration. I have a 4x4x4x4 array that has for each entry an integral and I want to use NIntegrate to evaluate it. It gives me ...
1
vote
1answer
200 views

Which integration strategy to use for this product of polynomials?

What would be the ideal integration strategy for a function like this: $$f(x_1,x_2,\dots,x_N)=\prod_{i=1}^Nx_i^{c_i}\Theta(x_i-p_i)$$ where $x_i,p_i\in \mathbb{R}$, $\Theta$ is the Heaviside function ...
1
vote
1answer
205 views

What do these error messages mean when numerically solving differential equations?

I am using Mathematica to numercially solve the following equations: ...
1
vote
1answer
260 views

Table not working with Plot

Because NIntegrate[] does not support parallel computation out of the box, I'm doing a simplified version by breaking the integration limit into pieces and using ...
1
vote
0answers
51 views

Interpolating function into an actual function

I numerically solved an integral equation and the result is an InterpolatingFunction. I plotted it to see how the function behaves but I also need an actual ...
1
vote
0answers
38 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) ...
1
vote
0answers
57 views

Numerically solving a 2D oscillating integral

I'm having trouble solving this integral numerically: ...
1
vote
0answers
27 views

Nested NIntegrate of vector function

I am performing a nested integration where the upper limit of the inner integral depends on the value of the outer integral, like in the question [Nested NIntegrate]. As in this question my function ...
1
vote
0answers
86 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 ...
1
vote
0answers
71 views

Speeding up the numerical integration of a certain function

I'm using the following function f[t_] := 3/4 t^-3 NIntegrate[(x^4*Csch[x/2]^2), {x, 0, t}, Method -> {Automatic, "SymbolicProcessing" -> 0}]; I ...
1
vote
0answers
75 views

NIntegrate (multi-dimensional integral)

I am interested in the numerical evaluation of the following integral: $\int \prod_{i=1}^n dx_i \delta(\sum_{i=1}^n x_i) \prod_{i=1}^n f_i(x_i)$ where $f(x)$ is a complicated function. Unfortunately ...
1
vote
0answers
62 views

Speeding Up NIntegrate and ?NumericQ

I have attached below a piece of code that has been running successfully but takes extremely long for mathematica to compute. I believe it is the last "rms" calculation and the fact that I am using ...
1
vote
0answers
52 views

Multidimensional Numerical Integral with Singular Behavior [closed]

I'm trying to numerically integrate a multidimensional integral where there is singular behavior when x = y. This is the integral ...
1
vote
0answers
41 views

Optimising code for nested integrals

See below for some code I wrote to model a non-homogenous poisson process. The code generates the correct results but takes a long time due to the number of nested integrations. I have tried reducing ...
1
vote
0answers
56 views

An example of how to compute numerically the KL-divergence in mathematica [closed]

I wanted to compute an exact number for two probabilities that I am comparing. These are two normal distributions as: $$Normal(\mu = 5, \sigma = 4)$$ $$Normal(\mu = 5, \sigma = 5)$$ I decided to ...
1
vote
0answers
47 views

How to find out how Mathematica performed an integration? [duplicate]

In terms of integration, I usually utilize Mathematica 9 to compute scattering amplitudes in quantum field theory. Recently, I employed it to compute a particularly difficult integral, and it ...
1
vote
0answers
103 views

Monte Carlo integration with random numbers generated from a Gaussian distribution

I want to do numerical integration of some functions using the Monte Carlo method. The default setting for the Monte Carlo method is to use a uniform distribution as far as I know. How can I change ...
1
vote
1answer
107 views

How to calculate the following integral of the multiplication of two Bessel functions?

This integration has an analytical solution and its behavior is described by 1/r^2 function, but Mathematica gives some weird oscillating answer. Can anybody explain this and help me overcome this ...
1
vote
0answers
62 views

Mathematica exit when calling plot. Bug?

I'm currently studing the behaviour of some integral for which I cant find an analytic solution. As this function depend on a vector on the unit sphere, I first defined it with 3 parameters before ...
1
vote
0answers
32 views

Integration of any interpolation generates invalid comparison errors [duplicate]

Integrating a simple interpolated function as follows generates invalid comparison errors. ...
1
vote
0answers
96 views

Choosing PrecissionGoal and AccuracyGoal for decomposed integral with NIntegrate

Assume I have a complicated integral $I$ which can feature all kinds of difficulties like infinite interval, rapidly oscillatory integrand, integrable singularities and numerically almost singular ...
1
vote
0answers
47 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 ...
1
vote
0answers
229 views

Differential equations: How do I solve a delay differential equation with 0-1 variables

How do I solve the following non-linear, delay-differential equations using Mathematica under the assumptions $$p(t) = 1 ,\; y(t) > k$$ $$p(t) = 0,\; y(t)<= \ k$$. $$ \frac{dw}{dt} = ...
1
vote
1answer
70 views

Two dimensional NIntegration failure - non-numerical values

I've got this function: E0[x0_, y0_, z_]:= A/w[z]*Exp[-(x0^2 + y0^2)/(w[z]*w[z])]*Exp[(I*2*Pi*(x0^2 + y0^2))/(λ*2*R[z])]*Exp[I*ϕ[z]]; Where the ...
1
vote
0answers
91 views

NIntegrate doesn't work

I have a function, Dx[s] (defined in a module) which I can plot: Plot[Dx[s], {s, 0, GetLatticeLength[]}] However if I try ...
1
vote
0answers
168 views

Jumps in NDSolve results

I need to compute using NDSolve routine, some function $F(x)$, having two possible values $F_1(x)$ and $F_2(x)$ depending on whether the argument exceeds some ...
1
vote
0answers
90 views

why maxrecursion didn't work if I specify singularity in NIntegrate

I study sigularity specification and MaxRecursion in NIntegrate. And find something unusual. first I define a function δ[x_, y_: 1/100] := 1/π*y/(x^2 + y^2) ...
1
vote
0answers
75 views

Integrate boundaries defined as equations

Have you guys ever needed to define Integrate boundaries as equations? I tried to submit the equation as was written in original text but it seems that mathematica can't understand it. ...
1
vote
0answers
377 views

triple NIntegrate fails

Here's m problem simpler in terms of codes ...
1
vote
0answers
225 views

Why is a bump function making NDSolve take forever to solve?

I am attempting to solve a system of relatively complicated elliptic PDEs via a relaxation technique. In particular, I am trying to solve $\textrm{div} LW = S$ where $S$ is some vector and $L$ is the ...
1
vote
0answers
284 views

Cauchy principal value integral of a list of numbers. How?

I have a list of numbers that are numerical samples of a function for which I need to find the Cauchy principal value integral. I thought I should be able to combine Interpolation with Integrate to do ...
1
vote
0answers
708 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 ...
1
vote
1answer
380 views

NDSolve diffusion equation over/underdetermined

I have a feeling the solution to my problem is very simple… but my knowledge of differential equations is pretty weak. I am trying to solve a scalar diffusion equation (used in NMR spectroscopy, but ...
1
vote
0answers
254 views

Adapting NDSolve to circumvent NDSolve::bdord: error for 1-D Euler Equations

I attempted to use NDSolve for the 1-D isentropic unsteady flow equations with low subsonic inflow velocity and prescribed inflow total enthalpy; along with a ...
1
vote
0answers
429 views

How can I speed up numerical integration of multidimensional integral?

I am numerically solving an integral equation that contains a double integral. I have managed to get a solution but it takes forever. I am wondering if there is a way to speed up numerical integration ...
1
vote
0answers
594 views

Speed up Numerical Integration

EDIT: I need to evaluate a very complicated multi-dimensional Integral. The dimension of the Integral depends on a variable j. Let's make my point clear with the ...
1
vote
0answers
282 views

NDSolve Convergence test failure and significant effect of DifferenceOrder on eventual results

I am solving a non linear partial differential equation with what I call free boundary conditions (solid mechanicists would know this as simply supported). I realized that this boundary condition ...
0
votes
1answer
461 views

NDSolve does not give me the expected solution

I have an assignment where I need to compute chemical reactions by solving ODEs. I use NDSolve to do this. However, for one problem it does not give me the ...
0
votes
1answer
57 views

How to get correct numerical integration which should be zero? [duplicate]

I want to numerically integrate function berrycur over kx and ky. The definition of berrycur is given at the end of the ...
0
votes
2answers
149 views

Problems with NIntegrate

I'm having trouble to do the following numerical integrations: ...
0
votes
2answers
627 views

Plotting multivariable integration

If I have a multivariable integration like NIntegrate[x^2 + y^2, {x, 1, 5}, {y, 6, 10}] But I need to plot its result in terms of ...
0
votes
1answer
334 views

NIntegrate Error-Estimate Question

When I do some complicated 4-dimensional integral numerically, Mathematica tells me its estimate for the value of the integral, and its estimate for the value of the error in the calculation. The ...
0
votes
1answer
120 views

Differential Equation help

I have a differential equation that looks like this: ...
0
votes
3answers
108 views

How to display the value of a very small number instead of “0.” [duplicate]

I need to perform an integration. There is one particular value, which may be very small that is showing up as 0.. Is there any command in Mathematica 9 that will ...
0
votes
1answer
136 views

Zooming into Parametric Animation Plot that Uses InterpolatingFunctions

I have an interplanetary trajectory solver that calculates a spacecraft route from Earth to Mars, and I am trying to zoom into the spacecraft when it reaches its Mars intercept orbit but am having ...
0
votes
1answer
71 views

NDSolve accuracy related problem

I want to solve this equation: ...
0
votes
2answers
133 views

How to numerically integrate this integral?

I want to integrate the function funcin (spherical coordinates). ...
0
votes
1answer
286 views

What is the correct way to use NIntegrate inside the FindMinimum function?

I'm having minor issues with the FindMinimum function when using NIntegrate inside. The functions work perfectly well but I get ...