Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
2answers
187 views

Real integral evaluates to imaginary number

The following integral:Integrate[Exp[-2/3 Log[1 + x^3]], {x, 0, 1}] is evaluating to an imaginary number. Its closed-form expression should be ...
1
vote
1answer
127 views

Line integrals over a path defined by a set of points (rather than an analytic formula)

I'm getting inaccurate results when computing (plotting) the value of a function against the length of a line integral, where the path comes from a set of numerically calculated points. (In contrast, ...
0
votes
0answers
44 views

How to properly pass function as argument here? --> NMinimize & NIntegrate involved

I had a problem of a similar kind here which was solved. Now after changing a few things in my problem setting I am suffering from the following problem. Let me first introduce methods/functions that ...
0
votes
0answers
48 views

How can I solve my problem in NIntegrate? [closed]

Can anyone help me solve my problem with NIntegrate? ...
0
votes
0answers
29 views

NDSolve dependence on initial values

I'm checking some results in this paper and I'm currently having some issues with a numerical integration of a set of differential equations using NDSolve (section 2 and 3.1-3.2 in the paper). I'll ...
0
votes
0answers
55 views
0
votes
1answer
40 views

Numerical integration of a three dimensional array

I need to integrate a scalar valued function $f\left(\boldsymbol{x}\right)$ where $\boldsymbol{x}$ is a three dimensional position vector; in other words: $\int_{\Omega} f\left(\boldsymbol{x}\right) ...
1
vote
3answers
89 views

I know the lower limit of an integration as well as the integral. How to find the upper limit of the integration?

I used the following code. NV[x1_, x2_] := NIntegrate[3 x^2, {x, x1, x2}] FindRoot[NV[0, t] == 3, {t, .001}, PrecisionGoal -> 20] Output: ...
2
votes
2answers
124 views
2
votes
2answers
199 views

NIntegrate 2D highly oscillatory function

I am trying to integrate a function, and the error I get is greater than the result. So I need to calculate ...
1
vote
1answer
33 views

Problem with NIntegrate over a user-defined region

I define a region as follows: ...
3
votes
0answers
67 views

Obtaining 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 this error, because it is used to ...
0
votes
1answer
61 views

NIntegrate vs. summation

I' m interesting in distributions of points on sphere, plane figures etc. Especially for small number of points: 1, 3, 7, ... It seems that good criterion for uniformity of distribution is some ...
0
votes
0answers
21 views

Tricks to speeding up optimisation of a function involving a heavy integration

This is the code, and energycoeffs[] is the function that takes in a dxd matrix and spits out a scalar value. ...
0
votes
1answer
58 views

Integration does not give real value

The code below must be obvious. We are trying to integrate a complicated function from 0 to 1. ...
1
vote
2answers
142 views

Problem with FindMinimum

I am struggling with a problem on fitting a function to my data using FindMinimum. The problem is related to small angle x-ray scattering and my approach is the following: I define the electron ...
0
votes
1answer
31 views

Problems using a complicated function within a LogLinearPlot [duplicate]

my problem is that I have a rather large function which I'm trying to plot, which looks something like this: ...
1
vote
1answer
62 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 ...
3
votes
1answer
102 views

What boundary is added when NDSolve::bcart pops up?

When insufficient boundary conditions are given to NDSolve for solving PDE, the warning NDSolve::bcart pops up: ...
1
vote
2answers
86 views

optimization of CountourPlot with NIntegrate

I have to use ContourPlot with a complicated function depending on 2 parametrs (that I cannot report here) that contains numerical integrations. Here is a simple ...
2
votes
3answers
140 views

Inefficient NIntegrate and Which

In version 10 a simple numerical integraton of piecewise function is highly inefficient: ...
2
votes
1answer
69 views

NIntegrate and Integrate giving different results for ill-behaved function

I'm trying to integrate the following function with Mathematica 8: $$ I(a,b)= \int_0^1 \mathrm{d}x\int_0^1\mathrm{d}y \,\theta(1-x-y) \frac{1}{x a^2-y(1-y)b^2},$$ where $\theta$ is the Heaviside ...
1
vote
1answer
72 views

Implicit region misses subset?

Context I am interested in integrating a 2D function over lines defined implicitely Attempt Let me just start by integrating the identify on such sets of lines which a defined using ...
5
votes
1answer
85 views

Integrate over implicit 1D region: works for algebraic but not transcendental equation?

QUESTION How come this works: NIntegrate[1, {x, y} ∈ ImplicitRegion[{x == y^3, x <= 1, x >= 0}, {x, y}]] But this fails: ...
6
votes
1answer
99 views

Numerical Integration different in Mathematica version 9 and 10 with same options

I have noted that the same function with the same settings gives me different results in Mathematica version 9 and 10. This involves integrating numerically interpolating functions and so on. Here a ...
1
vote
1answer
99 views

Solving a nasty partial differential equation

I have a differential equation that I would like to solve numerically in the region $z \in [0,L]$ and $t \in [0,t_{max}]$: $$ \partial_t S(z,t) = f(z)S(z,t) + \int_0^L \text{d} z'g(z,z') S(z',t), $$ ...
2
votes
1answer
170 views

What method does `NIntegrate` uses by default?

There is a variety of algorithm for performing numerical integration (See wiki). What method does NIntegrate uses by default? I looked on the documentation page and I saw that the function ...
0
votes
2answers
62 views

NIntegrate and Integrate of a Spherical Bessel function

I am trying to integrate over a spherical bessel function. I have used both the Integrate and NIntegrate functions in Mathematica but the values given by each do not match. Any reason why this ...
1
vote
1answer
86 views

How to prevent tiny complex errors in Integrate?

Integrate is adding a tiny imaginary error to an easy result. Why? And how can I stop it? ...
2
votes
1answer
83 views

How to obtain numerical answer for equation containing integration

Could some one tell me how to obtain numerical value of $a$ and $b$ from equations below: $$\frac{1+exp(b)}{1+exp(0.9a+b)}=0.95$$ $$\int_{0}^{\infty} \frac{1+exp(b)}{1+exp(a x+b)}=1$$
1
vote
1answer
56 views

Finding the true expectation

I have the density function and I want to determine its expected value ...
3
votes
0answers
132 views

Numerical integration: complicated 2D integral seems to be poorly estimated

In the course of some physics research I've been working on, a very annoying integral has appeared that I'm having difficulty evaluating numerically. Any help you could offer would be greatly ...
0
votes
0answers
75 views

Numerical Integration/Function

I have a problem with a function defined numerically through an integral of the form: ...
0
votes
0answers
27 views

What means the definition F[t_?NumericQ] :=…? [duplicate]

I've come along a function defined in this way: F[t_?NumericQ] := NDSolve[{-u''[x] - u[x]/x == -t^2 u[x], u[x0] == x0, u'[x0] == 1}, u, {x, x0, x1}] What does ...
1
vote
1answer
108 views

Runge-Kutta Butcher tables

I like to have the Butcher's table for Explicit (or implicit as well) Runge-Kutta method of a fixed order. I do not understand reading ...
0
votes
1answer
61 views

NDSolve not able to solve a system of differential equations

Here are some basic equations ...
15
votes
2answers
199 views

Least effort to handle a point source inside the domain of PDE(s)

By point source I mean a constrained condition at one point inside the domain of PDE(s). For example: $$\frac{\partial ^2u(t,x,y)}{\partial t^2}=\frac{\partial ^2u(t,x,y)}{\partial ...
0
votes
3answers
79 views

Calculate this integral returns undefined

Limit[ (Integrate[Sqrt[Exp[3 t + 2] + 3] , {t, 0, x}]^2) / Integrate[Sqrt[Exp[6 t - 2] + 5] , {t, 0, x}] , x -> Infinity] This can be solved but ...
0
votes
0answers
56 views

Locating Periodic Orbits - Part II

In a previous post Part I I asked how could I locate the x0 position of a periodic orbit. I got only one possible solution but it does not work as I want. Let me be ...
4
votes
2answers
165 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
1answer
166 views

Integration of a high oscillatory function

I want to get the numerical result of the integration below: ...
1
vote
1answer
147 views

Locating Periodic Orbits

Here is the code for the numerical integration of an orbit. First the module for the definition of the equations of motion. ...
0
votes
1answer
81 views

InterpolatingFunction used to work with mathematic 7 but not working with mathematica 10

This code is used to work perfectly with Mathematica 7 and now it is not working with Mathematica 10. Any help is appreciated. CL05 = InterpolatingFunction[{{0.5, 11.99999999999999}}, {1, ...
2
votes
2answers
175 views

Plot result of non analytical-integral

I have the following function: h = 1; c = 1; k = 1; B2 = (2*h*c^2)/(x^5 (Exp[(h*c)/(x*k*T)] - 1)); (someone can see that this integral is the Planck function). ...
1
vote
3answers
86 views

Speed up NIntegrate, which takes eigenvalues from another function

I have simplified my problem here, in my actual problem the matrix is much bigger which makes it impossible to find eigenvalues analytically. So, I chose standard BCS problem (2x2 matrix) to ...
2
votes
1answer
181 views

Approximate $h$ in $F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$

Consider $$F(\theta)=\sin \theta \int_{-L}^{+L}h(z)e^{-ikz\cos \theta} \,dz$$ $$|z|\le L$$ $$0 \le \theta \le \pi$$ By having knowledge of $F(\theta)$, how can one approximate $h(z)$? In ...
1
vote
2answers
214 views

NDSolve with Explicit, Implicit Euler and Trapezoidal method

I am using Mathematica 9.0 both on Linux and Windows and I would like to integrate the Van der Pol equation numerically using various techniques such as Explicit and Implicit Euler and Trapezoidal ...
2
votes
0answers
81 views

Position from 3 dimensional acceleration data? [closed]

Per a previous post on Mathematica StackExchange here I'm trying to utilize 3-axis accelerometer data to determine approximate 3D position. I wanted to start with a simple case. To this end I've ...