18 votes
Accepted

Extending NDSolve beyond a singularity

We can treat the variable $y$ as an element $[y_1 \colon y_2]$ of the projective line. In code, this means replacing y[x] by ...
user avatar
  • 217k
14 votes
Accepted

NIntegrate: the order of singular points matters!

Note that {x, x1, x2, x3,..., xn} describes a path in the real or complex domain, and the order matters. So {x, -5, 2, 0, 5}] ...
user avatar
  • 217k
13 votes

What can one do with extremely stiff problem in NDSolve?

EDIT #2 My error was useful. It brought me to the conclusion that the difficulties in solving the PDE of the OP are due to the drift term $$\frac{\partial (x u(x,t))}{\partial x}$$ If the drift ...
user avatar
12 votes

Fredholm Integral Equation of the 2nd Kind with a Singular Difference Kernel

This is an eigenvalue problem. Let's apply a Galerkin scheme: We fix a finite dimensional space of functions, pick a basis $u_0, u_2,\dotsc,u_{n}$ and define the matrices $$A_{ij} = \int_0^1 \!\!\!\!...
user avatar
11 votes

NIntegrate: the order of singular points matters!

we observe that the order of singularity points matters. To avoid this, use the Exclusions option instead of listing them in order. Now the order does not matter ...
user avatar
  • 110k
10 votes
Accepted

NIntegrate fails to converge under almost any PrecisionGoal, MinRecursion etc. How can I trust the result?

First, in general, I would advise you not to trust numerical algorithms. If there are doubts about the outcomes then solve the same problem with different (numerical or not) methods and see do their ...
user avatar
10 votes
Accepted

Plot gives 1/0 on singularity of elementary function

This is a known bug introduced in 11.0 with the improvements to the Exclusions code. One workaround is ...
9 votes

Fredholm Integral Equation of the 2nd Kind with a Singular Difference Kernel

As mentioned by Henrik, this is an eigenvalue problem. Since Mathematica doesn't have a built-in eigenvalue problem solver for integral equation, we need to discretize the equation to matrix form by ...
user avatar
  • 52.9k
8 votes

Extending NDSolve beyond a singularity

You can use WhenEvent[ ] function, maybe it's not the perfect (not very accurate) solution but it works. ...
user avatar
8 votes
Accepted

`NIntegrate` with singularity does not work

The main contribution to the integral comes from x^2+y^2==1 as you can see: ...
user avatar
  • 25.1k
7 votes

How does Mathematica find a series expansion of expressions containing logarithms when there is a singularity at the expansion point?

One good thing about Mathematica is that when doing Series[], Mathematica understands that the singularity of $log(x)$ is different from $x^{\alpha}$ (for any $\...
user avatar
  • 584
7 votes
Accepted

Singularities forming on boundary while solving system of pde's

The problem is version related. I manage to reproduce the warning in v11.2, but not in v9.0.1. So the ndsz warning may be related to improper time step choosing in ...
user avatar
  • 52.9k
7 votes
Accepted

How to calculate a hard definite integral?

We couldn't be well-satisfied taking the black box system results when having in mind that no computer system is free of bugs and that its various aspects related to symbolic integration may seem not ...
user avatar
  • 54.1k
7 votes
Accepted

Matching the solutions of diff. equations from forward and backward in some point

I would be also very thankful for any other ideas for solving such a system of differential equations. Then why not new-in-v12 nonlinear FEM of NDSolve?: ...
user avatar
  • 52.9k
6 votes
Accepted

NIntegrate and Integrate giving different results for ill-behaved function

Reversing the order of integration produces a solution: ...
user avatar
  • 58.4k
6 votes

Fourier transform inconsistency

I've reported the issue to Wolfram and received this response: Thank you for taking the time to send in this report. It does appear that the inverse Fourier transform of the Fourier transform of ...
user avatar
  • 95.2k
6 votes
Accepted

How can I make NIntegrate aware of a singularity along a curve, e.g. a circle in a 3D integral?

If you set exclusions more directly, you won't get failure to achieve the precision goal. The NIntegrate::slwcon will remain though, but it's pretty harmless. Here ...
user avatar
  • 6,912
6 votes

Numerical continuation methods for bypassing a singularity when integrating an ODE

We can take the approach in Extending NDSolve beyond a singularity and bump it up to order 2. The approach is to solve the ODE in projective space, with $R(z) = [p(x):q(z)]$ in projective coordinates....
user avatar
  • 217k
6 votes
Accepted

How to include conditional statements in NIntegrate?

Please read carefully the Documentation pages for Exclusions and NIntegrate: your understanding of this option is wrong. It ...
user avatar
6 votes
Accepted

NDSolveValue and pdepe of MATLAB disagree under spherical coordinates

Interesting. OP has hit on an undocumented syntax of NDSolve that seems never be discussed in this site. As we can see, OP has typed ...
user avatar
  • 52.9k
6 votes

How to make all the balls move until they stop by NBodySimulation

If we put countTime = 20 and remove Normalize then we have desired rest state ...
user avatar
  • 34.2k
6 votes
Accepted

How to make all the balls move until they stop by NBodySimulation

Solution 1 Funny, I'm not sure if this is the only solution, but Method -> "ExplicitEuler" (we know this is a rather primary method for ODE solving) ...
user avatar
  • 52.9k
6 votes
Accepted

NDSolve with removable singularity

Maybe this?: ...
user avatar
  • 217k
5 votes
Accepted

To deal with infinity in NDSolve

The singularity at r == 0 is of the type $O(1/\sqrt{r-1})$ and is easily removed with a substitution $r - 1 = u^2$. As for $r = \infty$, ...
user avatar
  • 217k
5 votes
Accepted

How to avoid NDSolve::ndsz problem (singularity problem)

Update notice 2: Found starting initial conditions that work in V10. Update notice: bbgodfrey pointed out that the built-in shooting method does not work in V10.0.1 (nor V10.0.2). Set up the ...
user avatar
  • 217k
5 votes

NIntegrate and Integrate giving different results for ill-behaved function

TL;DR Use HeavisideTheta's properties before integration. This is my strategy. First the HeavisideTheta gives you the ...
user avatar
  • 6,134
5 votes

Is there a way to specify the singularities of this integrand in order to numerically integrate it?

Here is another way to calculate this integral. One can expand the logarithm into series and get a sum $$ f(y_2)=-\sum_{n=1}^\infty\frac1n\int_0^\infty x^2 e^{-n\sqrt{x^2+y_2}}\,dx. $$ After some ...
user avatar
  • 2,443
5 votes
Accepted

How to evade singularity or stiff system suspected in NDsolve?

Some progress can be made as follows. First, as noted in my comment above, evaluating Ba at the initial conditions in the question yields ...
user avatar
  • 58.4k
5 votes

How to solve second order nonlinear differential equation?

The desired solution can be obtained semi-analytically. ...
user avatar
  • 58.4k
5 votes
Accepted

Why do I get "PrincipalValue cannot work with the specified exclusions" when feeding a list to a function?

Interpreting the OP's example as an MWE and not the actual problem, there are three issues: (1) evaluating the integral for a list of test values; (2) the integral and error being zero; and (3) the ...
user avatar
  • 217k

Only top scored, non community-wiki answers of a minimum length are eligible