Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

0
votes
0answers
28 views

Does a very large prefactor affect NIntegration time when plotting the result?

I'm using ListPlot[ NIntegrate[f[x,#],{x,a,b}]&/@Range[10,100] ] to plot the integral of the two variable function f as a ...
2
votes
1answer
97 views

Numerically integrate and plot $f(x;p)$ for a range of the parameter $p$

Suppose we have an integral of the form $$I = \int_a^b dx \, \sin(px), \tag{1}$$ where I've take $f(x;p) = \sin (px)$ to be specific. I want to plot this integral for a range of values of the ...
3
votes
2answers
122 views

How much time should one give Mathematica for an integral evaluation?

Sometimes when I do integrals in Mathematica (M), it keeps thinking and thinking and I have no idea what is going on inside M. For how long should one wait or how does one know whether M has not got ...
1
vote
0answers
38 views

Which type of integrals are better for Mathematica [closed]

Is it in general better to type in a integral with its limits, or is it better to type an indefinite integral into Mathematica? With better I mean: Likelihood that Mathematica can solve it, ...
0
votes
0answers
41 views

Improve speed in module with NIntegrate and FindRoots

I am running version 10.1 in Windows 7. The following code gives good results but I have two questions: Is there a way to speed up the program as I would like to compute more data points? The code ...
0
votes
1answer
81 views

Integral evaluation error

I have the following integral that I wish to evaluate using Mathematica: ...
2
votes
2answers
93 views

Calculate area between two multivalued curves

I have to calculate the area between two curves which will give me the result of a particular quantity. However, both the curves are multivalued functions. Here is a data set showing the region where ...
0
votes
0answers
50 views

Problem with plotting a piecewise function [duplicate]

I'm having a very puzzling issue with piecewise defined but smoothly continuous functions. I have a perfectly continuous piecewise function defined as ...
10
votes
6answers
732 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 ...
7
votes
2answers
303 views

How to solve the differential equation with Duhamel's integral?

How do I solve a differential equation with Duhamel's integral? I tried to solve it with NDSolve, but failed: ...
1
vote
1answer
64 views

Assymptotically Solving ODE with free parameters

I have a first order ODE, $F(y[x], y'[x], A, B) = 0$. I want to solve this numerically (with the boundary value $y[1] = i$ ) but also with the following requirements: A and B are free parameters which ...
0
votes
0answers
41 views

NIntegrate fails to converge around a value out of integration range

This is the function that I am trying to integrate, I have interpolated it for best results (would rather not): There is a 'singularity' around 0, but I get the warnings and bad results even when ...
0
votes
0answers
39 views

Integration problem: lrgexp

I want to calculate the following integration but it gives the error PolynomialGCD::lrgexp: Exponent is out of bounds for function PolynomialGCD. The code is: ...
1
vote
2answers
81 views

Plotting NIntegrate

Plot[E^(-0.5 x) NIntegrate[Cos[t] E^(Cos[t] + 0.5 t), {t, 0, x}], {x, 0, 40}] Mathematica evaluates this integral for each point, which takes a long time. It is ...
6
votes
0answers
102 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
97 views
0
votes
1answer
85 views

Numerical integral speed

I have the following code to calculate a numerical integral for any given a, however it takes a very long time, even with adaptivemontecarlo, which is not accurate enough: ...
18
votes
4answers
824 views

A bug in Integrate

Integrate[(1 + 16 Tan[2 x - y]^2)/(1 + 4 Tan[2 x - y]^2), {x, 0, 2 π}] Mathematica (wrong) output is (tested under versions 8 and 10.0, took ~ 1 minute of CPU ...
1
vote
0answers
80 views

How to incorporate the boundary conditions into the differentiation scheme in MMA?

Let that we want to numerically solve the following PDE \begin{equation}\label{sde} -r V(S,t)+r S \frac{\partial V(S,t)}{\partial S}+0.5 S^2 \text{sigma}^2 \frac{\partial ^2V(S,t)}{\partial ...
7
votes
2answers
226 views

Why does Mathematica say $\int_0^1\int_0^1\int_0^1\frac{1.0}{xyz}\,dz\,dy\,dx=0$?

Mathematica 9 says that $\int_0^1\int_0^1\int_0^1\frac{1.0}{xyz}\,dz\,dy\,dx=0$ and $\int_0^1\int_0^1\int_0^1\frac{1}{xyz}\,dz\,dy\,dx=0$. ...
0
votes
0answers
94 views

Plotting a numerical integration

I have the following code to calculate a numerical integral for any given a: ...
0
votes
0answers
49 views

Solve an integral equation: to fit the given data with an integral of two functions?

I am trying to find an efficient way to solve the following equation $$h\left(b\right)=\int_{0}^{b}f\left(\frac{b-c}{1-c}\right)\frac{g\left(c\right)}{1-c}dc$$ where for $h(b)$ I have the data ...
2
votes
1answer
125 views

Solving an integral equation numerically

my problem is: I get the result of definite integral and now I need to find the upper limit for the same integral but with opposite sign value so f2=-f1. ...
0
votes
1answer
104 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 ...
0
votes
0answers
74 views

NIntegrate gives message NIntegrate::vars:

As seen in the code below, I initially constructed a list of functions of two variables ζ and t0. These functions are pure ...
0
votes
0answers
66 views

Using Fourier to return exponential function

I am trying to use Fourier to numerically demonstrate the following identity: $$ \frac{1}{2\pi}\int_{-\infty}^{\infty}\frac{e^{i\,s\,y}}{1 + a\,s}ds=e^{-y/a} $$ I'm getting the correct shapes, but my ...
0
votes
0answers
65 views

Integration is unevaluated analytically after a variable removed

I am using Mathematica 9.0 to do a symbolic integration as follows: ...
-1
votes
1answer
126 views
2
votes
0answers
55 views

The idea behind Stiffness switching method with NDsolve [closed]

Does the Stiffness switching method with NDsolve switch just between multiple variants of 4th order Runge Kutta method or it uses also other methods?
1
vote
2answers
120 views

Integral too oscillatory

Is there any way top make this integral less oscillatory? ...
0
votes
0answers
62 views

NIntegrate evaluating to “non-numerical values” for some input values despite using ?NumericQ

I'm quite new to Mathematica and I'm finding myself wanting to compute an integral for which my code produces errors of the kind: "NIntegrate::inumr: "The integrand ... has evaluated to ...
0
votes
0answers
31 views

How to NIntegrate a function that is the result of another NIntegration

What I want to do is the following ...
4
votes
1answer
99 views

Kernel crash when using NIntegrate with Throw/Catch

Bug fixed in 10.2.0 My code is: ...
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 ...
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 ...
0
votes
0answers
64 views
2
votes
1answer
60 views

How to NDSolve a set of equations, one of which itself contains NIntegrate of a desired function?

How to NDSolve a set of equations, one of which itself contains NIntegrate of a desired function waited to be solved by NDSolve first? For example, ...
2
votes
1answer
60 views

Why isn't Table iterator value inserted in failed NIntegrate arguments?

Consider this simplest example: Table[{z, NIntegrate[f[x], {x, 0, z}]}, {z, {1}}] Here f is not defined, so ...
7
votes
2answers
274 views

What's wrong with NIntegrate with “MonteCarlo” Method?

Bug fixed in version 10.2.0 My code is: ...
5
votes
1answer
150 views

Why does Nintegrate keep unevaluated?

It's no surprise that the "MonteCarlo" Method works well: ...
0
votes
2answers
56 views

NIntegrate fails when integrating over a list from an external (MathLink) function

NIntegrate fails when integrating over a list from an external (MathLink) function. For simplicity, consider an external function f[x] that returns the list {x,2x}. In Mathematica, the function would ...
2
votes
3answers
105 views

NIntegrate-ing a compiled function

I'm trying to integrate numerically in 6 dimensions a very long expression and I read about the option to NIntegrate a compiled function which should be faster. ...
2
votes
0answers
60 views

Want NIntegrate to catch error message

Really stuck with this. When I use NIntegrate, it sometimes prints a message like NIntegrate::ncvb: "NIntegrate failed to converge to prescribed accuracy ...
2
votes
0answers
123 views

Problem solving a nonlinear partial differential diffusion equation [closed]

EDIT: actualy the nonlinear partial differential equations for interacting density distributions, including boundary conditions, should be given as $$ \frac{\partial\phi}{\partial t} = D ...
0
votes
1answer
65 views

NIntegrate producing SetDelayed::write message [closed]

I used NIntegrate to calculate an integral with the final limit as a variable, which later will be listed in a table, ...
3
votes
0answers
53 views

Using indexed array elements as integration dummy variables with EvaluationMonitor. Bug?

As part of a routine that must cope with integration of varying numbers of dimensions, I would like to use indexed variable names (e.g., x[0], x[1],...) as dummy integration variables. However, it ...
0
votes
1answer
77 views

Plotting results of NIntegrate with variable integration limit

I have tried to use NIntegrate with variable limits and compute the following ...
7
votes
1answer
139 views

Difficulty in getting correct Gaussian curve for diffusion of point source

I want to solve diffusion of a point source numerically and check it against analytical solution. first I define initial profile, ...
0
votes
0answers
89 views

Volume by NIntegrate gives zero

I want to Integrate the following expressions for different p < n and 2 < n with p and n both natural numbers: ...
1
vote
1answer
85 views

Plot a numerical integration as a function of a variable

Suppose we have a function that is hard to evaluate analytically but a numerical estimate suffices. For example consider the $f(x,\Lambda) = \Lambda\cdot \sin(x)$ where $\Lambda$ is some parameter I ...