Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
47 views
2
votes
1answer
222 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
72 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
77 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
57 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
708 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 ...
6
votes
1answer
98 views

code is ignoring WhenEvent

I would like the value of x[t] to be equal to 0 when it has a negative value so I used WhenEvent but it has no effect on my code ...
8
votes
3answers
373 views

Calculating integral by Romberg Algorithm

In my "Numeric Anasyis" course, I learned the Romberg Alogrithm to calculate the numerical integral. The Romberg Alogrithm as shown below: $$ ...
3
votes
2answers
120 views

Help with Integration

I am new to Mathematica, and I need help with integration of the following Reliability expression (from a well-known Reliability Model). $$R(t)=e^{-Ne^{-bt_i}(1-e^{-bt})}, t \geq 0$$ I have ...
1
vote
0answers
128 views

Numerical solution to integral equation

I have an integral equation where one factor $f(t)$ in the integrand is defined in terms of an integral equation where it is again a factor. $\quad \quad y[t]=\int _0^tf[\tau ]g[t-\tau ]d\tau + ...
3
votes
3answers
165 views

Inefficient NIntegrate and Which

In version 10 a simple numerical integraton of piecewise function is highly inefficient: ...
2
votes
0answers
65 views

What am I missing in this highly oscillatory integral?

I want to numerically integrate this equation (in python without calling Mathematica): $\int_0^\infty {\rm d}k f(k) J_v(r k) J_n(s k)$ where $f(k)$ is a non-smooth function, $J_v$ are the Bessel ...
0
votes
1answer
144 views

How to solve constraint differential equations using If function

I have to solve a series of differential equations along with a constraint that has to be satisfied at each point of time where $t\in [0, 100]$ The model parameters are ...
5
votes
1answer
78 views

Integrate yielding a ConditionalExpression but I don't think the condition is necessary

Suppose I take the PDF of the LogNormal distribution with parameters m and s evaluated at x. I obviously get an expression involving m. I now want to integrate that expression not with respect to x ...
3
votes
2answers
79 views

Error control for NDSolve

I have a problem controlling the numerical error associated with the following non-linear ODE : ...
3
votes
3answers
3k views

Retrieve values of InterpolatingFunction

While analyzing a large system of ODE's, I defined a particular ratio p, which contains some variables that are represented by ...
0
votes
0answers
62 views

Two warning messages in NIntegrate and NDSolve

Everybody I am trying to replicate the Figure.7 of the article arXiv:1103.2683 However my plot is different from it, which is as follows Then we can find the differences between both figures, first ...
0
votes
1answer
89 views

How to resolve the singularity in NDSolve

I ran into a problem in my Mathematica code. There is a singularity or stiff system in NDSolve. The explicit code is as follows: ...
6
votes
2answers
216 views

When analytical and numerical methods do not agree - Case study with Maximum Likelihoods methods

Here is the probability distribution I am interested in: $$P(q)=C e^{4 n s q} q^{4 n \nu - 1} (1 - q)^{4 n \mu - 1}$$ , where $e$ is the constant of Euler and $C$ is constant so that the whole thing ...
2
votes
3answers
356 views

How can I apply calculus to functions obtained from NDSolve?

Originally, I asked the question below, but the real underlying issue is as follows: When we solve an ODE numerically, I get the answer like this: ...
3
votes
2answers
147 views

WorkingPrecision causes issue in the NIntegrate

I really can't figure out why my code sometimes is not working. My integrals involve two variables (k and kz). The integration ...
0
votes
0answers
80 views
0
votes
0answers
59 views

Expectation value with Mathematica code

I need to evaluate the evolution in time $t$ of expectation value of the operator $\rho$ on the state represented by the wave packet $\Psi(\beta_{+},\beta_{-},\rho,t) = \int\int_{reg} dk_{+}dk_{-} ...
8
votes
2answers
278 views
5
votes
1answer
105 views

memory leaks using NIntegrate on parallel kernel

Bug fixed in version 10.2.0 I'm running a large computation in parallel and the memory usage of the parallel kernels is increasing with every iteration of the calculation. Neither ...
4
votes
2answers
163 views
2
votes
0answers
69 views

How can I get constant of integration? [closed]

When using Integrate, Mathematica sets a constant of integration automatically. But sometimes we are given that constant already and it should be used in order to ...
14
votes
6answers
1k views

How do I obtain the enclosed area of this particular parametric plot?

I'm trying to find a way to obtain the enclosed area of this particular plot. Can someone show me how? ...
0
votes
1answer
59 views

Boundary discretize region of ellipsoid returns a three dimensional region

I need to integrate a rather complicated function on an ellipsoidal surface, specifically a prolate spheroid surface. Im using the mathematica 10 feature of discretize the regions in mesh and pass ...
1
vote
0answers
45 views

Numerical Derivative after numerical integration [closed]

I am trying to find the numerical derivative of a function whose argument defines the bounds of a numerical integral. ...
9
votes
2answers
406 views

Why do I get a different value when I change the order of integration?

I think the following two-dimensional integrals should be equal, since they both integrate the function over the half plane defined by $t>\tau$. $$\int_{-\infty}^\infty \mathrm{d}t ...
4
votes
1answer
101 views
1
vote
1answer
80 views

Performing piecewise integration

The premise is that I am a new Mathematica user. I'm trying to evaluate the following ...
2
votes
1answer
55 views

Problem with NDSolve and Sign

If c1 cnd c2 are zero, the code responds very well; but if one of c1 or ...
2
votes
1answer
48 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} + ...
0
votes
0answers
42 views

Trouble evaluating singular and oscillatory integral

I have a lot of trouble to calculate the following integral with singularities $$ I= \frac{1}{(2\pi)^2}\iint_{-\infty}^{\infty} k_t^2 \frac{ k_{1,z} - ik_{0,z} \varepsilon_1 \cot\left(k_{1,z} ...
26
votes
2answers
2k views

Complex valued 2+1D PDE Schrödinger equation, numerical method for `NDSolve`?

Based on the heat equation of the Mathematica Manual tutorial, I wrote the complex counterpart (Schrödinger) equation, for the free particle propagation of an initial wavepacket. ...
4
votes
2answers
138 views

FEM giving “ … is not a polynomial error”

Executing the program below I get the ... is not a polynomial error message. I don't have an idea why I am getting this -- any suggestions? ...
6
votes
0answers
145 views

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
2
votes
1answer
556 views

Creating hexahedral finite elements in Mathematica

Is it possible to do FEM using hexahedral elements in Mathematica? If it possible, is there any help to do that?
2
votes
1answer
79 views

gaussian integration

I'm new on Mathematica and I am an engeneer with only a little base of numerical computation. I have to integrate a trigonometrical function numerically with a Gauss integration. The function is: ...
10
votes
6answers
741 views

Integrate gives wrong results

Integrate[a/(Sin[t]^2 + a^2), {t, 0, 2 Pi}] $$\int_0^{2 \pi } \frac{a}{a^2+\sin ^2(t)} \, dt$$ gives $0$ This cannot be true. What is going on? If I insert a ...
2
votes
1answer
84 views

Error accumulation in NDSolve?

I'm trying to solve this system of ODEs numerically: $$\vec{Q} = \vec{P} \times \vec{Q}$$ where vectors $\vec{P}, \vec{Q}$ have 3 components: $$\vec{Q} = \left( Q_1, Q_2, Q_3 \right) $$ $$\vec{P} = ...
0
votes
0answers
45 views

NDSolve : Solve a single variable-coefficient ODE as series of constant-coefficient ODEs

I have a manipulator equation of the form: $M(q){q''} + C(q,q')q'+G(q) = {0}$ where $M, C$ are $6$ x $6$ matrices, and $G, q$ are $6$ x $1$ vectors and $q$ a function of time. ...
3
votes
2answers
355 views

How to numerically integrate this integral

I am unable to do this definite integral in Mathematica 9. Is there any command so that I can get the numerical value of the above integration? Code: ...