Questions on the use of numerical functions NIntegrate and NDSolve.

learn more… | top users | synonyms

1
vote
1answer
54 views

How to solve in principle such coupled ODEs

One example for coupled ODEs from the Mathemtica help center reads ...
0
votes
0answers
22 views

NDSolve: Improperly assigned stepsize

This is not a question which I estimate is aided in answering by providing complete code, which is excessively long. I ran an NDSolve[] at ...
0
votes
0answers
34 views

NDSolve and piecewise functions

I'm trying to use NDSolve on a Pde for a function that is made up of several pretty complicated functions, most of which are themselves functions of an underlying piecewise function. When I try to ...
2
votes
3answers
201 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 an approximation of integrals by parabolas. I tried to modify MarcoB's code, ...
0
votes
1answer
144 views

Trapezoid approximation to definite integral

This question is related to Graphically approximating the area under a curve as a sum of rectangular regions. I now was trying to adapt the code by MarcoB to get the approximation of the integral by ...
3
votes
1answer
54 views

NDSolve Step Size Effectively Zero

I'm trying to solve a PDE for a function of 2 variables. The most accurate parameterizations of this equation are very unwieldy and involve numerous piecewise elements, and so right now I'm trying to ...
0
votes
1answer
87 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 ...
3
votes
2answers
100 views

In NMinimize, how can I efficiently handle NIntegrate errors for non-integrable functions?

I am using NMinimize to find parameters that minimise the integral of a function in the least squares sense: ...
0
votes
0answers
15 views

Seconde Derivatives of an integral [closed]

$$ g(x) = \int_{-\infty}^{x^2/2} e^{-(x^2+1)t^2}dt\,. $$ Trouble calculating the first and the second derivative of this function.
0
votes
1answer
63 views

Numerical integration of a numerical integration [closed]

I have a complicated function $f(x)$ whose analytical form does not exist for the following integral $$g(x)=\int_0^x\mathrm{d}x'\,f(x'). $$ I finally need to evaluate the following integral $$\int_0^...
3
votes
1answer
72 views

Convergence of a multiple numerical integration

I would like to define the following function $F(A,\nu)$, which is the result of a numerical integration, and needs the following function definitions. ...
7
votes
4answers
179 views

How to avoid repetitive calculation when doing numerical integral?

Suppose I have a function f[x] which is very complicated, together with a function g[f[x]]+h[x] to integrate. That is: ...
1
vote
1answer
105 views

Approximating Integral under 2D Interpolation function

First, I have already been working on this problem, and have asked a similar question previously here. I am trying to find the integrals of 2D interpolation functions that are output from ...
11
votes
1answer
263 views

Numerically evaluating an integral related to Cantor's staircase

Cantor's staircase $F_C(x)$ is a well-known "pathological" function: Plot[CantorStaircase[x], {x, 0, 1}] The MathWorld link given above claims that $$\int_0^1 ...
10
votes
0answers
161 views

Strange behaviour of integrals with Cos, Sin, and Exp

During the study of the problem How to solve this integration? I have discovered a strange behaviour of some integrals. I would consider it a bug. ...
-1
votes
1answer
51 views

Given a function of two variables, how can I define a 2nd function that is the integral of the 1st w.r.t. one of the variables? [duplicate]

Given a function of two variables, how can I define a 2nd function that is the integral of the 1st w.r.t. one of the variables? I have a function $f(x,y)$ and I want to do the integration like $\int^...
1
vote
2answers
87 views

Numerical Integration involving multiple singularities [closed]

I want to solve the following double integral numerically. This integral has singularities in two points. ...
1
vote
0answers
30 views

NIntegration[?] and N[Integration[?]] [duplicate]

The following Integral answer is different with the following two methods. which one is correct? ...
2
votes
2answers
98 views

How to get rid of the error message when evaluating a highly oscillatory numerical integral?

I have a simple numerical integral with a highly oscillatory integrand: ...
0
votes
0answers
36 views

A problem with the Gauss Kronrod quadrature

I take the risk to ask a weird question but I wonder If i miss something. In the very complete answer to How to solve a non-linear integral equation? How to solve a non-linear integral equation? ...
2
votes
2answers
70 views

Integration vs numerical integration

When I solve the following integral analytically and numerically the answers are different. Why? how can I get similar answers? ...
2
votes
1answer
77 views

Using RegionPlot to draw inequality involving Nintegrate

I'm trying to draw the region where the next inequality is true : $$ r_1 \tau-r_3 \int^{\tau}_{0} C_s(t)<0$$where $$C_s(t)=e^{t-r_5 t} \left(d e^{r_8 \tau }+e^{r_8 (t+\tau )}-e^{r_8 t}\right){}^{-\...
0
votes
1answer
73 views

How to increase the evaluation speed of this numerical integral?

I have a three dimensional integration, which takes about 30s using LocalAdaptive and "GaussKronrodRule". Using ...
3
votes
2answers
241 views

NIntegrate and Integrate giving different results for ill-behaved function

I'm trying to integrate the following function with Mathematica 8: $$ I(a,b)= \int_0^1 \mathrm{d}x\int_0^1\mathrm{d}y \,\theta(1-x-y) \frac{1}{x a^2-y(1-y)b^2},$$ where $\theta$ is the Heaviside ...
0
votes
0answers
32 views

Integral function whose limits are solutions to separate equations

I'm trying to get the function Ne to work, which involves an integral whose limits are the solutions to two different equations. So far, the code runs smoothly, but when I try to plug values into CMB,...
3
votes
1answer
99 views

NDSolve DAE solution order is mixed up

Bug in 10.4.0.0, probably introduced earlier. Compare the two solution sets below: in the first one (x == False), there are only 3 dependent variables while in ...
0
votes
1answer
63 views

Dealing with numerical integration singularities

I'm trying to perform the following integral (numerically) (1) And their behaviour is where PV denotes principal Value. In principle I don't know the functions $\rm{Im}(\alpha)$ and $\rm{Re}(...
21
votes
2answers
1k views

1D Euler equations (fluid dynamics) with NDSolve

Is it possible to accurately solve the 1D Euler equations in Mathematica using NDSolve? For example, let us consider the problem given here: http://www.csun.edu/~...
3
votes
1answer
54 views

How to index multi-dimensional vectors in NDSolve/WhenEvent?

I want to solve a system of coupled ODEs using NDSolve with WhenEvent. But I'm having a hard time trying to index the state ...
0
votes
1answer
82 views

Getting errors from NIntegrate when I try to plot my function

I am trying to 3D plot the function ϕ[σ, λ], but Mathematica keeps refusing to plot for the reason that the output involves complex numbers, even though by ...
8
votes
2answers
282 views

NIntegrate appears to give incorrect results

I am trying to specify a bivariate probability density function in Mathematica. As a check, I would like to confirm that it integrates to one. Here is the function: ...
0
votes
1answer
62 views

How can we plot gamma function numerically?

How can we plot this integration for m=1,\theta = 0.2? Here r_h(lower limit) = 1.
4
votes
1answer
541 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
2answers
948 views

Double integral with variable in the limits

I'm trying to solve this integral: $$ \left(\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}\sigma}e^\frac{-x^2}{2\sigma^2}\left(\int_{x}^{\infty}\frac{1}{\sqrt{2\pi}\sigma}e^\frac{-(y-\mu)^2}{2\sigma^2}...
1
vote
1answer
79 views

How to speed up this code with NMaximize?

I want to maximize the expected exponential growth rate of the portfolio, which contains 3 stocks. I get the adjusted stock price for General Electric, Du Pont, and IBM. ...
4
votes
0answers
57 views

How can I make NIntegrate aware of a singularity along a curve, e.g. a circle in a 3D integral?

I am having some trouble trying to get Mathematica to do a numerical integral over three dimensions which contains a singularity of dimension 1, and I would like some pointers to solid resources on ...
0
votes
2answers
113 views

2d numerical integration [closed]

I'm trying to get a numerical solution for a double integral: ...
0
votes
0answers
39 views

NIntegrate and Integrate seem to over-estimate an integral involving a sharp Lorentzian (Cauchy) distribution

I am trying to do a numerical integral with NIntegrate, but it seems that I get a bigger number than I should. The integral is fairly simple: ...
9
votes
3answers
2k views

NDSolve with vectors

I'm stumped. I'm trying to write this using vectors, but the 2nd derivative isn't being expanded like I expected it to be. This is a system of equations for a projectile with quadratic drag and ...
0
votes
1answer
50 views
3
votes
1answer
109 views

failure of code with Helmholtz equation with point source

I am new to the finite elements package in Mathematica. I have a system of equations, one of which is a Helmholtz equation with a point source in the interior of a bounded domain. The following is the ...
0
votes
2answers
84 views

Multivariate integration of a compicated expression

I have an expression in multiple variables that is something like ...
0
votes
1answer
29 views
2
votes
0answers
109 views

Bug in the “PrincipalValue” method of NIntegrate?

Update 2 The technical support suggests setting AccuracyGoal. As I quote here It does appear that the program is returning an incorrect result along with a ...
1
vote
1answer
53 views
1
vote
0answers
35 views
14
votes
1answer
503 views

Gillespie Stochastic Simulation Algorithm

The Gillespie SSA is a Monte Carlo stochastic simulation algorithm to find the trajectory a dynamic system described by a reaction (or interaction) network, e.g. chemical reactions or ecological ...
11
votes
2answers
2k views

Is it possible to calculate a Lebesgue integral in Mathematica?

As the title says, I wonder if it is possible to calculate a Lebesgue integral in Mathematica, especially when the domain of integration is $\mathbb{R}^N$, or in other words multivatiate Lebesgue ...
28
votes
2answers
483 views

How to implement custom integration rules for use by NIntegrate?

How can NIntegrate be extended with custom implementation of integration rules? This answer of the question "Monte Carlo integration with random numbers generated ...