Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

5
votes
0answers
35 views

Spurious infinite limit of integration message in NIntegrate

NIntegrate returns an error complaining that ComplexInfinity is an invalid limit of integration when passed exact input but not ...
4
votes
1answer
60 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
1answer
47 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. ...
6
votes
1answer
95 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 ...
3
votes
2answers
112 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 ...
-3
votes
0answers
64 views

Numerical integration giving trouble [on hold]

Recently I have been struggling with this problem and I think an outside look (and expertise) is what I need. I have a set of equations that in the end give me the tuple ...
2
votes
0answers
62 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
85 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 ...
5
votes
1answer
72 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 ...
0
votes
1answer
84 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: ...
0
votes
0answers
60 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 ...
1
vote
0answers
118 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 + ...
0
votes
1answer
137 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 ...
3
votes
2answers
70 views

Error control for NDSolve

I have a problem controlling the numerical error associated with the following non-linear ODE : ...
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_{-} ...
0
votes
0answers
79 views

Nasty nested Integrals

I would like to solve following integrals by Mathematica ...
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 ...
4
votes
2answers
157 views

How to obtain the area enclosed by such a curve?

The desired curve is defined as curve02 below : ...
1
vote
0answers
44 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
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 ...
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 ...
4
votes
1answer
85 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 ...
2
votes
1answer
46 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
40 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} ...
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? ...
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: ...
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. ...
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
1answer
82 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} = ...
6
votes
0answers
132 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 ...
3
votes
3answers
199 views
4
votes
1answer
67 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 ...
10
votes
2answers
210 views

How to use NDSolve with discontinuities at internal boundaries?

I don’t know how to impose discontinuous internal boundary conditions (BCs) in NDSolve, so I’ve set up an example problem to illustrate my issue. Consider the simple first-order ODE for $f(z)$ on the ...
3
votes
2answers
100 views

How should I tweak the options in NIntegrate?

I'm trying to obtain an accurate result from a difficult-to-integrate function and I've thrown in the kitchen sink worth of options in NIntegrate. I think I'm ...
0
votes
1answer
61 views

Calculation Performance (slow Plotting)

I have a functions, which is an Integral. It is exaclty this function Zf[x_] := 2*I*NIntegrate[Exp[-y^2.0 + 2.0*I*y*x], {y, 0, Infinity}]; Later I need to plot a ...
2
votes
1answer
44 views

Integrate and NIntegrate combined, giving MaxPrecision error

I am trying to integrate the following : ...
12
votes
1answer
280 views

How do I create a triangulated surface from points?

I have a set of points in a nx3 matrix and I would like to convert them into a surface, so that I may calculate its surface area. The function ListSurfacePlot3D creates the surface how I want it. ...
-2
votes
1answer
38 views

NIntegrate a function containing NDSolve

I am having an issue integrating a function for which I am getting values for when I evaluate it. ...
1
vote
1answer
92 views

How do I solve this ODE numerically in Mathematica?

I want to solve these equations numerically in Mathematica and plot them. \begin{equation} u'(t)=1.5\,u(t)\,v(t)-u(t) \space \space \space \text{and} \space \space u(0)=0.001 \end{equation} ...
2
votes
0answers
90 views

Different solutions for seemingly same Integral

I want to evaluate the following integral: $$\int_{\left(1-\sqrt{a}\right)^{2}}^{\left(1+\sqrt{a}\right)^{2}} \frac{1}{2\pi ...
0
votes
0answers
61 views

Finding when a ODE returns to starting position

I am trying to discover when these ODE return to their start position. I am using coordinates that have a periodicity of {Pi/2, 2Pi, 2Pi}. To accomplish this I have had to use mod. The ODE are ...
0
votes
0answers
104 views

How to optimize a cost function which involve the solution of a ODE system using the NMinmize?

I have created a cost function, the value of which depends on the solution of a ODE (ordinary differential equation). The parameters of the ODE are not determined, and my goal is to determine them ...
0
votes
0answers
94 views

Integrating a highly oscillatory function

I am trying to numerically evaluate the integral $\int_{-\pi}^{\pi}\mathrm{d}x f(x) \mathrm{e}^{\mathrm{i} xn}$, where $n$ is a large number, say 50. The errors I get are NIntegrate::slwcon and ...
0
votes
0answers
61 views

Improve the speed of Gaussian quadrature integration

I am using Gaussian quadrature method to do numerical integration for a function Pderivative, which is related to the demagnetization tensor of ...
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 ...
5
votes
1answer
92 views

Why does DSolve give a different result than NDSolve?

When I try DSolve to solve a system: ...
0
votes
1answer
84 views

Numerical integration converging too slowly

I must solve this integral which I suppose to be a very small number. How can I do? When I wrote this code: ...
7
votes
3answers
212 views

NIntegrate of surface area of intersecting spheres yields zero

I have a bunch of spheres (it's actually diamond cubic structure. The 0.6 radius doesn't matter), ...