Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
0answers
19 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
88 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 ...
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 ...
1
vote
1answer
800 views

Integro-differential eqn with double integral

I am looking at the following variation of a integro-differential, with y[0]=1. The output is not great, any solutions to this? ...
3
votes
0answers
64 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
70 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 ...
9
votes
1answer
762 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: ...
0
votes
0answers
66 views

NIntegrate unexpectedly returns complex number [on hold]

I am attempting to visualise the effect of shifting parameter $\gamma$ on the 3-parameter log-normal distribution. $$pdf(x;\mu,\sigma,\gamma) = ...
3
votes
2answers
611 views

Unexpected result of summation

I wrote a small module that gives me an incorrect output-set. It should be a single number! I don't understand what went wrong. This is the form of summation used: $$\frac{1}{2} (b-a) \sum_{i=1}^n ...
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 ...
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 ...
1
vote
2answers
97 views

Numerical integration of modified bessel function

I need to compute the following integral: NIntegrate[ BesselI[-nu, k x]/x ,{x, r1, r}] in which nu=-(2m-1)/2 and I have to ...
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 ...
3
votes
0answers
52 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 ...
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 ...
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
99 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 ...
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
2answers
124 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
1answer
43 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 ...
10
votes
1answer
392 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 ...
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) $$ ...
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 ...
1
vote
0answers
176 views

Numerically solving a 2D oscillating integral [closed]

I'm having trouble solving this integral numerically: ...
0
votes
2answers
126 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 ...
3
votes
1answer
109 views

Strange integration

Bug introduced in 9.0 or earlier and fixed in 10.1 Note: Beginning with V10.1, this integral returns unevaluated but without error messages. I tried to evaluate this line ...
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: ...
5
votes
2answers
448 views

NDSolve: ProcessEquations and Reinitialize with Piecewise functions

I am having trouble with using NDSolve`Reinitialize when the system consists of a piecewise function. If we define the ODE system ...
10
votes
3answers
623 views

Only final result from NDSolve

Finally, I started to play with differential equations in Mathematica. And I have faced the problem, which seems to me so basic that I'm afraid this question is going to be closed soon. However, ...
8
votes
1answer
156 views

Using a Mathematica index as a DiscreteVariable in NDSolve when solving a coupled set of ordinary differential equations

Context Since the explanation below of the problem to be solved is lengthy, let me preamble this by saying that I have code that works to solve the problem, but I don't know whether (1) it's ...
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 ...
8
votes
0answers
2k views

Integro-differential equation [closed]

I have to numerically solve a nonlinear partial integro-differential equation using Mathematica. This is my equation, $$\frac{\partial y(x,t)}{\partial t}=\int_{-\infty}^\infty K_0(|x-u|) ...
-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: ...
2
votes
1answer
208 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
154 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 ...
8
votes
1answer
612 views

Numerical contour integrations in the complex plane - contour deformation gives different answer for analytic kernel

I am trying to do a contour integration in Mathematica numerically. In particular, I'm checking the identity: $$ H_m^{(1)}(z) =\frac{i^{-m}}{\pi}\int_{-\pi/2 + i \infty}^{\pi/2 - i \infty} \exp[i m ...
0
votes
0answers
56 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 ...
4
votes
1answer
497 views

Multi-dimensional integral in the complex plane with poles and essential singularity

I've passed the last week searching a way to numerically integrate this multi-dimensional integral in the complex plane at the poles and avoiding the singularity at z=0: $$ \oint_{C}\oint_{C\ auound\ ...
0
votes
0answers
64 views
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, ...
0
votes
1answer
120 views

Existence of an analytical form for integral

Can the following integration be performed with an analytical output? ...
4
votes
1answer
192 views

How to do this complex integration on the real line?

$m, r$ are parameters in the following integral: Integrate[z Exp[I z r]/Sqrt[z^2 + m^2], {z, -∞, ∞}] How to do this integration directly? The result should be ...
2
votes
1answer
165 views
0
votes
0answers
191 views

A power series expansion

Consider the function, $f(z) = z tanh(\pi z) log (z^2 + a^2)$ for some $a>0$. Now I am considering 3 different situations, $z = i(n+0.5) - i\epsilon + \delta - it$ for $n \in \mathbb{Z}$ and ...
20
votes
2answers
1k views

Why does Mathematica give the wrong answer when integrating?

Bug introduced in 8.0 or earlier and fixed in 9.0.0 I integrate Integrate[Exp[I Cos[b - c]] Cos[b], {b, 0, 2 Pi}] Mathematica gives: ...
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 ...