Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

3
votes
1answer
173 views

Numerically integrate a plotted function

I used Plot[NIntegrate[...]...] to plot a function of 5 different variables. It took really long. Right now I need to integrate this function one more time over the ...
0
votes
0answers
16 views

Integration with IntervalMemberQ

I define an interval and its associated index function. ...
1
vote
0answers
68 views

Compiled function and integration

I'm using the recursive functions defined here: MyFnc and myFncC (compiled version). I want to call this functions in the ...
0
votes
2answers
65 views
0
votes
0answers
47 views

Combining two NDsolves results in “The search has encountered a complex value…” and no solution

So far I used to seperate NDsolves to solve a system of coupled differential equations, where the first NDsolve yields the Boundary conditions for the second NDsolve ...
0
votes
0answers
38 views

Recursions where one definition depends on another. How to Block or have local variables?

I have been using Mathematica to solve a second order differential equation using the second order Verlet method. My code looks like: ...
0
votes
0answers
30 views

Mathematica AdaptiveQuasiMontecarlo and AdaptiveMontecarlo yield very different results

I'm trying to perform a numerica integral in 5 dimensions. The integral is quite bad behaved, especially in 3 of them, where the integration regions would be [1, infinity]x[0,infinity]x[1,2] but most ...
1
vote
1answer
108 views

Meniscus outside of a cylinder - axisymmetric Young-Laplace equation in semi-infinite domain

How to solve the axisymmetric Young-Laplace equation $$\frac{z'(r)}{r \sqrt{z'(r)^2+1}}+\frac{z''(r)}{\left(z'(r)^2+1\right)^{3/2}}=z(r)$$ with b.c.s $$z'(1)=-2$$$$z'(\infty)=0$$ where $z=Z/l_c$ ...
6
votes
2answers
299 views

An integral with a fractional part in 3 dimensions

The evaluation with Maple suggests the triple integral is around $1$, but Mathematica tells it's $0.0958758$. When using the code ...
0
votes
0answers
87 views

solving an equation containing an complex integral

I want to solve a numerical equation which include an integral. The problem parameters are : w (is a complex : w = wr +I wi), ...
1
vote
1answer
38 views

ReleaseHold NIntegrate after Replace variable

I would like to calculate the sum of square of two integral(Ex and Ey). I first hold this two integral because two variables(tx, ty) are not specified.Then, I replace tx,ty and releasehold ...
0
votes
0answers
93 views

Solving system of Fredholm integral equations of the second kind

How can we generalize the code previously introduced to solve the Fredholm equation of the second kind to the case of a system of Fredholm integral equations of the second kind? $$ ...
1
vote
0answers
172 views

Help with calculating a complicated integral

Edit: The question is solved : )) Thank you for your attention ! I am sorry for mass questions, but the question bothers me a lot. So I would like to ask this question here. This problem arises when ...
4
votes
1answer
130 views

Saved InterpolatingFunction behaving badly

Bug introduced in 10 and persists through 10.3.1 or later I created this InterpolatingFunction, and NIntegrate gives an ...
4
votes
2answers
99 views

Derivative before Numerical Integration

I need to take the derivative of a function that have a numerical integration on it. The variable in which the integration will be taken is not the same as the one in which the derivative will be ...
10
votes
2answers
419 views

Symbolic integration fails while numerical integration succeeds

I am hoping to evaluate the following integral Integrate[((r^3 - 7)^(2/3)*(1 - (r^3 - 7)^(2/3)/r^2))/r^3, {r, 2, Infinity}] but Mathematica informs me that this ...
5
votes
1answer
373 views

Obtaining an NIntegrate error estimate

Is there a way to extract the error that Mathematica estimates when calculating a numerical integral using NIntegrate? Internally Mathematica must keep track of ...
3
votes
1answer
92 views

Want NIntegrate to catch error message

Really stuck with this. When I use NIntegrate, it sometimes prints a message like NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy ...
6
votes
1answer
905 views

WhenEvent in NDSolve

How come this doesn't work as I intended? ...
1
vote
0answers
44 views

NIntegrate and Part issues [closed]

I'm trying to numerically evaluate an integral. To try and speed up the process, I decided to calculate some values that will be needed in advance using Parallel Tables. This is what I have: ...
0
votes
0answers
103 views

Unequal behaviour of FindRoot to two similar functions

Unfortunately, I have some difficulties to plot a function. Here is my code: ...
5
votes
1answer
46 views

Exploiting symmetry makes a 2D NIntegrate harder?

NIntegrate is having trouble converging, for reasons that I don't understand. Here is a simple example. I can compute the area of the curvilinear triangle ...
4
votes
1answer
104 views

Parametric numerical integration [closed]

I would like to solve the integral: $$ \iiint\frac{e^{-\sqrt{x^2 + k^2}}x^2 \sin{\theta}}{\sqrt{x^2 + k^2}} dx d\theta d\phi$$ defined in $x \in [0,+\infty]$, $\theta \in [0,\pi]$, $\phi \in [0,2 ...
1
vote
0answers
80 views

Passing integration constants to self defined function

I would like to evaluate an integral I am taking in cylindrical coordinates, in which the integrand contains a previously defined function. I need to pass the r and phi integrand values to this ...
0
votes
0answers
201 views

How can one use differential boundary conditions with helmholzSolve?

I can not get the helmholzSolve function provided by Mark McClure and user21 to work for a case that I want to constrain the spacial derivative of a boundary. In ...
1
vote
1answer
117 views

Speeding up Integrate and the numerical solution

I want to compute the drag of a plate Below is the code I am using to integrate the function ...
1
vote
1answer
79 views

How can I combine NIntegrate with NDSolve?

I have no idea how to calculate the problems. For example consider following differential equation (DE): ...
1
vote
0answers
97 views

Problem setting boundary conditions with NDSolve [closed]

I have the following system of PDEs for which I have given parameters $\gamma, \tau$ and $\mu$, $$\begin{align} T_t = &\ \gamma\,(L +\tau F-T)\\ F_t = & -F_x-(F-LT)\\ L_t = &\ \mu ...
3
votes
1answer
895 views

Singular integral: NIntegrate fails to converge

I need to calculate the following singular integral: NIntegrate[Log[1 + y^2]/Cos[Pi y], {y, 0, 1}] However, it is failing to converge. I have tried to specify ...
0
votes
2answers
71 views

NIntegrate problem with limits in triple integral [closed]

So I am trying to solve a triple integral in mathematica, but I am getting errors regarding my limits of integration. This is my code: ...
7
votes
2answers
394 views

How much time should one give Mathematica for an integral evaluation?

Sometimes when I do integrals in Mathematica (M), it keeps thinking and thinking and I have no idea what is going on inside M. For how long should one wait or how does one know whether M has not got ...
4
votes
2answers
98 views

How should I evaluate the numerical integral of a function with divergent part substracted?

I want to evaluate the following integral numerically in Mathematica, $$\int_0^{\infty}(\frac{1}{(1 - e^t)^{10}} - (\frac{1}{t^{10}} - \frac{5}{t^9} + \frac{145}{12 t^8} - \frac{75}{ 4 t^7} + ...
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 ...
0
votes
0answers
53 views

NIntegrate some kind of highly oscillatory function

I have an analytical expression (exp) like this, See here. It is a kind of highly oscillatory function for (x1,x2,x3,x4). So,how to get the integral result by ...
0
votes
0answers
43 views

Order of evaluation for numeric functions

I'm trying to plot a 3D vector field to illustrate an electric field of a uniformly charged disk, and I used Manipulate to change the radius R of the disk to see ...
5
votes
2answers
159 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 ...
0
votes
0answers
49 views

Time needed to solve NIntegrate is much longer than what I was expecting

I'm trying to do the following list: tablevdip = ParallelTable[{x, y, Vdip[x, y, 6]}, {x, -1, 1, .5}, {y, -1, 1, .5}];] with ...
7
votes
2answers
258 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: ...
1
vote
1answer
171 views

Plotting singular integral

I need to plot the following singular double integration $u(x,t)$ for $t=0, t=0.2, t=0.4, t=1$ and $t=2$ in one figure as a line. That is, I need $u$-coordinate vertically and $x$-coordinate ...
2
votes
2answers
110 views
9
votes
1answer
1k views

NDSolve::ndcf: Repeated convergence test failure. How to solve?

I am trying to simulate a system of $n$ pendulums with some friction in Mathematica 9. This is the code I am using: ...
4
votes
0answers
67 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 ...
1
vote
1answer
66 views

Nested NIntegrate with variables in limits

How do I solve nummerically something like this and plot a function for it? $f(x)=\int \exp[\int ^{x+y} _{x-y} \exp(z) dz]dy $ This example has analytical solution, however I would like to know how ...
5
votes
1answer
72 views

WorkingPrecision and NDSolve Method Plugin Framework

I'm studying some new numerical integration algorithms using NDSolve Method Framework to specify them. When I try to set ...
11
votes
1answer
275 views

How can I use Mathematica to numerically compute a Wigner spectrogram of an optical pulse?

This question was inspired by this question where it is necessary to numerically compute the Fourier transform of a Gaussian optical pulse with a Gaussian chirp function. $$E(t)=e^{-t^2} \cos(50 t - ...
2
votes
0answers
58 views

WhenEvent behavior changed from v9 to v10 - how to fix the code?

A couple of years ago I asked a question about solving n-body systems with NDSolve and detecting collisions with WhenEvent. I ...
2
votes
2answers
88 views

Function where variable is integration bound

Lets say I have a function of the form: $f(T) = T^4 \int_0^{1/T} \frac{x^3 dx}{e^x-1}$ This is an example of the situation I am describing not a unique problem. I want to define it as a numerical ...
6
votes
3answers
196 views

Certain integral over torus

Let $F(t_1,s_1,t_2,s_2)=$ $$\big((2+\cos t_1)\cos s_1 - (2+\cos t_2)\cos s_2\big)^2 + \big((2+\cos t_1)\sin s_1-(2+\cos t_2)\sin s_2\big)^2 + (\sin t_1 -\sin t_2 )^2.$$ I am interested in computing ...
1
vote
1answer
171 views

How do I plot this 3-D, double integral?

I have the following function: I need to plot a 3-D with coordinates f (p, q), p and q. I mean, I enter values for p and q, so that the integral of f (p, q) must be a number. This number must be ...