Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Passing Product function through NIntegrate?

I have a set of intervals, Times1, that I have calculated using the following code. This code works well on its own. ...
0
votes
0answers
24 views
1
vote
0answers
34 views

Mathematica crashes with NIntegrate

I am trying to evaluate the following numerical integration ...
2
votes
1answer
91 views

Calculating Residue with NIntegrate fails

Trying to answer this interesting question Principal value from two different axis I observed a problem using Nintegrate: The function ...
3
votes
1answer
103 views

Principal value from two different axis

I have an integral where its limits of integration is from the imaginary axis to the real axis, specifically, $$\int_{\pi i/2}^\infty \frac{dp}{\sinh(p/2) \sqrt{\cosh(p)}}$$ I want to evaluate this ...
1
vote
0answers
101 views

Yet another slow plot involving numerical integration

Well, after reading a lot about how plotting expressions involving NIntegrate can take a lot of time, and how to overcome this issue with ...
1
vote
1answer
65 views

Contour integral does not converge

I have this integral where I want to evaluate it on the imaginary axis. However, it says that it does not converge even though I have introduced a small indentation $a$, ...
0
votes
0answers
36 views

How can I isolate a specific variable to one side in an equation?

Firstly, I will integrate the equation using Simpson's 3/8 Rule since it is quite long to do analytically. All the variables (x, y, r, n, ps, k) are unknowns. I want to make r as the subject. I tried ...
1
vote
1answer
126 views

Contour integral around complex plane

I have this integral where it is singular at the points $p=\{0,\pi i\}$, where the solid contour is given in the image below. My goal is to find the integral in the range $[0,\infty]$ (the horizontal ...
2
votes
1answer
46 views

Passing a Piecewise function of NIntegrate through NIntegrate?

I am trying to pass a piecewise numerical integral (function1) through another numerical integral (function2). When I try this, however, I receive an error that says "t = T is not a valid limit ...
0
votes
0answers
74 views

Numerically integrating interpolating function whose initial conditions vary?

I am trying to numerically integrate--with respect to t0--an integrand (entitled function1 below) that involves an NDSolve interpolating function whose initial conditions are a function of t0. When I ...
1
vote
1answer
83 views

NIntegrate with variable in it

I would like to NIntegrate with a variable in the function. Later I will be series expanding it. Can it be done in Matehematica? I am getting errors for a sample ...
2
votes
1answer
195 views

How to calculate this integration accurately

I need to calculate this integration: $\int_0^{2 \pi}\int_0^{2 \pi}\int_0^{2 \pi}\ F(x,y,z) $ which: $F(x,y,z)=\left\{ \begin{array}{rcl} f(x,y,z)^2 & & {0 \leq f(x,y,z)}\\ 0 & &...
0
votes
0answers
35 views

High-dimensional second-order differential matrix equations

I am working on Lagrangian derived high-dimensional motion equations for a robot in matrix form. The structure of such an equation is known: $M(q)\ddot{q}+C(q,\dot{q})\dot{q}+G(q)=0$ where $q=[\dot{\...
0
votes
1answer
61 views

Highly oscillatory Integral over Airy function

I have to (numerically) integrate this function over all p from to get a function g(x): ...
-3
votes
1answer
61 views

Double NIntegrate

The functions I have are ...
1
vote
0answers
28 views

What are the valid options for the “ParametricCaching” option in ParametricNDSolve?

I am using ParametricNDSolve as part of the calculation of an objective function for an optimization, so I am trying to strike a balance between memory usage and ...
1
vote
0answers
29 views

How to NSolve when an NIntegrate is involved?

I need to find the set of 3rd order polynomial coefficients that will give a bounded exponential function f(x) = Exp[ c0 + c1x + c2x^2 + c3*x^3] a set of specified 0th,1st,2nd,and 3rd order moments. I ...
1
vote
1answer
82 views

Defining a region in Mathematica

I have two functions which are eigenvalues: $$ E_+= a*x-\sqrt{(b-x^2-y^2)^2+d*(x^2+y^2)}$$ ...and... $$ E_-= a*x+\sqrt{(b-x^2-y^2)^2+d*(x^2+y^2)}. $$ How do I define a region $\left|E_{\pm}\right|<...
0
votes
1answer
94 views

NIntegrate over 2D region failed. Simple integrand. Complicated region

The integrand is simply a Gaussian curve over one of the variables PDFTheta[the_] := PDF[ NormalDistribution [0, DeltaTheta/2], the] The region of integration is ...
0
votes
0answers
40 views

Integrand that is divergent at some points

I have a function $f(x)$ where it has a singularity at the point $x=10$. $$f(x) = \frac{-1}{g(x) \sqrt{1 - \frac{a^6 g(x)}{x^6 g(a)}}}, \qquad g(x) = 1 - \Big(\frac{x}{h}\Big)^4, \qquad a=13.128, \; h=...
4
votes
2answers
107 views

Obtain $\{h_1,h_2,\ldots\}$ from $\{f(0),f(1),f(2),\ldots\}$ with $f(s)=\sum_{i=1}^n \exp(-h_i s)h_i$

I need to obtain $\{h_1,h_2,\ldots\}$ when given $\{f(0),f(1),f(2),\ldots\}$ with $f$ defined as follows $$f(s)=\sum_{i=1}^n \exp(-h_i s)h_i$$ We know that $h_i>0$. Is there a way to do this ...
0
votes
0answers
20 views

Nintegrate Using coordinates specified by a matrix

How to do a 3D Nintegrate over a function while specifying the co-ordinates to be used? I have the coordinates in a n*3 matrix and want integral to be performed over those points only.
2
votes
2answers
86 views

NIntegrate doesn't work on regional integration

I use FEM to solve a PDE in a spherical region and I want to integrate the result within half of the spherical region. I wonder why NIntegrate doesn't work here. The integrant should not have ...
1
vote
0answers
128 views

How to solve this differential equation numerically?

I am solving a rather complex differential equation in 4d space plus time. Here is the Mathematica code to do this: ...
1
vote
1answer
91 views

NIntegrate and Integrate give different results [closed]

Good morning, I computed the following integral ...
1
vote
1answer
90 views

Mathematica residual miscalculation

I am trying to apply the residual theorem of Complex analysis for the calculation of an inverse Laplace operator. My function is the following: ...
-1
votes
0answers
67 views

Four dimensional numerical integration

I am trying to perform the following Integral involving Bessel Functions as well as Heaviside Functions: ...
1
vote
1answer
45 views

NIntegrate not evaluating. “Interpolating Function” [closed]

I am trying to numerically evaluate an integral. I have a function to be integrated, ftbI[s,a] with undetermined variable(s) a. ...
0
votes
0answers
45 views

Numerically solve system of ODE

I have the initial problem for system of ODE, that I want to solve numerically with a given accuracy $\varepsilon$: ...
0
votes
2answers
92 views

Is there any way to speed up this Mathematica evaluation?

I am interested in evaluation of the following integral ...
0
votes
0answers
44 views

Instability in NIntegrate

I am solving the following equation with NIntegrate. However, the solution branches off at a certain time instance. When I increase the time step size, the instability occurs at larger time instant. ...
0
votes
0answers
43 views

“The integrand has evaluated to non-numerical values…” for only a _subset_ of the function domain?

What might cause NIntegrate to complain about the integrand evaluating to non-numerical values for only some subset of the function's domain? I have a pretty complicated function whose (numerical) ...
0
votes
0answers
133 views

How can I speed up this pdf path integration calculation with a slow recursive function with 40^4 summed terms in each iteration?

I am writing a path integration code for a numerical approximation to a probability density function. I essentially take some initial continuous probability density function p0 and then perform a ...
1
vote
1answer
97 views

Problem With NDSolve, Mathematica does not run [closed]

Hello everybody I was solving an exercise that its solution was the solution of a system of differential equations but when executing the command in mathematics this takes a long time and then the ...
6
votes
1answer
108 views

Defining mesh size for NDSolve

I want to see the effect of mesh size on the solution curves while simulating convection-diffusion - point sink via NDSolve FEM. In the following code (ref also related to this post): I'd like to know ...
0
votes
1answer
55 views

problem with NDSolve using RungeKutta

I'm having a problem with using NDSolve. It might be a simple problem, and related to the method's parameters, yet I'm not sure how. I have two deferential equations, and I'm trying to get the ...
4
votes
1answer
149 views

How can I speed up this Monte Carlo integration for the Stieltjes constant $\gamma_n$?

Pre-requisite Definition Stieltjes constants ($\gamma_n$) are the constants that occur in the Laurent series expansion of the Riemann zeta function. $${\displaystyle \zeta (s)={\frac {1}{s-1}}+\sum _{...
0
votes
1answer
87 views

Issues to compute and plot a function with some Fourier analysis

I'm currently in an internship and I have to construct a model that involve Fourier transform of 2 orbitals. My issue is that when I run the programm, the function evluateton non numerical values : &...
2
votes
1answer
93 views

NIntegrate fails to solve a double oscillatory integral

I need to compute the following integral: ...
0
votes
1answer
85 views
1
vote
1answer
138 views

How can I solve this system please?

I need to solve the following impulsive heat equation: $$ \left\{\begin{array}{ll} \partial_{t} \psi(x,t)-\partial_{xx} \psi(x,t)=0, & (x,t)\in (0,1) \times((0, 2) \backslash\{1\}) \\ \...
0
votes
0answers
39 views

What is the units of source term

This is a follow up to my previous question posted here, I'm setting up a pde in 1D to simulate the convection-diffusion physics along with point sinks ...
0
votes
1answer
48 views

Nested usage of NIntegrate

I'm trying to compute an integral of f(x,y) such that an integration over "y" is performed inside the integral over "x". My trial is below: <...
0
votes
1answer
108 views

plot multiple curves : solution obtained from NDSolve

I want to plot the solution obtained from NDSolve as a multicurve plot like shown in the following sample image (image ref). Here, x1, x2 , x3, x4 .. are the solution computed at ...
1
vote
0answers
48 views

Closed form for integral with SinIntegral

MMA can't solve this integral: $$\int_0^{\pi } \text{sinc}(x) \text{Si}(2 x) \, dx$$ The I use FourierSinTransform to find closed form,but I try a verify result is ...
1
vote
0answers
51 views

Strange results: Absolute value vs. square root of square in integral computations

Today I encountered a phenomenon in the free online version of WolframAlpha which looks to me like a bug. It would be great if someone could check whether the phenomenon also occurs when using ...
0
votes
0answers
41 views

WhenEvent with 2 conditions to stop integration

I have this code that does not even work for a single condition, say ...
5
votes
4answers
147 views

Are there any alternatives for NIntegrate to calculate the area for which $f(x,y)<0$?

I have this two-variable function $$f(x,y)= (8 \cos (x+y)+7)\cos \left(\frac{x}{2}\right)+\cos \frac{x-2 y}{2}+2 \cos \left(\frac{3 x}{2}\right) $$ where $0<x,y<\pi$. I want to calculate ...
2
votes
1answer
67 views

Why does the integration of this symbolic matrix slow down after compilation?

There's a symbolic matrix as the following. Why does the integration of the symbolic matrix slow down after compilation? How to eliminate the error information in red? Thanks. Note: The sample matrix ...

1
2 3 4 5
57