Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
0
votes
1answer
66 views

DSolve and Plot [closed]

I was working on this equation to solve and plot it, but I'm little bit confuse?! ...
2
votes
2answers
99 views

ParametricPlot inside of ParametricPlot

I don't know why the following is not working! The code has a function y[x] then I have g[t] then I want to plot ...
1
vote
0answers
142 views
+100

Optimization for numerical integration of Airy function and using NIntegrate inside NDSolve

Sorry for the long post. I need to integrate a function which uses the trajectory data given by the Lorentz force equation. We have the electromagnetic field: $$ \vec{E}=E_0 \cos{\omega(t+\bar{z})}\...
2
votes
1answer
76 views

What's wrong with SetDelayed? The body of the function works alone, while setdelayed to it as $f[x\_]:=func$ gives the wrong answer

So I was writing a function to get the poincare map of a given dynamic system, for example, the duffing oscillator. I obtained the time series in advance, then take the poincare map based on this time ...
3
votes
1answer
178 views

Why can I not numerically integrate a smooth, integrable function?

Consider the function $cosec(t)sin(3t)$ on the interval $[0,\pi]$. This is a perfectly well-behaved smooth function, as can be seen when plotting it: ...
0
votes
0answers
38 views

The integrand has evaluated to Overflow, Indeterminate or Infinity

I'm tasked with investigating the decay rate of clusters over a period of time, the decay rate is given by ; ...
2
votes
1answer
112 views

Finite difference method for solving coupled differential equations

I am trying to solve the following coupled differential equations: $\dot{c}_{1}(t)=-\int_0^t \alpha_{1}(t,s)c_{1}(s)+\beta_{1}(t,s)c_{2}(s)\,ds-\frac{i}{\hbar}\lambda c_2(t)e^{+i(\omega_1-\omega_2) t}$...
3
votes
2answers
117 views

Specifying options to underlying `Integrate` when using `NExpectation`

I'm computing the max over a set of uniformly distributed random variables. I know that this value converges to 1 as the number of variables increases. Mathematica is having difficulty computing the ...
2
votes
0answers
50 views

Solution to differential equation only starts at random times (numerical error?)

I am solving a set of differential equations with an oscillatory forcing (square wave). Instead of the solution starting to oscillate immediately it stays still until some time. That varies with small ...
0
votes
1answer
43 views

Integrate and InverseFunction

I solve an easy example to check that Mathematica can understand the difference between ArcTan and ArcTanh but as you see here I can't get Arctanh??!! Even I don't know why the inverse function is not ...
0
votes
1answer
37 views

Defining Numerical Integral Functional [closed]

In some sense the question is a combination of defining an operator and defining numerical integration with parameters. For example, I want to define $I[f] = \int_0^1 f(x)dx$. and tried ...
2
votes
2answers
86 views

How to realize NDSolve by NSolve with the implicit constraint equations?

Daniel post the amazing code to realize numerical integrators, I think it is useful to the kind of one-step explicit equation like x[k+1]-x[k]== constant_number. In ...
0
votes
1answer
54 views

How to realize NDSolve by Solve?

I want realize the NDSolve by Solve,so I read some numerical integration resource. In common setting, ODEs can be solve by Euler ...
0
votes
0answers
25 views

Optimizing an 2D-NIntegrate in terms of speed

I am trying to optimize the following function further in terms of speed while maintaining the given Precision and correctness. The function decribes the two dimensional convolution of a sum of Bessel ...
0
votes
1answer
48 views

how to adjust the limits of this numerical integral?

I have a complicated function as follows: ...
2
votes
2answers
79 views

Calculation of composite integrals

I am facing trouble calulating the following integrals. Could you give me any advice? My code is the following: ...
0
votes
1answer
66 views

Do these integrals really diverge? [closed]

I have the following function which I want to Integrate from zero to infinity: ...
0
votes
0answers
40 views

NIntegrate seems to not recognize multiplication of Piecewise function and f[t_]:= function, Why?

Considering inputs: vti={0, 1.5, 2.4, 5.0675, 7.735, 10}; Vscc=1.5; PSA=0.025; f=0.6; m=10; I defined a function "pwtemp2", using "FC1" and &...
0
votes
0answers
28 views

Efficient ways to calculate a cumulative sums (integral) for Plotting [duplicate]

I want to calculate cumulative integrals of the form $$ f(x) = \int_{-\infty}^x dt\ F(t) $$ efficiently in Mathematica. $F(t)$ could be a simple function but also some random function that does not ...
2
votes
3answers
113 views

Integral using LogGamma fails

For the Matlab code: integral(@(x)(gammaln(x+1)+0.57721566 *x)./x.^2.5,0,1e9) I get =5.469... (almost instantaneously) Trying the equivalent in Mathematica 12.3: <...
0
votes
1answer
57 views

Wrong sign with NIntegrate

I'm using Mathematica to integrate this function: ...
4
votes
1answer
70 views

Using the result of NIntegrate as a potential in NDEigensysem

I am trying to find the eigenvalues and eigenstates of a Hamiltonian with a potential which cannot be analytically defined. In particular, it is the integral of the product between two functions: <...
0
votes
1answer
66 views

How to get the numerical answer to NIntegrate[t^(1/3)-t^(2/3),{t,-1,0}] in Reals only

I need to integrate the expression (t^(1/3)-t^(2/3)) from t=-1 to t=0, using Mathematica version 7, and I want the real answer only. How do I do this? I am not sure whether I use NIntegrate or if it ...
-3
votes
1answer
65 views

Confused on Numerical Integration: Making a plot [closed]

I want to make a plot for the following integral: $$\frac{4B^{\frac{3}{2}}}{\sqrt{\pi}}\displaystyle\int_{\sqrt{2gz}}^{\infty}dv\frac{v^2 e^{-Bv^2}}{\sqrt{v^2-2gz}}$$ I would like to plot this for ...
2
votes
1answer
60 views

Strange behavior of NDSolve (Error NDSolve::ntdvdae)

i discovered a weird behavior using ```NDSolve``` to solve a set of differential equations. Let me outline my problem: I need to solve a set of differential equations. These are equations of motion ...
3
votes
2answers
160 views

How to do the following integration?

When I Integrate the function fx = Sin[theta]^2*Exp[-(a/Sin[theta]^2)] Integrate[fx, {theta, 0, (Pi)/2}] [a is a constant] it gives the warning ...
1
vote
1answer
82 views

Strange result for an integral containing Meijer G-function

The question is about Mathematica's result for the integral $$ \int_0^\infty \frac{16}{\pi^2} \left( \frac{\sqrt{\pi}}{4} r^2 % G_{1,3}^{2,1}\left(\frac{r^2}{4}\Bigg| \begin{array}{l} 0 \\ 0,0,-\...
4
votes
1answer
104 views

Eigenvalue problem for Fredholm integral

I have trouble solving this task to find eigenvalues and eigenvectors for the Fredholm integral. I could not find an analytic solution to the equation. That is why I am trying to solve it numerically ...
12
votes
2answers
1k views

How can I use fast Fourier transform (FFT) to solve a PDE (heat equation)?

I'm trying to solve a one-dimensional heat equation (PDE) with the Fourier transform numerically, in the way it was done here. The equation: , is subject to the initial condition: , where U(x,t) is ...
0
votes
1answer
42 views

NumericQ or NumberQ don't work in nested numerical integrations (NIntegrate) [closed]

I was trying to numerically perform the nested integration here below $$ f(a)=\int_0^{a}\biggl(\int_x^{\infty}K_{\frac{1}{3}}(y)dy\biggr)dx, $$ where $K_{\frac{1}{3}}(y)$ is a modified Bessel function ...
4
votes
1answer
122 views

How to solve Coupled a Parabolic and Elliptic PDE in NDSolve?

I want to solve a mixed PDE Parabolic-Elliptic system in 3-dimension (rectangular coordinate), as shown below: The respective code version with parameters value, boundary and initial conditions is, <...
4
votes
1answer
85 views

Problem with non-linear system of PDEs

I wish to solve the following system of hyperbolic PDEs: $\frac{\partial y}{\partial u}=\alpha \sqrt{2y-y^2}$, $\frac{\partial y}{\partial v}=-\frac{1}{\alpha}\frac{\partial\alpha}{\partial v}\:\left(...
2
votes
2answers
69 views

How to improve precision of NIntegrate while integrating a simple 2D Gaussian distribution?

I have the following expression to integrate $$ Overlap=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}dt_{1}dt_{2} \left(\frac{\sqrt{\Gamma } (e^{-\frac{1}{2} \Gamma ^2 (t_{1}-t_{01})^2}}{\sqrt[4]{\pi ...
0
votes
2answers
65 views

Integrate of simple equation but is not solving!

I have this simple integral but I don't know why Mathematica can't solve it?! FullSimplify[Integrate[x/(-x^2 + a x + b)^(1/2), {x, Sqrt[b], Sqrt[R^2 + b]},Assumptions -> {a > 0, b > 0}]]
2
votes
1answer
55 views

"Sparse" Overflow error in NIntegrate

I want to evalutate an integral $$I = \int_{-0.01}^0 \int_{-0.01}^0 \left(\frac{1}{\sinh|t_2+t_1+T| \sinh|t_2+t_1|}\right)^{2/m} \left(\frac{\sinh|2t_1+t_2+T|}{\sinh|t_1+T|}\right)^{1/m} \left(\frac{\...
2
votes
1answer
59 views

NdSolveValue Freeze sensitive to initial condition

I am trying to solve the following system of non-linear differential equations: ...
0
votes
1answer
40 views

NIntegrate::zeroregion error outside the integration domain

I am trying to integrate a function $$\int_R \frac{1}{(\sinh|T-t_1+t_2|)^{\frac2m} (\sinh|t_1-t_2|)^{\frac2m}} \left(\frac{\sinh|t_2|}{\sinh|t_1|}\right)^{\frac1m} \left(\frac{\sinh|T-2t_1+t_2|}{\sinh|...
1
vote
0answers
25 views

Exclusions in NIntegrate automatically uses GlobalAdaptive method?

I tried to integrate a function using LocalAdaptive method. However, if I add Exclusions option in addition to ...
0
votes
0answers
85 views

Non linear first DE with lot of parts

I want to know how I can solve this equation in Mathematica I guess I missed something!! DSolve[ {a (h[a])^2 h'[a] +(nh[a]/ a^2) + m(h[a])^3 - l (h[a])^2 - t == 0}, h, a] h[a] is my function and n,m,l,...
0
votes
0answers
44 views

How to speed up the multiple sums and integration?

I want to numerically calculate a sum with multiple variables and then integrate the whole expression. Any solutions to speed up the process? ...
0
votes
1answer
69 views

Numerical integration precision issue

...
-1
votes
3answers
93 views

why this NIntegrate doesn't work?

I intend to run a NIntegrate inside a Do loop. At first I import the integrand as a txt file and then number it using loop ...
0
votes
2answers
94 views

Integration NSolve problems

I have some problems in solving this equation numerically in Mathematica. Mathematica gives me the error message "NSolve::nsmet: This system cannot be solved with the methods available to NSolve&...
4
votes
1answer
125 views

Calculate median of pdf using NSolve [closed]

I was trying to compute the median of a pdf using NSolve, defined such that $$ \int_{0}^{\rm median}p(x)dx = \frac{1}{2} $$ but NSolve seems unhappy about solving for an upper limit of an integral. A ...
2
votes
1answer
86 views

How to solve this set of integrated PDEs

Could anyone help me solve set of pdes with embedded integration? The pdes below is solvable , but can not be solved when I tried different parameters such as ...
0
votes
2answers
81 views

Using NDsolve with WhenEvent is not working

I am trying to use WhenEvent in this nonlinear equation system: $\ddot r-\dot\phi^2r+9.8(\sin\phi-0.7\cos\phi)=0$ $1.2(1+20(r^2+2^2+4r\sin\phi)^2)\ddot\phi+\dot\phi+...
6
votes
2answers
457 views

Real-valued integral gives large imaginary part

I found a very strange result in Integrate command. I numerically integrated $$\int_{-1}^1 \int_{-1}^1 \frac{1}{|x|^{2/5} |y|^{3/10} |x-y|^{7/10}} dx dy.$$ ...
-1
votes
1answer
36 views

Is that possible to take numerical integration of a function that depends on other variables in addition to the integration variable? [closed]

As I know, the result of a numerical integration should be a number. However, there are situations at which we have a multivariate function but we want to integrate only over one variable and use the ...
3
votes
1answer
114 views

Difference in results between Integrate and NIntegrate

I was trying to ocmpute the line integral between the two zeroes of the function $f(x)=\sqrt{\frac{-x^2+x-1}{x^2(x-1)^2}}$. The zeroes are located at $(-1)^{1/3}$ and $(-1)^{2/3}$. I used the ...
5
votes
3answers
415 views

`NIntegrate` with singularity does not work

Consider the following integral $$\int_{-\infty}^\infty \int_{-\infty}^\infty \frac{e^{-x^2-y^2}}{|x^2+y^2-1|^{0.6}} dxdy.$$ By changing to polar coordinate analytically and putting the result into ...

1
2 3 4 5
59