Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
0answers
63 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
0answers
37 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
29 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 ...
0
votes
2answers
63 views

How can I put a defined symbol as the integrand of NIntegrate, without using a functional form with a pattern test?

Something like this, I define an integrand (really big and hairy, simple below) ...
8
votes
1answer
69 views

Working Precision in nonlinear control systems

When simulating a nonlinear control system using StateResponse , do the options WorkingPrecision, ...
0
votes
0answers
46 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
1answer
71 views

Integrate over FindRoot solutions

I have a function of bivariate normal PDF and its marginals defined as ...
1
vote
1answer
92 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$ ...
0
votes
0answers
86 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
87 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? $$ ...
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 ...
7
votes
2answers
121 views

inspecting step size and order of $\tt NDSolve$

I am trying to collect information about what step sizes and what orders is using NDSolve internally. I tried wrapping it into a ...
1
vote
0answers
43 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: ...
5
votes
1answer
45 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 ...
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
103 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
1answer
75 views

How can I combine NIntegrate with NDSolve?

I have no idea how to calculate the problems. For example consider following differential equation (DE): ...
0
votes
2answers
139 views

How can I perform NIntegrate with NDSolve?

I'm a new user and I have no idea how to perform NIntegrate by using NDSolve. For example consider following differential equation (DE): ...
1
vote
0answers
92 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 ...
7
votes
1answer
159 views

Numerically evaluating an integral related to Cantor's staircase

Cantor's staircase $F_C(x)$ is a well-known "pathological" function: Plot[CantorStaircase[x], {x, 0, 1}] The MathWorld link given above claims that $$\int_0^1 ...
1
vote
1answer
73 views

Estimating error in NDSolve

I would like to give a theoretical estimation of local truncation error (and then for the global one) for a solution to a numerical initial value problem by ...
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 ...
0
votes
2answers
69 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: ...
2
votes
3answers
442 views

Solving an equation involving an integral

How do I get the following into Mathematica, solving for $a$: $$ 0.7 = 1 - \frac{2}{a} \times \left[ \frac{1}{a} \int_0^a \frac{x}{\exp(x)-1}\mathrm dx + \frac{a}{6} - 1\right] $$
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 ...
4
votes
0answers
64 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 ...
0
votes
1answer
101 views

Integrating high oscillatory function - triple integral - error message

I am working in a triple integral, but the second integral (qQ) and the first too ( aA ) is a oscillatory funcion. The third integral ( os11 ) is like a gaussian, and is easy to integrate. i am ...
2
votes
2answers
107 views

Solving nonlinear 3rd order ODE over range from zero to infinity

Here are the code that I had tried but there is an error ...
1
vote
1answer
170 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 ...
1
vote
1answer
58 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
70 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 ...
2
votes
0answers
57 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
85 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
195 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
164 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 ...
11
votes
1answer
261 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 - ...
0
votes
1answer
134 views

NDSolve breaking down

I'm trying to model a situation involving charged sphere in a dynamic electric potential, and find out how the rotational motion of the sphere affects the translational dynamics in two dimensions. ...
3
votes
1answer
70 views

Numerical integration with parameter and plot

I'm working on this function: (0.0027 Sin[phi])/(1.05*Exp[-241w]+ Exp[239w]-Cos[phi]) I'd want NIntegrate this function on ...
3
votes
1answer
58 views

How can I plot points generated by a Verlet Integration?

So, I have this code for Verlet Integration: ...
2
votes
0answers
53 views

Discretised numerical solution to a non-linear non-local equation

I understand that to do something even slightly non-trivial in Mathematica, I need to read some materials; the problem is that there are (too) many materials and only one particular problem, and I ...
3
votes
2answers
192 views

Error in NIntegrate command

I am trying to evaluate (numerically) the integral $$\int_0^1\int_0^1\int_0^1\int_0^1\int_0^1\int_0^1\frac{dx\,dy\,dz\,ds\,dt\,du}{(x - s)^2 + (y - t)^2 + (z - u)^2}$$ with Mathematica using the ...
6
votes
2answers
255 views

Solving the path of Earth around Sun

This maybe isn't a universally helpful question. Maybe a little of a code dump. But here goes. I'm trying to solve the path Earth moves around Sun from Earths mass, Suns mass, Earths initial velocity ...
1
vote
1answer
78 views

Nonlinear 2nd order ODE with regular singularities

I am tring to solve the following ODE with NDsolve $2x~(1-x)~f''(x)+(3-4x)~f'(x)+a~f(x)+b~f^n(x)=0;~~a,b\in\mathbb{R},~n\in\mathbb{N}$. The mathematica "code" is: ...
1
vote
1answer
384 views

Numerical solution of Schrödinger equation

I want to solve the following differential equation numerically. The geometry of the problem is as shown below. Electron 1 is located on the inner ring of radius $R_1$ and electron 2 is located on the ...
1
vote
1answer
48 views
16
votes
2answers
270 views

More efficient method to compute moments of the Johnson $S_B$ distribution

Here is a very specific feature request. I need Mean[JohnsonDistribution["SB", γ, δ, 0, 1]] When I issue e.g. ...
2
votes
0answers
130 views

How to solve an equation where the unknown variable is inside the integration [closed]

I have an equation: $$ \frac{1}{g}=\int_0^{\frac{1}{\delta}\sinh \frac{1}{g}} \frac{\tanh\left(0.882\, b\,\delta\sqrt{1+z^2}\right)}{\sqrt{1+z^2}}\mathrm{d}z $$ I want to obtain the relation ...