Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

5
votes
1answer
67 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
65 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
44 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 ...
0
votes
0answers
67 views

Numerical solution to integral equation [duplicate]

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 + ...
0
votes
0answers
54 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
65 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
208 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 ...
0
votes
1answer
118 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 ...
2
votes
3answers
348 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
146 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
30 views

Numerical Integration in Simulation

I've been doing some maths, and now I'd like to check the results I obtained. From the equations below, I need to extract and ...
0
votes
0answers
78 views
0
votes
0answers
27 views

numerical integration takes so long? [closed]

to evaluate this line, Mathematica.10 takes more than 10h?!! Table[{x, (Re[ NIntegrate[f[x,y], {y, -x/a, x/a}, Method -> "UnitCubeRescaling"]])}, {x, 1, 200, 1}] where f[x,y] is a ...
0
votes
0answers
54 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_{-} ...
-2
votes
0answers
51 views

Solving an integral equation using Mathematica [closed]

Hi I have the following problem I want to solve numerically by Mathematica the integral equation $$v(x,t)=1-0.0000065*\int_0^t \theta_0(1/2 x| i\pi \tau)v^4(1,t-\tau)d\tau$$ where $\theta_0(1/2 x | ...
7
votes
2answers
270 views
4
votes
1answer
78 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
155 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
54 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
43 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. ...
0
votes
1answer
101 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 ...
9
votes
2answers
391 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
98 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
43 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
44 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
39 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} ...
2
votes
1answer
178 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
140 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 ...
25
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. ...
0
votes
1answer
102 views

Existence of an analytical form for integral

Can the following integration be performed with an analytical output? ...
4
votes
2answers
134 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
130 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
541 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
74 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
731 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
81 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
43 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
336 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: ...
9
votes
1answer
713 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: ...
6
votes
2answers
165 views

Reject diverging solution of NDSolve

I'm trying to numerically simulate a spring system with complex stiffness. In essence systems of the form $x''(t)+ (a+ ib) x(t)=0$ For this simple example an analytic solution is easy to find. The ...
2
votes
2answers
135 views

Approximation of definite integral by parabolas

This question is related to Trapezoid approximation to definite integral. As promised, I am now asking about how to draw approximation of integrals by parabolas. I tried to modify MarcoB's code, and I ...
8
votes
1answer
1k views

Controlling the time step in NDSolve?

I generally use NDSolve for stiff non linear partial differential equations of 4th order. I find that a BDF1 method generally does well to placate my beast of a PDE. I've also tried out ...
2
votes
1answer
197 views

Internal Shooting Method of NDSolve in combination with NDSolve`Reinitialize?

To explain my problem, I am trying to extend the BVP problem example from the help that illustrates how to use the shooting method of NDSolve: ...
4
votes
1answer
63 views

WhenEvent used in a PDE to output independent variable

I want to use WhenEvent with a PDE after it has reached steady state. I'm posting a system of 2 equations (my real system has 6) and I'm solving the advection-diffusion-reaction 2nd order PDE. First ...