13 votes

How much regularization to add to make SVD stable?

The singular value decomposition for a symmetric matrix $A=A^{T}$ is one and the same as its canonical eigendecomposition (i.e. with an orthonormal matrix-of-eigenvectors), while the same thing for a ...
Richard Zhang's user avatar
13 votes
Accepted

Clenshaw-type recurrence for derivative of Chebyshev series

You can just take Clenshaw's recurrence $$ u_k(x) = 2xu_{k+1}(x)-u_{k+2}(x)+\color{red}{a_k},\\ f(x) = x u_1(x)-u_2(x)+\color{red}{a_0} $$ and differentiate it directly: $$ u_k'(x) = 2xu_{k+1}'(x)-u_{...
Kirill's user avatar
  • 11.4k
11 votes
Accepted

Stability of hyperbolic PDE and DG-FEM

Stability does indeed mean that small changes in the data lead to small changes in the solution. This can be shown for the linear advection equation through the energy method; in proving the stability ...
Tristan Montoya's user avatar
11 votes
Accepted

Why is matrix inversion unstable when svd is stable?

The big issue is the condition number, which is defined as the ratio of the largest and smallest singular values. Suppose we expect: $$ S = \begin{bmatrix} 10^{-15}\\ &1 \end{bmatrix} $$ If we ...
helloworld922's user avatar
9 votes
Accepted

Order of operations, numerical algorithms

Let's denote by $\otimes,\oplus,\ominus$ (I was lazy trying to get circled version of division operator) the floating-point analogs of exact multiplication ($\times$), addition ($+$), and subtraction (...
Anton Menshov's user avatar
  • 8,652
8 votes

What is the origin of the spurious oscillations in the Crank-Nicolson scheme?

There is something very basic that you should know about hyperbolic problems. Consider the most basic example $\partial_tu+a\partial_xu=0$ with a numerical marching scheme of the form $$u_j^{n+1}=\...
Philip Roe's user avatar
  • 1,114
8 votes

Why is my simulation of a first-order wave equation not stable?

Numerical solution of the advection equation with centered differences in space and forward Euler in time is unconditionally unstable. So the behavior you are seeing is expected. Here is a nice ...
Bill Greene's user avatar
  • 5,984
7 votes
Accepted

More Smearing with decreasing timestep in advection problems

You solve the 1D-advection equation with $c$ a constant velocity: $$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x}=0~~~~~~~~(1)$$ When you discretize this equation (with an explicit ...
Coriolis's user avatar
  • 629
7 votes
Accepted

Method to solve linear, first order ODE of generalized matrix matrix form

There are a few ways you can do this. Even though RK4 fails unless stepsizes are really small, one thing that can happen a lot is that the model can start out more stiff than it really is in the full ...
Chris Rackauckas's user avatar
7 votes
Accepted

What is the flaw in my stability analysis?

But clearly, this is not the case as my programs do come up with (an approximate) solution though. I believe you did not continue the integration until you see that your integration is not convergent ...
Mithridates the Great's user avatar
6 votes
Accepted

Von Neumann stability analysis with a constant term

From your link, consider the definition of the round off error and the statement "Since the exact solution must satisfy the discretized equation exactly, the error must also satisfy the discretized ...
origimbo's user avatar
  • 2,239
6 votes
Accepted

What is the meaning of stability in numerical analysis? How to deterimne the stability of a numerical method?

You can define a method/algorithm stable if during the various steps it not amplifies excessively the errors on the data. So you introduce some bounded estimate. Note that this kind of errors, ...
Mauro Vanzetto's user avatar
6 votes
Accepted

Why is subtraction a stable operation?

(My apologies for the terrible typesetting) Let me start with the definition of backward stability of an algorithm: An algorithm $A$ to solve a problem $P$ is called backward stable, if for all $x$ in ...
Abdullah Ali Sivas's user avatar
6 votes
Accepted

How to interpret if $\displaystyle \sum_{j = 0}^{n} \frac {1}{j!}$ is a stable algorithm for computing $e$?

As hardmath mentioned in the comments above, if data space $D$ is empty, then the first half of the condition "for all $X\in D$ there exist $Y\in D$ such that $||X-Y||/||X||\approx\epsilon_m$ and ...
Abdullah Ali Sivas's user avatar
6 votes
Accepted

Python bifurcation diagram of seasonally forced epidemiological models

Recently in https://math.stackexchange.com/questions/4542008/how-to-loop-parameter-a-in-henon-map I came into contact with the idea of an "adiabatically gliding" parameter where one gets the ...
Lutz Lehmann's user avatar
  • 5,974
6 votes
Accepted

Can this finite difference dispersion be eliminated somehow?

It isn't the spike that's causing the dispersion. The scheme you use has a dispersion relationship whereby waves of different frequency travel at different speeds. Every numerical scheme has such a ...
Wolfgang Bangerth's user avatar
6 votes

Stability of Euler forward method

The solution of $\frac{du}{dt} = Au$ is $u(t) = \exp(tA)u(0)$, and explicit Euler approximates $\exp(tA)$ using $\lim_{n\to\infty} \left(I+\frac{t}{n}A\right)^n$. Of course in practice you cannot ...
lightxbulb's user avatar
  • 1,964
5 votes

method of frozen coefficients and its relation to von Neumann stability analysis

One author is being practical, while the other is being rigorous. The short answer is that stability of the frozen-coefficient problems is proven to guarantee stability of the variable-coefficient ...
David Ketcheson's user avatar
5 votes
Accepted

Improve numeric stability of subtraction in C++

This is comment, but too long for comment so I write here. I think is better you edit the post with more information, now I explain why. Here you can find some general advice to improve precision. ...
Mauro Vanzetto's user avatar
5 votes

Lagrange multipliers space is too rich in a mathematical view

Each Lagrange multiplier corresponds to a constraint. So if the space of Lagrange multipliers is too large, then you have too many constraints that can no longer be all satisfied at the same time ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Lagrange multipliers space is too rich in a mathematical view

The saddle point matrix you must solve takes the following form: $$\begin{bmatrix} A & B^T \\ B \end{bmatrix},$$ where $A$ is the unconstrained matrix and $B$ is the matrix that observes the ...
Nick Alger's user avatar
  • 3,143
5 votes

Numerical stability in the product of many matrices

Orthogonal matrices are about as well-conditioned as you can get, but numerical errors still occur. One common error is loss of orthogonality. A fix for this could be to re-orthogonalize your columns ...
whpowell96's user avatar
  • 2,259
5 votes

Advantage of diagonal "jitter" for numerical stability?

Look up something on Tikhonov regularization, also known as ridge regression in machine learning. This is a standard technique (but I agree that the explanation in that notebook is somewhat poor). ...
Federico Poloni's user avatar
5 votes
Accepted

Advantage of diagonal "jitter" for numerical stability?

So, you want to invert your matrix $A=\Phi^T\Phi$. For $A$ to be invertible it must not have zero eigenvalues. We can show that $A$ is positive semi-definite as follows. Positive semi-definite means ...
NNN's user avatar
  • 610
4 votes
Accepted

CFL condition in polar coordinates

I was going to write a comment, but the equation seems to view better in answers.. I assume Von Neumann analysis is the proper approach to derive this equation, but a coordinate transformation from ...
Charles's user avatar
  • 619
4 votes
Accepted

Finding Numerical Stability of Simple System with Integral Term Due to Low Pass Filter

You can introduce an auxiliary variable $$ y(t) = \int_0^t \exp\left(\frac{-(t-\hat t)}{\tau}\right) x(\hat t) \; d\hat t, $$ which you can differentiate to get on ODE for $y(t)$ that depends on $x(...
Wolfgang Bangerth's user avatar
4 votes

Generate high n quantum harmonic oscillator states numerically

I did some more investigating about the accuracy of the standard recurrence relation method vs. the newer Bunck algorithm. It seems that in fact the Bunck algorithm is generally more accurate for all $...
vibe's user avatar
  • 1,048
4 votes

Why the numerical solution of advection-dominant problem is challenging

The difficulty is relative to something, in this case it is relative to diffusion dominated problems. Diffusion dominated aren't "easy" either, they have their own set of problems. I'll start with ...
Reid.Atcheson's user avatar
4 votes

Advantage of diagonal "jitter" for numerical stability?

Think of the simplest case when $\Phi$ is a scalar value. Not well defined: $$ \boldsymbol \theta^\text{ML} = (0^T 0)^{-1}0^T ~ y = \frac{1}{0} 0~y= \frac{0}{0} $$ Well defined: $$ \boldsymbol \theta^...
ConvexHull's user avatar
  • 1,290

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