Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
1
vote
0answers
40 views

Reduce the time of computation for $5$-dimensional numerical integration

I need to perform (numerically) the $5$-dimensional integral given in the code below for a large number of values of $\epsilon$. The code I have at the moment takes $\sim 11$ minutes and returns an ...
0
votes
1answer
32 views

step-by-step solution unavailable (( possible intermediate steps ))

When using the (( WolframAlpha["integrate 1/(2+Sqrt[1-x]+Sqrt[1+x])"])) function to find integration steps, this message appears to me what is the explanation and ...
0
votes
1answer
28 views

Find parameter value for which sharply-peaked constrained 3d-integral equals 1

I want to find the value (desirably to high-precision) of the parameter $i$ for which the constrained 3d integration ...
4
votes
2answers
92 views

Numerical Landau Damping dispersion relation, Principal value numerical integral

Greeting, I'm searching to solve numerically the dispersion relation for Landau Damping, it is: $$ 0=1+\frac{1}{k^2}\int_{-\infty}^{+\infty} \frac{\partial_v f_{0}}{w/k-v}dv$$ Which then can be ...
2
votes
0answers
52 views

Why is the sum of the series calculated using the integral

I tried to calculate the sum the Harmonic series via NSum up to a huge limit and got an error: NIntegrate: Numerical integration converging too slowly; suspect one of the following: singularity, ...
1
vote
1answer
43 views

Solving multiple integral with symbolical limits [closed]

I am trying to solve a double integral, though I am not sure how I could potentially handle the symbolic limits. I have attempted the following code: ...
6
votes
3answers
417 views

Numerical computation of a double integral

I wish to numerically evaluate a function of the form $$ P(v_0) = \frac{e^{\int_0^{v_0}F(v)dv}}{\int_{-\infty}^{+\infty}e^{\int_0^{v_1}F(v)dv}dv_1} $$ In the denominator is the normalization ...
3
votes
2answers
79 views

Which method should I use for NIntegrate near a singularity?

I am looking at the following integral: $$I= \int_{-\infty}^\infty d\tau_3 \int_{-\infty}^\infty d\tau_4 \frac{1}{(1+\tau_3^2)^2} \Phi \left(\frac{1+\tau_4^2}{1+\tau_3^2},\frac{(\tau_3-\tau_4)^2}{1+\...
3
votes
1answer
45 views

IVP Piecewise ODE: Changing the Domain outside region of interest changes result dramatically

Good afternoon, I am attempting to solve the following ODE: ...
0
votes
2answers
24 views

Problem with NIntegrate evaluating to non-numerical value

I want to know why this error happens and how to fix this problem. The code is ...
0
votes
0answers
67 views

Runge-Kutta on coupled equations

I'm still pretty new to Mathematica and I'm having a few issues solving these coupled equations. I've attempted using NDSolve with method "ExplicitRungeKutta" as well as with no method, and have had ...
1
vote
2answers
100 views

How to make an Animate plot more smooth

I am using Animate to animate the result of a system of coupled differential equations as I vary an initial condition A: ...
0
votes
1answer
88 views

Evaluation of contour integral seems be incorrect

I am performing an contour integral of the form ...
2
votes
1answer
31 views

Using NIntegrate inside RecurrenceTable

I'm trying to solve self-consistent equations of the form ...
1
vote
3answers
52 views

Two variables integrals: How to integrate with respect to one variable, then evaluate and plot the result with respect to the second variable? PART 2

I have got a very usefull answer to my problem yesterday. Now, I wish to improve the code, including a new variable in other to obtain a 3D-plot. Here is the sample i wrote already. Please check any ...
2
votes
1answer
63 views

Two variables integrals: How to integrate with respect to one variable, then evaluate and plot the result with respect to the second variable?

I have started using Mathematica for a moment, but I'm now struggling to make some more advance calculations, for which I don't know how to overcome some difficulties. In fact, my wish is to evaluate ...
0
votes
1answer
51 views

How to get a function from a numerical integration?

I wold like to know how to get a function from a numerical integration. Here is an example: h[y_?NumericQ] := NIntegrate[y*Sin[Sin[x]], {x, 1, 2}] h[2] Then my ...
1
vote
1answer
38 views

NIntegrate does not evaluate this finite integral composed of divergent parts

I would like to numerically evaluate the following integral: $$I = \int_{-\infty}^\infty d\tau_3 \int_{-\infty}^\infty d\tau_4 \frac{1}{1+\tau_3^2} \left\lbrace \frac{2}{1+\tau_4^2} \log (\tau_3 - \...
2
votes
2answers
79 views

Using Multiple Initial Conditions

Basically, I have a set of differential equations that I need to solve for exactly 100 different initial conditions (given as lists for each initial condition), and then plot each solution. Here is ...
1
vote
0answers
15 views

How to dynamically increase sampling rate for NIntegrate?

I am trying to numerically integrate a messy function over the range $(0,\infty)$. Rather than integrating to $\infty$, I programmed a dynamic cutoff for which I can specify a desired precision. For ...
1
vote
0answers
33 views

How can I be sure of the result of NIntegrate when the integrand diverges at the boundaries?

I would like to perform the following integral: $$I:=\int_0^1 d\alpha\ (1-\alpha)^{-1/2} \left(\log (1-\alpha) + \text{Hypergeometric2F1}^{(1,0,0,0)}(0,1,1,1-\alpha) - \text{Hypergeometric2F1}^{(0,1,...
2
votes
3answers
102 views

Specifying condition with NIntegrate

I have an integral $$ P_{\frac12 + \mathrm i\mu}(\eta) = \frac{\sqrt{2}}{\pi} \cosh(\pi\mu) \int_{0}^{\infty} \frac{\cos(\mu\tau)}{\sqrt{\cosh\tau + \eta}} \mathrm d\tau, \quad \eta \geq 1, \quad \mu ...
0
votes
0answers
37 views

How should I correct this unstability of the PDEs results?

I try to solve PDE as the following code but it seems to have an error. I How should I correct this? Thank you ...
2
votes
1answer
103 views

Problem with NIntegrate inside NDSolve

This is my first post on this site, please forgive me if I screw up to copy my code in a nice way.. I am trying to solve a set of 3 coupled differential equations with NDSolve, where one of the terms ...
3
votes
1answer
35 views

What are some strategies for infinite numeric integrations with “cutoffs”?

I am working on a Mathematica project that involves many numeric integrals, each of which should be integrated over the domain {k, 0, Infinity}. I assumed that ...
5
votes
1answer
185 views

Why do the Integrate and NIntegrate give different results?

Bug introduced in 12.0 or earlier and persisting through 12.0.0 or later I'm using Mathematica to calculate the following integral, but I don't know why the result of using ...
4
votes
1answer
95 views

Raabe's Integral

Raabe's integral formula says $\int^1_0$ Log$~ \Gamma(p+t)dt=p$Log $ p-p +\ln\sqrt{2\pi}$ Here Log is the Principal Branch. Take ...
4
votes
2answers
77 views

A suitable strategy to estimate numerically a complex integral. How to use “MaxErrorIncreases”?

I am trying to numerically estimate a complex 3D integral. Here is its version considerably reduced for the purposes of the present discussion: ...
1
vote
0answers
56 views

Combined probability function

I have two PDFs given by: ...
2
votes
1answer
53 views

Numerical solution of a differential equation with a condition on a parameter

I'm considering the Mazenko equation as it's written in https://doi.org/10.1103/PhysRevB.46.10594 (eq. 7) \begin{equation} f''+\left(\frac{1}{x}+\frac x 4 \right)f'+\frac \lambda \pi \,\tan\left(\...
0
votes
0answers
30 views

Evaluating Interpolating functions from NDSolve to solve for a specific time, and evaluating the functions at that time

For one of my homework assignments in a mathematical modeling class, we were supposed to take a 2d system of second order differential equations, and convert it to a 4d first order system of ...
6
votes
2answers
139 views

Plotting values obtained using numerical integration

I have an integral which doesn't give a closed definite expression. The command ...
2
votes
0answers
31 views

How should I evaluate the numerical integral of a function wich has an divergent part on the denominator

I want to evaluate (numerically or symbolic) the following integral in Mathematica: $$ \int_{0}^1-\frac{2 \pi r^2 e^{-\frac{1}{4} \delta ^2 k^2 r^2} J_0(k r \rho )}{r^2-1}dr $$ However, symbolic I ...
1
vote
0answers
36 views

NIntegrate 3D Interpolation function in a region extracted from ListContourPlot3D

I have a list of 3D volumetric data points, e.g. for every position in 3D space there is a value. What I want to do is to firstly use "Interpolation" to get a function form of the data f[x,y,z] and do ...
2
votes
1answer
67 views

NIntegral and Integral compare: which one is more accurate when integrand is not integrable?

I am calculating the following integral $$I=\int_0^1 e^{-c_1x^2+c_2x}\mathrm{erf}(c_3x+c_4)dx,$$ with Integrate and NIntegrate ...
2
votes
1answer
188 views

How to calculate a hard definite integral?

I have the following function of $4$ - variables ...
2
votes
1answer
98 views

Question about accuracy of this improper integral calculation

I have an integral (where $q$ is a constant and $u\geq1$) $$\boxed{I = \frac{e^{(-q/4)}}{2\sqrt{2\pi}q^{\frac32}}\int_{1}^{\infty}\bigg(\frac{u-1}{u+1}\bigg)\int_{u}^{\infty}\frac{xe^{-x^2/(4q)}}{\...
0
votes
0answers
22 views

Calculate Energy of signal by coefficients of continuous wavelet transform

I have applied ContinuousWaveletTransform to my data. And now I want to calculate the Energy of signal in accordance with Parseval theorem To find Energy I would like to use quadrature formula: . I ...
1
vote
0answers
58 views

Building `W[f_]:=w[t[f]]` out of solutions `w[t]`and `f[t]`of `NDSolve`

I am solving a system of ODEs with NDSolve to some initial condition and obtain two solutions w[t] and ...
6
votes
2answers
117 views

Volume integration with a condition

I have a set of parameters $x_1, \dots x_4 \in (0,1)$. I want to find the volume of the subregion of this 4d cube satisfying $$\sin^{-1}(x_1)+ \dots +\sin^{-1}(x_4) > \frac{3\pi}{2}$$ I've tried ...
1
vote
1answer
58 views

Speed up 2D numerical integration

The integral is not really complicated, but does not return a result in reasonable time ...
1
vote
0answers
28 views

Errors in NDSolve for complex matrices

This is the problem. It is quite simple, and looks unwieldy only because I had to rewrite quaternions as complex matrices. ...
2
votes
1answer
117 views

Plot nested integration of an InterpolatingFunction efficiently

Suppose we have an InterpolatingFunction from NDSolve ...
1
vote
2answers
135 views

Inaccuracy of the Difference between two $\chi^2$ Cummulative Distribution Functions

I have an algorithm which needs to calculate the difference of two Gamma distributions evaluated at some large values. I cannot do this over CDFs because they give $1$ if a large value is evaluated. ...
0
votes
4answers
117 views

How to evaluate that integral accurately and faster?

I've the following integral: $$\int_{-a/2}^{a/2}Cf(x)\sin{\frac{m\pi(x+0.5a)}{a}}\sin{\frac{p\pi(x+0.5a)}{a}}dx$$ where $$f(x) =53.62\cos^4\left(\frac{7\pi\sqrt{x^2}}{9}\right)+3.04\sin^4\left(\frac{...
3
votes
1answer
95 views

Mathematica unable to evaluate function which it can write explicitly in simple form

I have a function $\psi(x,n)$ in mathematica which is quite complicated. However, plugging in $n=0$ gives a simple form. Mathematica knows this (see below), however it is still unable to even evaluate ...
2
votes
2answers
57 views

How to use NIntegrate inside FindRoot?

I am trying to use FindRoot on functions that involve NIntegrate, and Mathematica is throwing undesirable errors even when it ...
2
votes
1answer
121 views

Why can't I solve a system of four third-order partial differential equations using NDSolve?

I solve the problem of optimal control. First, I solve a system of two equations (with respect to the variables p, q, V, n) with already optimal conditions (Kopt and Sopt) to check whether it is ...
0
votes
1answer
36 views

What does <<2>> mean in an output? Double Less than or greater than signs [closed]

An error in my output gives I am trying to understand what the issue is. I was wondering if this <<2>> has anything to do with it, because I don't know what that syntax means. Is <<2>> ...
1
vote
1answer
85 views

Cryptic NDSolve::nlnum when working with matrices

This problem was initially formulated in quaternions, but I had to rewrite them to complex matrices (as they seem to be supported better). Possibly introducing some errors along the way. So the ...

1
2 3 4 5
48