Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
2answers
89 views

How to determine the parameter in a differential equation with some fixed solution

Assuming that I have a ODE system with undetermined parameter $$x''(t) == y(t) x(t)$$ $$y'(t) == 2 - a x(t)$$ and I have some fixed solution condition $$x(0)=0$$ $$x(10)=8$$ $$y(10)=3.5$$ Is there ...
2
votes
2answers
95 views

How do I exclude regions from numeric integration on Mathematica?

The part of the equation that is giving me trouble is below: f[t_,v_]:= Exp[-(1/Log[1-t/v]^2)]*(v-t) I need to integrate this function over the ranges .1 ...
3
votes
0answers
65 views

NSolve doesn't work on an equation containing a numerical integral and constraints

I'm having trouble getting Mathematica to solve equations numerically. I know that its important to specify the type of variables for pattern testing (see e.g. here) but this doesn't seem to work. ...
3
votes
1answer
73 views

Why am I getting different answers for integral depending on method?

I'm trying to carry out an integral and I'm finding different answers depending on which method I choose to integrate with. I assume this has something to do with divergent pieces but I don't ...
3
votes
2answers
78 views

Maximizing a function defined using NIntegrate [duplicate]

I have two functions fn[x,y,z] which is in integral form and I have another function gn[x,y] which is also in integral form ...
7
votes
2answers
123 views

How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
10
votes
1answer
60 views

How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated ...
2
votes
1answer
61 views

Three Dimensional Plot of Numerical Integral with Delta Function

I want to plot the definite integral of the following function ...
0
votes
1answer
68 views

Integrate works but NIntegrate doesn't

I have a complicated integral function that I'm trying to evaluate, which will have to be done numerically. I wanted to try a simpler one first, one that has an analytic form, because I could check ...
3
votes
0answers
53 views

How to speed up a high dimensional numerical integration of Gaussian-form integrand

My integral has the following form: $$\int \sin(\theta) d\theta d\phi\left| \int d^3p_1 d^3p_2d^3p_3 \frac{f(p,\theta,\phi)}{g(p,\theta,\phi)}e^{-\frac{1}{2}(p^\mathrm{T} .A.p)}\right |^2,$$ where ...
1
vote
0answers
47 views

Plotting roots for a singular numerically-only integrable equation

In my problem I need to plot roots with respect to a parameter. But the condition for root is det(Function)=0. This function cannot be solved symbolically. So I need to put in a parameter value and ...
2
votes
3answers
100 views

slwcon and eincr in integrating multivariate Gaussian random variables

Why is the following integration involving multivariate Gaussian distribution so slow and generating an error? Is there a better integration strategy? All that I'm doing is considering ...
0
votes
1answer
73 views
4
votes
2answers
125 views

Postprocessing of CFD results in Mathematica

I was trying to perform computational fluid dynamics (CFD) post-processing in Mathematica after solving primitive variables from Navier-Stokes equation, mainly $(u,v)$, $(Px,Py)$. Since I am not an ...
0
votes
0answers
31 views

Evaluation stops, no error

I'm trying to iterate NIntegrate using Table so that I can plot the result as a function of an external angle. It's an oscillatory function so it gives some error on the estimate for the value, but ...
11
votes
1answer
396 views

Nintegrate has memory leak

Bug introduced in 6.0 and fixed in 10.2.0 NIntegrates uses memory and does not release it. For long loops with NIntegrate ...
0
votes
1answer
44 views

NIntegrate and memory use [duplicate]

I wonder why NIntegrate uses memory. I have a long integral computation repeated thousands times. The memory use then goes up and speed goes down. I think I spot a ...
2
votes
0answers
91 views

Nasty integral advice

I have a pretty ferocious integral to solve, and since it doesn't seem I'll be able to do much analytically, I've taken to Mathematica to get some information. Mainly, I want to see if there are any ...
4
votes
1answer
99 views

Does not evaluate the Integral and a plane plot

I am trying to compute a ContourPlot and a VectorPlot using the following functions: ...
-2
votes
1answer
42 views

Plot the result of NIntegrate for different parameter values

I want to plot the result of a numerical integration containing a parameter in terms of the parameter. The code is: ...
0
votes
0answers
56 views

Is there a IsDefinedQ function? [duplicate]

I have a function which is a bit expensive to calculate. I want to translate and integrate. I want to translate by values on a grid, store the values of the integral and refine the grid. That is, I ...
0
votes
0answers
64 views

What am I missing in this integration?

Trying to solve diff.eq.has led me to: ...
0
votes
0answers
57 views

NDSolve fixed step problem

Working example here: Drive folder (have both files in the same directory! Notice: the line <<variables' in the file seems to throw an error for me, but ...
0
votes
0answers
39 views

How to solve algebra equations containing integration and parameters?

I'm trying to solve two nonlinear algebra equations for two unknown parameters, U and Tf. Since some terms in these equations contain integration, and the integration also contains U and Tf. The main ...
1
vote
2answers
216 views

Plotting a parametric function containing an integral [closed]

I need to plot this expression $$ \phi(s; H,B)=\left(\int_{0}^{s}\frac{1+B\ \sin2H\ t}{\sqrt{1+B^2+2B\sin2H\ t}} \text{d} t,\ \frac{1}{2H}\sqrt{1+B^2+2B\sin2H\ s}\right)$$ for $H=0.5$, $B=0, 0.5, 1, ...
8
votes
1answer
179 views

SymplecticPartitionedRungeKutta shows strange error

Bug introduced in 9.0 or earlier and persisting through 10.2 or later I tried to solve Hamiltonian system ($Q$ is a vector of all generalized coordinates, $P$ - of generalized momentum) $$ ...
2
votes
0answers
40 views

NDSolve with NIntegrate [duplicate]

I'm new to Mathematica and I'm trying to use it to solve some equation like: NDSolve[x'[t]+NIntegrate[x[tau],{tau,0,t}]==20,x,{t,0,10}] But it keeps giving me ...
1
vote
1answer
47 views

Matrix issue with NDSolve

I am solving a differential matrix equation with NDSolve. ...
0
votes
1answer
36 views
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 ...
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
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. ...
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 ...
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 ...
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
106 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
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 ...
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: ...
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 ...
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 + ...
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 ...
3
votes
2answers
79 views

Error control for NDSolve

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

How to obtain the area enclosed by such a curve?

The desired curve is defined as curve02 below : ...
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. ...
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 ...
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 ...
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 ...