Questions tagged [numerical-integration]
Questions on the use of numerical functions NIntegrate and NDSolve.
2,661
questions
3
votes
2answers
59 views
Levin Rule Integrate Power of Oscillating Function
I want to numerically integrate a function of the form:
...
4
votes
1answer
66 views
How to discard NDSolve`StateData intermediate data
I'd like to prepare the equations with NDSolve'ProcessEquations and then doing repetitive NDSolve'Iterate for the steps.
I need ...
-2
votes
3answers
69 views
Problem with numerical integration.(Is numerical integration reliable?) [closed]
I just want to use numerical integration, and I can not trust the results and it seems something goes wrong. the problem is as follow :
I have a totally positive two variable function and from ...
2
votes
1answer
73 views
Numerical Integration of KdV Equation by Runge-Kutta 4
I have been asked to reduce the KdV ODE Equation
$d^3/dX^3=(c+6f)df/dX $
to a first order ODE and then solve this ODE by RK4 (Runge-Kutta 4) Numerical Integration.
Analytically, letting c=1 for ...
1
vote
0answers
73 views
Log(x-1) replaced by Log(1-x)
Consider the following input
Integrate[1/(-1 + x) + 2/(2 + x), x]
Using step-by-step to calculate an integral, I get the following answer
Why does ...
2
votes
2answers
164 views
Numerical solution to convection-diffusion equation
I'm trying to numerically solve the following equation
$$\frac{\partial{u}}{\partial{t}}=D\nabla^2u-\vec{v}.\nabla(u)$$
for which -1 $\le$ x $\le$ 1, -1 $\le$ y $\le$ 1, 0 $\le$ t $\le$ 1 with initial ...
1
vote
0answers
47 views
A question about Plot an NIntegrate and FindMaximum is too slow
I need to DensityPlot an NIntegrate where near the maximum piont. So I need to use ...
0
votes
0answers
80 views
When to trust the result of numerical integration in mathematica?
How does one know when to trust the result of numerical integration, using NIntegrate, for higher (5 or 6) dimensional integrals in mathematica? For example, I get the following result
...
0
votes
0answers
41 views
How to solve the attached integral analytically? [closed]
How to solve this integral analytically as well as numerically
0
votes
1answer
90 views
When I define a Piecewise function containing a solution to a partial differential equation, the function cannot be evaluated numerically
I need to find an integral, in which there is a function
YO [x_] =
Sum[E^(((I h PI)/(Ī» f))x^2) Subscript[Y, h][x, z = 13.5], {h, - 5, - 1}] /. s
where ...
1
vote
4answers
122 views
How to integrate the interpolated data over the region in which it is non-zero?
Consider some toy-function which I then interpolate:
...
2
votes
1answer
61 views
Trying to solve non-linear coupled differential equation with boundary conditions at different points
I'm trying to solve systems of dif. equations with boundaries conditions at distinct points such as:
...
1
vote
1answer
115 views
numerical integration error for heavily oscillatory integrands
Let $n$ be a positive integer and $p>0$. Define
$$
f_{n,p}(t) = \frac{(p \ln t - 1) (\sin^{2n} t)}{t^{p+1}},
$$
and I was trying to look at the behaviour of
$$
\sqrt{n}\lim_{p\to 0^+}\int_0^\infty ...
4
votes
2answers
289 views
Calculating a double integral
I want to calculate the following integral:
$$\int^{10}_{0}\int^{\pi}_{0}\sqrt{(37-\frac{45\cdot37\cdot x^2}{74\cdot 150})^2\cdot \sin(t)^2-(40-\frac{27\cdot37\cdot x^2}{16\cdot 150})^2\cdot \cos(t)^2}...
1
vote
1answer
83 views
How do I get the numerical solution of this equation?
So I have a rather non-trivial differential equation. I can't solve it analytically so I want to solve it numerically using NDSolve. But the thing is that the output just becomes what I had as input, ...
6
votes
4answers
296 views
NIntegrate Oscillating kernel
I have a finite highly oscillating integral of the type:
NIntegrate[x^2 Exp[I f[x] s] , {x, 0, 1}]
where f is a simple function ...
3
votes
1answer
68 views
6
votes
2answers
683 views
What is the reason for failing to solve the following equation?
I have a simple differential equation
$$
\frac{df(T)}{dT} = g(T)(f(T)-f_{\text{eq}}(T)),
$$
where $g,f_{\text{eq}}$ are some smooth functions, and $T$ is an analog of time, but the evolution ...
0
votes
1answer
36 views
Integration of Bessel function including specific rings
Now, I am interested in the rings of Bessel function. So, basically, I used cylindrical coordinate to make it easy to figure out rings of Bessel function.
...
4
votes
1answer
146 views
Highly oscillatory region in plot
I am new to Mathematica and this forum so apologies in advance if I am not doing anything properly (do let me know). I am trying to visualize the imaginary part of an integral of ...
7
votes
3answers
368 views
Differential quadrature method fails on 4th order PDE with nonlinear b.c. as grid gets denser
I am using differential quadrature method (DQM) to solve the following initial-boundary value problem:
$$\frac{\partial^2 w}{\partial t^2} + \mu \frac{\partial w}{\partial t} + C_0 \frac{\partial^4 w}{...
3
votes
1answer
66 views
Is there a reason behind strange noise appearing for some coefficients of polynomial in NIntegrate?
It occurs for instance here:
b = -1; c = 1; d = -1;
Plot[NIntegrate[1/(a*x^3 + b*x^2 + c*x + d), {x, 0, 10}], {a, 0, 2}]
but not with these values:
...
1
vote
1answer
86 views
Find minimum of a function defined via NIntegrate [closed]
I need to find the minimum of a function f(t) = int g(t,x) dx over [0,1].
I used
g[t_, x_] := *huge expression*
f[t_?NumericQ] := NIntegrate[g[t, x], {x, -1, 1}]
...
4
votes
1answer
132 views
Step size is effectively zero
I've been trying to solve Bodewadt flow equations which is a system of differential equations.
$$\begin{align*}
F^2 - G^2 + HF' - F'' + 1 &= 0 \\
2GF + HG'-G'' &= 0 \\
2F + H' &= 0
\end{...
3
votes
1answer
84 views
Limit takes too long
I want to compute the following limit
Limit[
Integrate[BetaRegularized[(2 h - h^2), (d - 1)/2, 1/2], {h, 0, 1}],
d -> Infinity
]
However, surprisingly, it ...
4
votes
2answers
310 views
Ways to speed up numerical integration
This first code block is just to create the functions I'm considering. Actual problem follows.
...
1
vote
0answers
75 views
How to plot integral of a gradient function
For $f : \mathbb{R} \longrightarrow \mathbb{R}$ continously differentiable and $\phi \in [0,\pi/2]$ let
$$F(x) = \int \frac{f'(x)-\cot \phi}{1+ f'(x) \cot \phi} d x$$
be a clockwise 'rotation' of $f$.
...
1
vote
0answers
76 views
Integrating an Interpolating Function While Using MaxValue
I have code meant to calculate the following integral,
$I_{c}(B_{y},B_{z})=\underset{\phi'}{\text{Max}}\int\limits_{-a/2}^{a/2}\int\limits_{0}^{b}\sin(\phi'+yB_{z}+zB_{y}+\phi_{0}(y))\mathrm{d}y\...
2
votes
1answer
90 views
PDE system. convection dominated, method AffineCovariantNewton failed, etc
I'm trying to solve numerically the following system in a rectangular region,
$\begin{align}
\cos\theta\frac{\partial\beta}{\partial x}+\sin\theta\frac{\partial\beta}{\partial y}&=\beta s\\-\sin\...
0
votes
0answers
52 views
Nonlinear Differential Equation with Paramaters in Sqrt Function
For a university project, I am trying to see if my system will have choked flow and also plot the resulting pressure spike. I set up the system below to try to model the transient response.
I am able ...
1
vote
0answers
27 views
How to define smooth random initial conditions consistent with boundary conditions for this 1+2D PDE?
I wrote a fully working code to numerically solve a non-linear variation of the classic 1+2D waves equation. Here's a stripped down version of it (classic waves equation), with static initial ...
0
votes
0answers
61 views
How to evaluate the following integral faster?
I have a problem with the time required for evaluating the multi-dimensional integral and would be grateful for any help in reducing this time.
First of all, there are some pre-definitions used in the ...
2
votes
4answers
193 views
1
vote
1answer
76 views
How to replace the expression in nest?
I need to calculate the following function with replacement in recurrence
...
1
vote
1answer
107 views
Fourier Series of Cosh
I'm trying to calculate the Fourier Series of Cosh[gS[[2]] z]. In the Range of (-b, b) In order to do that, I'm using the ...
2
votes
1answer
53 views
NDSolve second-order PDE with 4 variables
I'm trying to numerically solve a second-order partial differential equation in 4 dimensions. The PDE is a Fokker-Planck equation and the variables are the real and imaginary parts of the field of two ...
2
votes
1answer
145 views
(Numerical) calculation of nested integrals
The problem
I'd like to (numerically) compute nested integrals of the type $$I(a;k) \equiv \left( \prod_{i=1}^k \int_0^\infty \mathrm{d}x_i \right) \exp \left( - \frac{1}{4a} \sum_{i=1}^k \left( x_i - ...
0
votes
1answer
92 views
NDSolve problem with maxit, ndsz, and impsagpg
I'm trying to solve a system of 24 non-linear differential equations using Implicit RK method. My code works perfectly for simple case, i.e., BB=0, but for non-zero BB, Mathematica gives errors: ...
4
votes
2answers
111 views
Problem with NIntegrate over a piecewise function
The following code seems to generate wrong results
...
0
votes
0answers
87 views
Optimal resolution of a wave equation
I'm not very familiar with numerical resolution of partial derivatives equations in Mathematica, and I would like to optimize the following code. It's about a self-interacting wave propagating in 2D, ...
1
vote
1answer
103 views
Boundary conditions at infinity for 1+2D wave equation in Mathematica 7
To solve a waves equation, I need to define some boundary conditions. The wave is propagating on an infinite plane, and it's not a membrane fixed on some fixed support. I'm have difficulties in ...
1
vote
0answers
67 views
How to numerically solve this partial differential equation and plot the output? [duplicate]
Using Mathematica, I would like to numerically solve the following partial derivatives equation :
$$\tag{1}
\frac{\partial^2 \Phi}{\partial T^2} - \frac{\partial^2 \Phi}{\partial X^2}- \frac{\...
1
vote
1answer
68 views
NDSolve becomes very slow when the integration domain is 4 dimensional
I am trying to solve a PDE problem on a 4d manifold (3 space + 1 time). However, NDSolve becomes very slow when I jump from 3 to 4 dimensions. Here I want to integrate a simple ...
0
votes
1answer
53 views
Evaluate a numerical integral [closed]
This is problem 2.6 of Griffiths but I want to get the numerical integral of
Ļxt = NIntegrate[Sin[a k]/ k * E^(I (k*x - ā*k^2*t/(2 m))), {k, -ā, ā}]
But ...
1
vote
1answer
36 views
Doing something when a condition is met
I am attempting to solve a set of coupled differential equations using ParametricDSolveValue. I want a point, where a condition is met, to be marked on the corresponding plot.
The condition I want the ...
1
vote
1answer
38 views
Plotting ParametricNDSolve Value
I am trying to solve a set of coupled differential equations, where I would create plots for a(t) and e(t), where the parameter RAST can be varied. However, every time I try to plot, I get blank plots....
0
votes
0answers
55 views
Mathematica NIntegrate problem
Here is my code:
The problem is that I always see these messages every time I run it
They always say " something has evaluated to a non-numerical values of all sample points in the region"
...
0
votes
1answer
68 views
Matrix as the discretization of a function $u$ over a rectangle in 3D, how to integrate fast along the axes
I have a function $u$ from 3D to 1D approximated in a list uu and I want to calculate e.g.
$$\int_0^1 x\cdot u(x,y,z)dx$$
or
$$\int_0^1\int_0^1\int_0^1 u(x,y,z)...
1
vote
0answers
31 views
Why does the InterpolationPointsSubdivision method fails to calculate this integral correctly?
Consider some dataset.
I use the following code to interpolate it:
...
2
votes
2answers
123 views
How can I evaluate a certain integral numerically?
The problem arises as value of $\gamma_0$ is very high (on the order of 10^13), whereupon $\exp (-\gamma_0\,h_a^2)$ is becoming very small and ultimately zero. Can anyone help me to evaluate this ...