Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
1answer
97 views

How to make the plot smooth

There are some stranges point which cause the figure isn't smooth. I think that the reason is the method of numericial integration. Here is my code, it's pleasure that one can revise the drawbacks in ...
9
votes
1answer
45 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 ...
1
vote
2answers
97 views

Numerical integration of modified bessel function

I need to compute the following integral: NIntegrate[ BesselI[-nu, k x]/x ,{x, r1, r}] in which nu=-(2m-1)/2 and I have to ...
2
votes
1answer
59 views

Three Dimensional Plot of Numerical Integral with Delta Function

I want to plot the definite integral of the following function ...
3
votes
0answers
51 views

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

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 ...
0
votes
1answer
68 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 ...
1
vote
0answers
43 views

Plotting roots for a singular numerically-only integrable equation

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
95 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 ...
2
votes
0answers
90 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
2answers
124 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 ...
0
votes
1answer
41 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 ...
9
votes
1answer
385 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 ...
8
votes
1answer
179 views

SymplecticPartitionedRungeKutta shows strange error

Bug introduced in 9.0 or earlier and persisting through 10.2 or later I tried to solve Hamiltonian system ($Q$ is a vector of all generalized coordinates, $P$ - of generalized momentum) $$ ...
0
votes
0answers
31 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 ...
1
vote
0answers
176 views

Numerically solving a 2D oscillating integral [closed]

I'm having trouble solving this integral numerically: ...
0
votes
2answers
125 views

NDSolve issue with initial and boundary conditions

While solving the heat equation in one spatial variable $u_t = u_{xx} $ (x goes from 0 to L) with the initial temperature distribution $T_0 \frac{x(L-x)}{L^2}$ , and with neumann boundary conditions ...
3
votes
1answer
109 views

Strange integration

Bug introduced in 9.0 or earlier and fixed in 10.1 Note: Beginning with V10.1, this integral returns unevaluated but without error messages. I tried to evaluate this line ...
4
votes
1answer
98 views

Does not evaluate the Integral and a plane plot

I am trying to compute a ContourPlot and a VectorPlot using the following functions: ...
5
votes
2answers
444 views

NDSolve: ProcessEquations and Reinitialize with Piecewise functions

I am having trouble with using NDSolve`Reinitialize when the system consists of a piecewise function. If we define the ODE system ...
10
votes
3answers
621 views

Only final result from NDSolve

Finally, I started to play with differential equations in Mathematica. And I have faced the problem, which seems to me so basic that I'm afraid this question is going to be closed soon. However, ...
8
votes
1answer
155 views

Using a Mathematica index as a DiscreteVariable in NDSolve when solving a coupled set of ordinary differential equations

Context Since the explanation below of the problem to be solved is lengthy, let me preamble this by saying that I have code that works to solve the problem, but I don't know whether (1) it's ...
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 ...
8
votes
0answers
2k views

Integro-differential equation [closed]

I have to numerically solve a nonlinear partial integro-differential equation using Mathematica. This is my equation, $$\frac{\partial y(x,t)}{\partial t}=\int_{-\infty}^\infty K_0(|x-u|) ...
-2
votes
1answer
40 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: ...
2
votes
1answer
202 views

How can I invoke the solution of NDSolve to determine a parameter in my equation just inside NDSlove?

I am trying to solve a differential equation by NDSlove for $h(x,t)$. It reads $$h_t=h_{xx}-V_h-\lambda(t)$$ where $V_h$ is a given function of $h(x,t)$ denoted by ...
0
votes
1answer
154 views

How to do multiple integral numerically?

I cannot calculate the following type of integrals numerically : $\int_0^1 dy \int_0^y f(x) dx $ $f(x)$ can be a complicated function. The problem is due to the fact that the upper limit of one of ...
8
votes
1answer
596 views

Numerical contour integrations in the complex plane - contour deformation gives different answer for analytic kernel

I am trying to do a contour integration in Mathematica numerically. In particular, I'm checking the identity: $$ H_m^{(1)}(z) =\frac{i^{-m}}{\pi}\int_{-\pi/2 + i \infty}^{\pi/2 - i \infty} \exp[i m ...
0
votes
0answers
54 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 ...
4
votes
1answer
495 views

Multi-dimensional integral in the complex plane with poles and essential singularity

I've passed the last week searching a way to numerically integrate this multi-dimensional integral in the complex plane at the poles and avoiding the singularity at z=0: $$ \oint_{C}\oint_{C\ auound\ ...
0
votes
0answers
62 views
0
votes
0answers
37 views

How to solve algebra equations containing integration and parameters?

I'm trying to solve two nonlinear algebra equations for two unknown parameters, U and Tf. Since some terms in these equations contain integration, and the integration also contains U and Tf. The main ...
1
vote
2answers
215 views

Plotting a parametric function containing an integral [closed]

I need to plot this expression $$ \phi(s; H,B)=\left(\int_{0}^{s}\frac{1+B\ \sin2H\ t}{\sqrt{1+B^2+2B\sin2H\ t}} \text{d} t,\ \frac{1}{2H}\sqrt{1+B^2+2B\sin2H\ s}\right)$$ for $H=0.5$, $B=0, 0.5, 1, ...
0
votes
1answer
119 views

Existence of an analytical form for integral

Can the following integration be performed with an analytical output? ...
4
votes
1answer
192 views

How to do this complex integration on the real line?

$m, r$ are parameters in the following integral: Integrate[z Exp[I z r]/Sqrt[z^2 + m^2], {z, -∞, ∞}] How to do this integration directly? The result should be ...
2
votes
1answer
164 views
0
votes
0answers
191 views

A power series expansion

Consider the function, $f(z) = z tanh(\pi z) log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ and ...
20
votes
2answers
1k views

Why does Mathematica give the wrong answer when integrating?

Bug introduced in 8.0 or earlier and fixed in 9.0.0 I integrate Integrate[Exp[I Cos[b - c]] Cos[b], {b, 0, 2 Pi}] Mathematica gives: ...
2
votes
0answers
40 views

NDSolve with NIntegrate [duplicate]

I'm new to Mathematica and I'm trying to use it to solve some equation like: NDSolve[x'[t]+NIntegrate[x[tau],{tau,0,t}]==20,x,{t,0,10}] But it keeps giving me ...
1
vote
1answer
47 views

Matrix issue with NDSolve

I am solving a differential matrix equation with NDSolve. ...
2
votes
1answer
215 views

Catastrophic loss of precision

I am trying to solve a double integral in the range of 0 to Infinity (for both the integrals) and Mathematica is giving me the following error: Catastrophic loss of precision in the global error ...
5
votes
1answer
70 views

Spurious infinite limit of integration message in NIntegrate

Bug introduced in 7.0 and persisting through 10.2 NIntegrate returns an error complaining that ComplexInfinity is an invalid ...
0
votes
3answers
1k 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 ...
15
votes
1answer
419 views

Why does LogLinearPlot sample its argument outside the specified domain?

Bug introduced in 6.0 and fixed in 9.0.0 I experience a weird bug in the function LogLinearPlot. If the input is an interpolation function, such as the one ...
5
votes
1answer
76 views

In a PDE solution let us integrate out one of two coordinates

Here is a trapezoid within which I am solving a simple Laplace equation with the Dirichlet boundary conditions set at its top and bottom: ...
0
votes
0answers
79 views

NIntegrate Polynomial of high degree

I want to integrate a polynomial of degree 100 and higher over a domain that is the intersection of two balls like ...
0
votes
1answer
54 views

More issues Integrate, NIntegrate, FindRoot

I'm trying to solve a system of 3 non-linear equations using FindRoot and Integrate. If I start FindRoot[] close to the right answer, it works well but returns a bunch of error messages first. ...
12
votes
1answer
703 views

Numerically solve 2nd order differential equation with singularity

Consider a second order differential equation with a potential that diverges at some generic value in the variable. For example: $$-y^{\prime\prime}(s)+\frac1{\mathrm{cn}{(s\mid k^2)}}y(s)=0$$ where ...