14 votes
Accepted

Forcing an ODE solver to preserve the norm

The best approach is to use an ODE solver that is guaranteed to conserve the norm of the initial condition, i.e., for which $\|y_n\| = \|y_0\|$ for all $n\in\mathbb{N}$. Such solvers exist, and are ...
Christian Clason's user avatar
13 votes
Accepted

Numerically stable approach for calculating x in Ax=b

If the solution of $Ax=b$ is unstable, the matrix is very ill-conditioned (i.e., has a very large condition number), and (paraphrasing Lanczos) no amount of mathematical trickery can make it stable. ...
Christian Clason's user avatar
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
12 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
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,572
8 votes
Accepted

Stability analysis of Heun's method

Notice that $\hat C_*=(1-r F(h))\hat C_n$, but the sign in front of $r$ is lost when you use $\hat C_*$ inside $\hat C_{n+1}$. I'm looking at p.149 of Numerical Solution of Time-Dependent Advection-...
Kirill's user avatar
  • 11.4k
8 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
  • 659
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,864
7 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
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

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

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,209
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
  • 4,919
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

what do zero real parts of eigenvalues mean? Any good references?

Eigenvalues with zero eigenvalue correspond to purely oscillatory modes. You can see it by diagonalising the system. Your matrix $A$ can be written as \begin{equation} A = P \Sigma P^{-1} \end{...
Daniel's user avatar
  • 1,238
5 votes
Accepted

stabilizing advection-diffusion with multi-grid?

There are two different flavors of smoothing and stability. The spurious oscillations in convection-diffusion problems are not an artifact of the linear solver but an inevitable artifact of the ...
Bill Barth's user avatar
  • 10.9k
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,063
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
  • 1,567
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
  • 519
4 votes
Accepted

How to derive an Implicit Runge-Kutta method from Pade approximation

There are a few people who have liked the question, so I'm posting an answer. The only way I could figure out how to do this is to just work backwards, starting with the stability function for ...
Matthew Cassell's user avatar
4 votes
Accepted

Why have specialised upwind schemes been developed to solve hyperbolic equations?

To elaborate on Wolfgang's answer: since hyperbolic PDE semi-discretizations with centered differences have purely imaginary eigenvalues, they are only neutrally stable. For linear problems (e.g., ...
David Ketcheson's user avatar
4 votes

Why have specialised upwind schemes been developed to solve hyperbolic equations?

Central differencing schemes are not stable if you have advection dominated problems. There really was no other trivial [1] alternative to developing upwind schemes. [1] There are a few other ...
Wolfgang Bangerth's user avatar
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

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