Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

0
votes
0answers
39 views

Boundary Element Method For Laplace's equation [on hold]

I am trying to solve the Laplace's equation in the attached by using the boundary element method, any help please? Thanks
0
votes
1answer
67 views

It's wrong the solution to definite integral from Mathematica 11.3? [on hold]

I'm solving the exercise 23 from 4.8 section from "The Calculus 7th Leithold" (I use the Spanish edition "El Cálculo 7"), I write the solution in (physical) notebook, was 8*sqrt(2)/3, but when run in ...
0
votes
0answers
65 views

Numerical solution for the following two Korteweg-de Vries equations [on hold]

I have been trying to solve the following Korteweg-de Vries (KdV) equations using NDSolve, but nothing went right! $\qquad 6 U_{t} + (9/2) U_{xxx}+ 9 U U_{x} - 6 a ...
1
vote
2answers
124 views

Analytic or numerical integral calculation

I would like to integrate the following, $$f(x,y) = \frac{1}{(a - x)^2 + b (y-x^2)^2},$$ where $a>0$ and $b>0$ between definite bounds to obtain an analytic result ideally. I've tried the ...
2
votes
1answer
69 views

Does Mathematica have a 'nice' way to evaluate singular double integrals over line segments?

I want to perform a double integration over a line segment in 2D and I am wondering if can it be done in Mathematica. An added difficulty is that the integral is singular. $$I = \int_{(4,4)}^{(2,8)}\...
0
votes
1answer
39 views

Maximize the solution of an equation containing an integral

I have to find {x,y} which makes the integral ...
0
votes
1answer
30 views
1
vote
0answers
21 views

Numerical continuation methods for bypassing a singularity when integrating an ODE

Here is the ODE I want to numerically integrate, odey=-l (1 + l) R[y] + (k - y) (-2 Derivative[1][R][y] + (k - y) (R^\[Prime]\[Prime])[y]) If we rearrange it in ...
0
votes
1answer
53 views

Symbolic Integration

I want to integrate the foll0wing expression to get a symbolic expression of the integration: ...
1
vote
1answer
101 views

Can Mathematica help me evaluate an integral over disjoint disks $I = \int_{D_1} \int_{D_2} \log|x-y| dy dx$?

I want to evaluate an integral that involves two disjoint unit disks $D_1$ and $D_2$. $D_1$ is centered at $(-2,0)$ and $D_2$ is centered at $(0,2)$. The integral I want to compute is $$I = \int_{D_1}...
0
votes
3answers
112 views

NDSolve fails at the regular singular point of a second-order ODE

Here is the ODE I want to numerically integrate, odey=-l (1 + l) R[y] + (k - y) (-2 Derivative[1][R][y] + (k - y) (R^\[Prime]\[Prime])[y]) If we rearrange it in ...
0
votes
1answer
53 views

NDSolve and interpolating function

What could possibly went wrong in my code? Basically, I am solving the differential equation $\textbf{ode}$ using $\textbf{NDSolve}$. But mathematica says, NDSolve::mxst: Maximum number of 10000 steps ...
3
votes
0answers
92 views

How can I do a faster integration?

I have this part of my code, which takes forever to run. Does anybody know how to make it faster? Using NIntegrate I face error: "NIntegrate::eincr: The global error of the strategy GlobalAdaptive ...
1
vote
0answers
41 views

Fast Plot3D, failing NIntegrate, and reckless surgery

I have a square matrix, m which depends on kx and ky. It isn't Hermitian, but it does have ...
0
votes
1answer
34 views

Integration issue with Nintegrate over finite bounds

I have an issue : NIntegrate[x^2 *Exp[-x^2], {x, 0, Infinity}] gives out 0.443113 But : ...
0
votes
0answers
25 views

Problem with FindRoot, NIntegrate, and ImplicitRegion

I'm trying to use FindRoot[ ] with 2D NIntegrate[ ], where the latter uses ImplictRegion[ ], and I'm running into problems. As a simple example, consider the following integral: ...
1
vote
0answers
50 views

Integrating wavefunctions over a sphere

I am attempting to numerically solve the inner product of two particles and an electric dipole interaction potential. I am incredibly limited in my skills, and need to know how I can begin setting the ...
2
votes
1answer
145 views

Interpreting Mathematica code on black holes

I am trying to understand the code written down on page 7 of this document (code is in Mathematica) I understand pretty much all of the code on the previous page needed to setup the page 7 code (...
0
votes
1answer
42 views

Using NIntegrate over 1 variable to find function of 2 variables

I'm attempting to numerically solve the following in order to get a function of 2 variables, just looking at the real part of $$\psi(x,t)=\frac{1}{\pi\sqrt{2}}\int_{-100}^{100}\frac{\sin{(k)}}{k}e^{i\...
0
votes
0answers
73 views

Solving a differo-integral equation [duplicate]

I've the following equation for x(t): $$x'(t)\cdot\text{a}+\text{b}\cdot\frac{x'(t)}{x(t)+\text{c}}+\frac{\partial}{\partial t}\left\{\int_0^tx(\tau)\cdot\mathcal{...
0
votes
1answer
40 views

RegionPlot evaluating NIntegrate before assigning variable values and resulting in non-numerical integrands [duplicate]

I am trying to find the regions where the integral of a function a function is larger than a certain quantity using RegionPlot. For simplicity's sake, let's say the intergal I am looking to plot is is ...
3
votes
2answers
147 views

Solution or artifact?

I am trying to increase the precision of the code ...
0
votes
0answers
51 views

Non-autonomous ODE use NDSolve, error: Step Size is effectively zero; singularity or stiff system is suspected

I have seen this error NDSolve::ndsz many times when I use NDSolve to get the solution of a non-autonomous ODE. I try but all ...
0
votes
0answers
54 views

Nested Cauchy type integration

I have a function which is in integral form: $$f_+(z)=\exp\bigg(\frac{1}{2\pi i}\oint_{C}\frac{f(\alpha)}{(z-\alpha)}\,d\alpha\bigg),$$ where $C$ is a unit circle. I want to take the Fourier ...
5
votes
2answers
142 views

Does Mathematica gives us a wrong result for the integral of a function including elliptic functions?

Calculus tells us that the differentiation of the integral of a function should be itself, but at least in one case Mathematica answers NO. I feel very confused. The new figure seems to bifurcate at ...
0
votes
2answers
188 views
0
votes
0answers
40 views

Numerical solution to approximate the singular integration using collocation method

I am working to solve "numerically" the following integral equation IE: u[x]=f[x]+Integrate[(1/(x-t)^(1/4))*u[t],{t,0,x}]+Integrate[(1/(x-t)^(1/4))*u[t],{t,0,1}] ...
0
votes
0answers
41 views

Non-numerical values errors as NIntegrate

Here is my code: 1. Define a Gaussian Mixture Model ...
0
votes
1answer
28 views

Integrate a product of functions with random variables

Assume there is a function f($x_1$,...$x_n$,$Y$) and I seek for the integral following on an area $[0,1]^m$: where $Y_i$ are the parameter I generate randomly for each function. The total number of ...
3
votes
1answer
106 views

Complex first-order differential equation

I have a differential equation $\frac{dx}{dt} = \sqrt{1+x^4}$ $x$ is a complex variable. I want to solve it for some given initial condition, and plot the solution (real part vs. imaginary part). ...
1
vote
3answers
75 views

Numerical integration converging too slowly. how to over come this

I have a function U1 which contains a linear combination of trigonometric function, I wanted to Numerically integrate this function U1. Since each trigonometric functions associated with some unknown ...
3
votes
1answer
141 views
0
votes
1answer
51 views

Table in NIntegrate

I have an integral that I want to evaluate it once and store its values in a table so that I don't run the integration each time that I want to plot it. Its form is ...
0
votes
1answer
42 views

Trapezoid rule-esque integration with unevenly spaced n-D grid

I have a function (or rather many functions) defined over an n-dimensional grid. The grid points will often but not always be evenly spaced. I want to compute integrals of these functions numerically. ...
0
votes
0answers
43 views

Problem with NDSolve::ndnum error when trying to solve a system of differential equation

I get the error reported as NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.` when trying to run the following code: ...
7
votes
5answers
240 views

Functional fixed points (ie fixed point of mapping from function space C[0,1] to itself)

I am looking for some tips or guidance as to what machinery in mathematica can help me get at this problem numerically. I am looking for fixed points of a mapping, but the objects in question are ...
0
votes
1answer
33 views

NIntegration and Exclusions

I am attempting to integrate a long function by the MonteCarlo method. The code yields an answer as I've programmed the function, but when I try to define a region of exclusion, I get an error ...
2
votes
2answers
100 views

Specifying history for delay differential equations ``near infinity'' (using NDSolve)

Consider the following DDE: $ f''(x)+ f(x+ 1) = 0.$ For $ x \gg 1$, this DDE should approximately reduce to that of a simple harmonic oscillator: $f''(x)+f(x) \approx 0$. Suppose that for some ...
1
vote
1answer
62 views

Implementing a function so it accepts functions, function names and expressions as an argument

I'm trying to write a Mathematica function which takes an arbitrary expression as input. More concretely, I'm trying to write an integration function (utilizing the trapezoidal method), the input of ...
1
vote
2answers
168 views

A numerical boundary conditions paradox

For $(t,z)\in[0,1]\times[-1,0]$ zmin = -1; tmax = 1; and some fields $w(t,z)$ and $y(t,z)$ ...
1
vote
1answer
31 views

NIntegrate fails with functions that have (necessarily) numeric lists as arguments

I'm not able to NIntegrate a function that has a numeric list as an argument. My original problem involves a compiled function, but a MWE is the following: ...
9
votes
1answer
167 views

FiniteElement v.s. TensorProductGrid: which is reliable for Schrödinger equation with periodic b.c.?

This is a problem comes up in the discussion under this post and I think it's worth starting a new question for it. I suspect the underlying issue is the same as in this post, but not sure. Consider ...
1
vote
1answer
89 views

NDSolve: method of lines: unexpected error: insufficient boundary conditions

As a test of my ability to master the Method of Lines I tried to NDSolve the PDE's system $$\partial_t \varphi = \varpi\qquad\partial_t\varpi=\frac{1}{r}\partial^...
0
votes
1answer
46 views

NIntegrate error message: “The integrand…has evaluated to non-numerical values for all sampling points in the region with boundaries…”

I am trying to solve the following problem in Mathematica. However, the problem is that R0 is an equation itself, an integral, to be more specific. So I always get the above error message. An ...
1
vote
2answers
183 views

Time-dependent Schrödinger equation and density plot

I'm interested in the density plot of the solution of a 1D time-dependent Schrödinger equation with a given potential. So I have: ...
3
votes
2answers
120 views

A complicated use of NDSolve

I am looking for a particular type of plots. OK, let me explain, Here is my DE (I don't know what to call it), where, $\frac{\partial p}{\partial r} =0$, $r_1=\epsilon$, $r_2=1+\phi\cos(2\pi z)$. ...
1
vote
0answers
73 views

Fourier Transform of streched exponential

I need to compute the Fourier Transform of a streched exponential (according to Wikipedia "it must be calculated either by numeric integration, or from a series expansion"; so I go for the first ...
4
votes
2answers
70 views

Why do I get “PrincipalValue cannot work with the specified exclusions” when feeding a list to a function? [closed]

I have the following test function which I want to evaluate at various points from $x=0$ to $5$: $f(x) = \int^{20}_{1}\frac{1}{x-y} dy$ There's clearly a singularity here in the integral at $x=y$, ...