The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [numerical-integration]

Questions on the use of numerical functions NIntegrate and NDSolve.

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

Catastrophic loss of precision in numerical integration

I am trying to get the following code running: ...
0
votes
2answers
64 views

Non-linear differential equation with tricky variable dependence

My problem regards solving a differential equation and can be reduced to the problem of finding $f(x)$ such that $\frac{df}{dx}=\frac{dh}{df}$, with $h(f)$ a known function. I have this list of data,...
0
votes
0answers
33 views

Solving Integration with exponentials

I am trying to solve this integration : Integrate[(1 - Exp[-a*x])* (1 - Exp[-b*x])*(1 - Exp[-c*x]), {x, 0, t}] I get the result. But when I use the below ...
3
votes
2answers
123 views
+100

Where is the numerical solving breaking down?

I am working with a set of three coupled reaction-diffusion PDEs, and for some parameter values I am getting some not so great solutions. I have been searching documentation and tutorials, and I have ...
2
votes
1answer
39 views

Solving numerically an equation with an integral

I am trying to solve the following equation numerically: Equation to solve for $y$: $$na(ay-y)^{n}\int_{ay}^{+\infty} \frac{(x-y)^{-n}}{x-ay}dx=b$$ with for example $a=4$, $n=1.25$ and $b=1.6$. I ...
2
votes
0answers
191 views
+100

Finding local minima of an energy defined by integration

This question is also asked here and here. I would like to reproduce the two solid curves in Fig. 1a of this paper. The total energy is given in Appendix A, and the curve is obtained by minimizing ...
4
votes
1answer
118 views

How to include conditional statements in NIntegrate?

I have a function g which is the result of another integrated function f. This function (f) ...
0
votes
0answers
62 views

How to solve this equation in Mathematica?

I wonder what is the best way to solve this equation in MA? $$ y= \frac{\partial}{\partial x} ~ \frac{\partial}{\partial x^*} f $$ where y and ...
2
votes
1answer
57 views

Computing the definite integral of a fractional polynomial containing sin(x) and x^n

I need to compute the definite integral defined as $$\int_{-\infty }^{+\infty } \frac{\sin ({x_0}\, \omega )-\sin (x \omega )}{(\sin (x \omega )-\sin ({x_0}\, \omega ))^2+(x-{x_0})^2} \, dx\,.$$ When ...
2
votes
2answers
43 views

Integrating a function with Max function

I'm trying to evaluate the triple integral $$\int_{0}^{1} \int_{0}^{1-x} \int_{0}^{1-\max(x,y)}1 dzdydx$$ in Mathematica. The code I'm using is simply ...
0
votes
0answers
69 views

Want help with handling error messages from NDSolve [closed]

I'm trying to solve a system of two differential equations with NDSolve and mathematica gives error. I have functions in ...
0
votes
0answers
26 views

Help with NIntegrate with singularity and variable integration limit

I have a function of the type: $$ F(x,z)= \int_{-\infty}^{\infty} dx' \int^{z}_{-\infty} dz' f(z,z',x,x')\frac{\partial g(z',x')}{\partial z'}$$ where the integration order may be interchanged. I ...
0
votes
2answers
29 views

NIntegrate user defined function

I have the the function f[a_] := Module[{solution, ans, x}, solution = NSolve[x + a == 4]; I want to integrate it by writing ...
0
votes
0answers
35 views

How to stop NIntegrate if the integral appears to be smaller than certain value?

I have a number of integral to compute numerically. The values of some of them are small as those take NIntegrate very long to compute according to its internal goals. Now, I care only about the ...
0
votes
0answers
40 views

How to resolve underflow occurrences?

I am solving a second order differential equation described by odey below. For the asymptotics, I have the following code which will be used as initial conditions for NDSolve. ...
0
votes
2answers
101 views

Numerical resolution of non-linear coupled ODEs

I have problem with my code in Mathematica. I have introduced the set of coupled non-linear ODES. This is the resolution part: ...
0
votes
2answers
48 views

Can't solve for y in a fairly simple work done by magnetic field equation

The equations below are essentially calculations for a railgun-type mechanism (here is a good image description). I also drew an image using my own variables as definitions: I assumed that ...
1
vote
1answer
51 views

Hybrid ODE simulation with very small parameters

I am trying to solve a Hybrid dynamical system using NDSolve and WhenEvent. I am able to simulate when the parameters are close ...
1
vote
1answer
77 views

About some hypergeometrical formulas for roots of trinomial and quadrinomial

Please correct my interpretation of formulas by Pietro Majer from post. For equation $a=x+x^p$ one root is $x=a\sum\limits_{k=0}^{\infty}\frac{(-a)^{(p-1)k}}{(p-1)k+1} {{pk}\choose{k}}$ Wolfram ...
-1
votes
1answer
112 views

Can I numerically solve these equation in Mathematica? [closed]

I have this couple of equations : $ \partial_\mu \partial^\mu z^i + G^{i\bar{p}} (\partial_j G_{k\bar{p}} ) \partial_\mu z^j \partial^\mu z^k + G^{i\bar{j}} (\partial_{\bar{j}} G_{k\bar{l}} ) \...
2
votes
1answer
72 views

Is it a mistake in the formula or inaccuracy in the calculations of numerical integration?

Formula for roots of trinomial $\displaystyle z^m-az^n-1$ with definite integration from paper Лахтинъ, “Выраженiе корней трехчленнаго алгебраическаго уравненiя посредствомъ опредѣленныхъ интеграловъ” ...
0
votes
0answers
63 views

Difficulty numerically integrating highly oscilliatory function

I have the following two integrals that I wish to numerically integrate. The function in each integral is the same. They have been split up since at t = 0 there's a singularity. ...
5
votes
2answers
174 views

How to count the number of function evaluations in NIntegrate

I expect the following code to count the number of function calls in NIntegrate. ...
1
vote
0answers
30 views

Moment-generating function of the log-normal distribution. A question about integration

Consider the probability density function $f(x)$ of the log-normal distribution with parameters $-0.1$ and $0.01$: ...
0
votes
0answers
28 views

NIntegrate fails to converge despite using attempting to use different methods

I have the following Green's function that I am trying to evaluate for several different values on a defined mesh. The mesh and Green's function is defined below. The mesh runs from values -w/2 to w/2....
0
votes
1answer
55 views
6
votes
1answer
377 views

Can NDSolve address spherical gravitational collapse?

As far as I know spherical gravitational collapse -of central importance to theoretical physics- is thought to be out of the scope of Wolfram Mathematica. However there are cases, as in this article,...
5
votes
3answers
224 views

Problems with solving PDEs

I am using NDSolve to solve the two equations: ...
0
votes
1answer
71 views

DSolve returns unevaluated(I need a closed or numerical solution for this system and plot solution)

I am trying to find a solution to this system of differential equations but the program gives the same output without any messages. I would like help. Please find the Mathematica code posted here. a ...
2
votes
1answer
143 views

Double Numerical Integral - precision is not improving answer

Consider this two-dimensional integral ...
3
votes
1answer
135 views

Analytical form of 2d integrals relevant to graphene

This question is continuation of my previous post. Alex Trounev was very helpful in fixing a crucial typo in the analytic solution known from the article "Density Dependent Exchange Contribution to ∂𝜇...
3
votes
1answer
63 views

Unexpected error when implementing FEM in MoL SpatialDiscretization

I cannot figure out why the following piece of code ...
4
votes
2answers
81 views

MoL: How to enforce Chebyshev–Gauss–Lobatto points in SpatialDiscretization?

In Mathematica documentation one is prompted to use a grid with points at the zeros of the Chebyshev polynomials so that Runge's phenomena arising from ...
2
votes
1answer
112 views

Elliptic integrals

In trying to reproduce results from one paper I stumbled upon a problem with definition of some elliptic integrals (this is my guess of what could be the problem). I will first present in a ...
1
vote
1answer
23 views

Visualizing a multiple parameter integration

I'm really new to Mathematica and all the other answers to similar questions don't seem to help me. I have an integral I'd like to solve, and I'm having problems. My integral looks like this: $\int_{...
1
vote
1answer
48 views

Elimination of numerical error in initial data

Elimination of numerical error in initial data can be crucial for its subsequent evolution. In the following simple example ...
2
votes
1answer
43 views

TemporalDiscretization in MethodOfLines

When solving ODE's one can use options like MaxStepFraction to control the number of grid points. When solving PDE's ...
6
votes
2answers
783 views

Integration of Interpolated function take an unacceptable amount of time

I have a simple integration which, when using an interpolation function, is taking too long to calculate: ...
1
vote
1answer
82 views

Solving system of PDEs with NDSolve

I am trying to solve a system of coupled PDEs with zero-flux boundary conditions on a large domain. I have two problems: 1) Is there a possibility to use results of NDSolve as inititial conditions? ...
3
votes
1answer
93 views

Solving a stiff nonlinear ODE system

The system I am trying to solve is simple, but looks pretty stiff and I have unsuccessfully tried to solve it with StiffnessSwitching. It is the following one: <...
2
votes
1answer
72 views

Evaluating the Poincaré section for Hénon-Heiles potential through Hénon Method

I must find a poincaré section of a Hénon-Heiles system as described in Hénon-Heiles 1964 paper. The Hénon-Heiles Hamiltonian is the following, $$ H = \frac{1}{2}(p_{1}^{2}+p_{2}^{2}+q_{1}^{2}+q_{2}^{...
8
votes
1answer
613 views

Correct way of simplifying the result of an integral

Many times Mathematica gives enormous results to simple problems. One uses the program more for trouble than for not knowing how to solve the problem. As an ejemplo I present this integral that ...
2
votes
0answers
70 views

Solving 2D Integro-Differential equation numerically

The following problem was given to me by a friend, so I can't really guaranty that a solution exists, but if, I certainly can't find it myself... Let us consider the following Integro-differential ...
0
votes
0answers
46 views

NDSolve 1/0 error

I'm having trouble to solve a differential equation with NDSolve. Does anyone knows how can I get rid of this problem? ...
0
votes
2answers
75 views
5
votes
1answer
166 views

How to increase NDSolve accuracy for 2nd order ODE?

My attempt to NDSolve a 2nd order nonlinear ODE ...
1
vote
0answers
53 views

Computing a system of ordinary differential equations with initial condictions over a continuous range [closed]

I have some questions about Mathematica programming and would appreciate if you could help me. I want to solve a system of ordinary differential equations μ '[t] ...
1
vote
1answer
40 views

Plotting a function on the different axis

I've solved the DE: $$a\cdot x(t)+b\cdot\ln\left(1+c\cdot x(t)\right)=-p\cdot x'(t)\tag1$$ Where $x(0)=k$ And I got the following solution: $$t=\int_{x(t)}^k\frac{p}{a\cdot z+b\cdot\ln\left(1+c\...
0
votes
2answers
37 views

NDSolve: How to perform a reverse integration consistency check?

Let there be the following NDSolve code: s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}] I think it ...
0
votes
1answer
111 views

Verifying that an inequality has a finite limit

I am trying to verify the following inequality using Mathematica, but without any success. $$ \lim_{a\rightarrow0^{+}}\frac{\intop_{0}^{1}e^{\frac{-30}{\sqrt[15]{a^{16}*\log\left(\frac{1}{x}\right)}}}...