Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

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

Encountered non-numerical value for a derivative at t == 0 when solving nonlinear differential equation

Please refer to the below code. I have developed 3 differential equations which I am attempting to solve, however I am getting an error "Encountered non-numerical value for a derivative at t == 0&...
1
vote
1answer
154 views

How can I Improve speed of 2D Fourier Transform?

I am trying to calculate this simple FT on a grid {x,y} but it tasks too long and gives me some error message even though the results are Ok. Are there other ...
-1
votes
0answers
58 views

Numeric integration with symbolic boundaries

The following is a definition of a numeric integration: ...
0
votes
0answers
29 views

2D interpolation after numerical integration

I have a function which is a result of NIntegrate and is a function of two variables. Is it possible to interpolate this function by using the above result form the ...
1
vote
1answer
55 views

Error solving differential equation

I am new to Mathematica, I am trying to solve a very basic differential equation and getting an error. Can someone please assist as to why I am receiving the error? ...
3
votes
3answers
240 views

Integration possible using DiracDelta or in another way?

Could MMA solve analytically this integral by using a Dirac delta function or in another way? $$ f(x)=\int_{-\infty}^{\infty}\left(\frac{1}{3 t^2+1} e^\frac{-t^2+i t}{3 t^2+1}\right)e^{itx}{\rm d}t\...
0
votes
1answer
54 views

Assumtion on Solve and DSolve

How to fix this problem I can't get something from this!! ...
3
votes
1answer
94 views

Change of variables in 2-nd order PDE

I need to solve the following equation: $-(1+x) \partial_t ^2 \psi + (1-2x^2)\partial_x\partial_t \psi +(1-x)x^2\partial_x^2 \psi -2x \partial_t\psi+x(2-3x)\partial_x\psi=0$ for the function $\psi(t,x)...
0
votes
0answers
61 views
10
votes
2answers
388 views

NIntegrate: the order of singular points matters!

Consider the following integral: $$I = \int_{-5}^5 \frac{1}{(x(x-2))^{1/3}} dx.$$ The exact value is 6.30249 - 2.2405 I. I will perform ...
2
votes
2answers
190 views

NIntegrate fails to converge for oscillating improper double integral with pole

How to properly numerically integrate this double integral? I get always errors like NIntegrate failed to converge.... ...
1
vote
1answer
34 views

NIntegrate With Singularity: Experiment With Various Parameters

I want to numerically evaluate the integral $$I = \int_{\mathbb R^2} dxdy f^*(x) f(y) K(x-y)dxdy,$$ where $$f(x) = \sqrt{\frac 2 \pi} e^{ikx} e^{-x^2}, \quad k\in\mathbb R$$ is an exponentially ...
1
vote
1answer
41 views

Strange behavior of NIntegrate: small change of integration range give tremendous running time difference!

I have an integrand: integrand = E^((6*I)*x - x^2 - (6*I)*y - y^2)/(2 Pi (-I (I/100 + x - y))^(1/3)) This function decays as $\sim e^{-x^2-y^2}$ for $x,y \to \...
0
votes
1answer
58 views

Numerical integration with poles

I have got many errors for this integral. Anyone knows how to fix it? (I am using mathematica12.2) ...
1
vote
0answers
37 views

How to interpolate a function of two variables which one of them will be integrated later?

So, I'm having a problem undertanding Interpolation and NIntegrate. What I have are a few tables with one of them in function of ...
1
vote
1answer
49 views

Double numerical integral, in two steps

Let me define the following function: f[x_] = x I have to solve the numerical integral: ...
0
votes
1answer
48 views

NIntegrate giving different results after a change of variables

When I compute numerically the following double integral: \begin{equation} f(x,y)=\int_{-\infty}^{+\infty}da\int_{-\infty}^{+\infty}db\, \cosh\left[\frac{\sinh^{-1}(a)-\sinh^{-1}(b)}{2}\right]\, \exp\...
0
votes
1answer
31 views

Compute integral range given integral value [duplicate]

Is there an easy way in mathematica to approximate $x$ such that $A = \int^{x}_0 f(x) dx$? (where $A$ and $f$ are given) I am sorry if it is trivial.
0
votes
1answer
47 views

Integral of a function defined itself as a non elementary inetgral with parametric limits

Suppose I have a function $g(t)$ defined as $$ g(t)=\int_0^{1-t}e^{(u^n+sin u)}du ,\quad n \in N$$. There is nothing special with the integrand ,you can replace it by any other function whose ...
4
votes
2answers
237 views

Using NDSolveValue for Solving a parabolic PDE numerically

Inspired by this question I am trying to solve the following PDE numerically on $x \in [-3, 3]$ and $t \in [0, 0.5]$ using NDSolveValue: $$ \frac{\partial p}{\partial t} = (12x^2-4) p + \left[4x(x^2-1)...
0
votes
1answer
54 views

Errors appear after integration of an interpolating function

I have a little question about integration of an interpolating function. There is an error in assumptions of the integral. I have a function that was obtained with an interpolation method: ...
1
vote
1answer
76 views

Smart way to do a numeric integral of a recursive function defined by symbolic integration

I have a little question. I need a smart way to compute a numerical integral. The standard way to compute a numerical integral, in multiple variables, is, for example, the following: ...
1
vote
1answer
32 views

Numerical integration yields errors [closed]

I try the following simple calculation but Mathematica gives me some errors. I am not sure why I get these error messages and if the calculation is correct after all, I'd appreciate some feedback. ...
-2
votes
1answer
77 views

some error without reason [closed]

I just start to work with this code but it is not running?! Clear["Global`*"] eqns = {y[x]^2 - ((1/52)*Sqrt[3]*y[x])Sqrt[y[x]^2 + (x)^-2/1000 - (69/100)] + ((49 (x)^-2)/100000) - (69/100) == ...
0
votes
3answers
119 views
1
vote
2answers
62 views

Integral involving Part

The integral below is a simple prototype of something I'm interested in. It causes an error whose origin I understand but haven't been able to fix. ...
2
votes
3answers
173 views

Eigenvalue problem with NDSolve

I am trying to solve the following system of linear ODEs. It is an eigenvalue problem. ...
1
vote
1answer
184 views

How can I change the grid of numerical integration?

I'm using numerical integration for calculating some integrals which depend on two parameters. In low range of parameters I get precise results without any further option but in high range of ...
0
votes
1answer
118 views

Numerical integration of a function with Dirac delta

I have a little question about the numerical integration of a function that includes a Dirac delta. I have the following function: ...
2
votes
1answer
57 views

Integration of products of spherical Hankel functions yield different results

Background I am trying to solve the following integral $J_{nm}^{(j)}(x) =\int_1^\infty y^{(-j)}h_n^{(1)}(x y)j_m(x^* y)\mathrm{d}y$ where $x$ is complex valued, the asterisk denotes the complex ...
0
votes
1answer
78 views

How do I integrate and plot the function $\int\int e^{-x\cdot y}dx dy$ numerically? [closed]

I would like to integrate the function $e^{-x\cdot y}$ numerically (in the fictitious assumption that there would be no closed form for it). As a result a plot should come out that looks as follows: ...
2
votes
0answers
78 views

Rational numbers in NDSolve

Is it possible to use NDSolve with Rational numbers instead of Real? I use all rational ...
1
vote
1answer
155 views

Find right end-point satisfying an integral constraint

I am solving the following system of first-order ODEs with a variable right-end point l1num and boundary condition at that point ...
0
votes
1answer
119 views

Mathematica refuses to plot this interesting graph [closed]

I am trying to plot this function $f$ which satisfies $f$ bounded, monotone, $C^\infty$, but $f'(x) \nrightarrow 0$ as $x\rightarrow\infty$. I am running a linux computer with mathematica 12.3. My ...
1
vote
0answers
80 views

Numerical Integration Function issue

I am trying to plot a function which takes as arguments two other functions and performs an integration. I originally defined it analytically as so: ...
0
votes
2answers
62 views

How to make integrals of interpolated matrices constructed by other interpolated quantities?

I have the following code producing an interpolated unitary matrix: ...
2
votes
1answer
100 views

Solving boundary value problem with coupled odes at interface

I am trying to get the eigenvalues of the following differential system ...
0
votes
0answers
77 views

I am trying to solve this equation in Mathematica, but I am not getting the correct answer

I am considering the following integral: $$F_y=4\pi\varepsilon\mu_0 M^2 R^2\int_\infty^0\frac{J_1\left(\tfrac{r q}{R}\right)}{q}J_1^2(q)\sinh^2\left(\frac{q t}{2R}\right)e^{-\tfrac{q s}{R}}\,\mathrm d ...
1
vote
1answer
46 views
1
vote
1answer
53 views

Multidimensional numerical integral giving wrong answer

I am reducing a series of atomic transition amplitudes using Gaussian transforms (that allow one to combine all coordinate dependence into a single quadratic form so that one can complete the square ...
0
votes
0answers
32 views

Get current integral value in NIntegrate's EvaluationMonitor

Is it possible to display the current evaluation result while NIntegrate[] is running? Something like this: ...
3
votes
2answers
143 views

BEYOND Singularity with NDSolve

Here is the code I want to numerically integrate my nonlinear ODE" ...
0
votes
0answers
57 views

Assistance with NDSolve error "At \[Tau] == 6.656861910808319`, step size is effectively zero; \ singularity or stiff system suspected"

I have been trying to simulate a nanocontinuum whose interaction is described by the modified Lennard-Jones potential. All of my other simulations worked perfectly, but I got stuck when I introduced a ...
0
votes
0answers
44 views

Two functions are the same but the code works with one and not the other

I have been trying to solve this problem for a while but I honestly don't understand what is happening. Do I have defined the same function in two different ways: one of them is hardcoded, and the ...
0
votes
0answers
32 views

Calculation of integral involving Sum

My code is the following: ...
1
vote
1answer
85 views

Integrating elements of a matrix obtained by NDSolve [closed]

the matrix U[t] is obtained by U[w1_,w2_,w3_,t_]:=NDSolveValue[u'[x]==-I*H[w1,w2,w3,x]*u[x],u[0]==IdentityMatrix[3],u,{x,0,Pi}][t] where H[w1,w2,w3,x] may be ...

1
2 3 4 5
61