Skip to main content
9 votes

What is the advantage of using a particular RK Scheme?

You're looking only at the errors themselves and not other properties of the solution. There are sometimes good cases to consider lower-order schemes because they better preserve important ...
Daniel Shapero's user avatar
8 votes
Accepted

Why can ill-conditioned linear systems be solved precisely?

Added after my initial answer: It appears to me now that the author of the referenced paper is giving condition numbers (apparently 2-norm condition numbers but possibly infinity-norm condition ...
Brian Borchers's user avatar
8 votes
Accepted

How to compute all the eigenvalues of a large sparse matrix using matlab?

"Get more RAM" may be one of your best options. :) Prices are reasonably low right now, and it's one of the best upgrades you can gift your computer anyway. 10k x 10k is borderline but still doable ...
Federico Poloni's user avatar
8 votes
Accepted

Taking derivative using FFT

I believe this stems from the fact that your function $f(x) = x^2$ does not have continuous derivatives once it is extended periodically like $$\tilde{f}(x) = f(x \ \mathrm{mod} \ 12 -6),$$ which ...
whpowell96's user avatar
  • 2,936
8 votes
Accepted

What is the advantage of using a particular RK Scheme?

There are lots of different properties which can be found in different time stepping schemes of the same order of accuracy: Different stability properties. While it may not appear that way with the ...
helloworld922's user avatar
6 votes
Accepted

Gauss-Lobatto quadrature and nodal points for FEM

Ok, here comes the answer promised in the comment section. Let's start the other way round, going from a general grid to Gaussian grids and further constructions such as spectral elements. In grid ...
davidhigh's user avatar
  • 3,197
5 votes

Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods

Indeed the problem was that you were trying to calculate your nonlinear term incorrectly and you forgot that: $$\mathcal{F}[(f(x))^{2}] \neq (\mathcal{F}[f(x)])^{2}$$ I changed your code to this: <...
Mithridates the Great's user avatar
5 votes
Accepted

Need an example Legendre-Gauss-Radau pseudospectral differentiation matrix or Matlab code

This is probably too late to help you, but here is a compact code that will do points, weights and first derivatives for Gauss, Lobatto or either Radau. ...
L. Young's user avatar
  • 188
5 votes
Accepted

Spectral methods, Spectral Volume methods, Spectral Difference methods

"Spectral methods" usually means methods which make use of global basis functions. Fourier spectral methods use sine and cosine, and are used when you have periodic boundary conditions. Chebyshev ...
cfdlab's user avatar
  • 3,038
4 votes

Role of weight function in Galerkin methods

Chebyshev are orthogonal wrt to a weight function which is singular at the end-points. When you approximate a function f(x) with Chebyshev, the convergence of the approximations is not affected by the ...
cfdlab's user avatar
  • 3,038
4 votes
Accepted

Pros of Fourier-Galerkin spectral methods

Pros: With trigonometric basis functions your problem size is $N \text{log}(N)$ instead of $N^2$. Stabilization techniques are easy to implement and cheap: Filtering in the modal space. Zero padding ...
ConvexHull's user avatar
  • 1,478
4 votes
Accepted

Solving ODE with Spectral Method using Chebyshev Polynomials

Your code does not solve the BVP you posted. Here is the revised version that works well. ...
Zoltan Csati's user avatar
4 votes

What does the Chebyshev differentiation matrix look like for third and fourth derivative?

Yes, you can take the third and fourth power of the Chebyshev differentiation matrix for approximating the third and fourh derivative. Why is this so? Because differentiation is an associative ...
davidhigh's user avatar
  • 3,197
4 votes

orthogonal basis functions on arbitrary domains and boundary conditions

From a mathematical perspective, the eigenfunctions of the Laplace operator span the space $L^2(\Omega)$ regardless of whether you choose Dirichlet or Neumann boundary conditions. As a consequence, ...
Wolfgang Bangerth's user avatar
4 votes
Accepted

Chebyshev/Lagrange polynomials in spectral methods

Your understanding is perfectly fine, except for the last statement that Lagrange polynomials turn out to be a more suitable choice. In fact, both methods, the modal and the nodal expansion, have ...
davidhigh's user avatar
  • 3,197
4 votes
Accepted

How can we calculate mixed derivatives numerically using the Chebyshev derivative matrix?

Note: Your nomenclature is only valid on Cartesian elements. If you want to calculate derivatives on arbitrary shapes you also have to consider spatial metric terms. Answer: To keep it simple, we ...
ConvexHull's user avatar
  • 1,478
3 votes

Calculating the Jacobian for a function containing a derivative

There are some unknowns in what you are doing but for simplicity, suppose we want to find $u(t)$ as discrete times $t_1, t_2, \cdots, t_n$. Let $\textbf{F} = [F(t_1), F(t_2), \cdots, F(t_n)]^T$ and $\...
spektr's user avatar
  • 4,308
3 votes

Solve wave equation with discontinuous coefficients numerically?

$c$ depending on time is not the issue. You will use an RK scheme which takes care of this. The issue is $c$ is discontinuous in $x$. I recommend SBP-SAT schemes for this. (1) Derive an energy ...
cfdlab's user avatar
  • 3,038
3 votes

Role of weight function in Galerkin methods

First, Galerkin in his article from 1915 does not discuss any weighting other the $\omega(x) = 1$. The Galerkin method is a direct generalization of the Rayleigh-Ritz method, and a variational ...
L. Young's user avatar
  • 188
3 votes
Accepted

How do I form the Chebyshev differentiation matrix in MATLAB?

I'm assuming that you know how Chebyshev collocation methods work (but if not, let me know and I'll explain a bit more); a good introduction is Nick Trefethen's Spectral Methods in Matlab as well as ...
Christian Clason's user avatar
3 votes

Chebyshev/Lagrange polynomials in spectral methods

To complete david's answer: References: Canuto et al., Spectral Methods Fundamentals in Single Domains We consider the Burgers equation \begin{align} \text{advective form}: \qquad \frac{\partial u}{\...
ConvexHull's user avatar
  • 1,478
3 votes

in Finite Element, which approximation requires less number of unknowns: B-splines vs Shape functions vs Spectral Elements

Based on the comments below your post you may reach the conclusion that # DOFs and speed have no correlation whatsoever - this is not true. Keeping all other things fixed and increasing the number of ...
lightxbulb's user avatar
  • 2,352
3 votes
Accepted

Where am I making a mistake in solving the heat equation using the spectral method (Chebyshev's differentiation matrix)?

The answer is quite simple: You have to set the Neumann boundary condition $u_x(-1,x)=0$ explicitly Add following line (fifth line): ...
ConvexHull's user avatar
  • 1,478
2 votes

Role of weight function in Galerkin methods

The basis functions $\{p_n(x): n \in \mathbb{N}\}$ can be orthogonal in $[a, b]$ with respect to a weight function $w(x)$. For example, Hermite polynomials are orthogonal in $(-\infty, \infty)$ with ...
nicoguaro's user avatar
  • 8,582
2 votes

Role of weight function in Galerkin methods

I will answer you in order: 1) The problem to solve is independent of the weighing function you choose, e.g. you could solve for a PDE using standard finite element basis (Lagrange) without using ...
HBR's user avatar
  • 1,658
2 votes

Average value divergence in spectral method for Poisson equation

I have an answer, but I'm still curious if there are simpler answers. The basic idea is that we break the charge density into two parts: one with an average density of zero, and one with a constant ...
lnmaurer's user avatar
  • 151
2 votes
Accepted

build a simple incompressible solver with spectral method

Your algebra is fine. Periodic boxes are particularly nice for imposing incompressibility: as you found out, you can easily get rid of pressure. [This intimately has to do with the fact that ...
BenBoulderite's user avatar
2 votes
Accepted

Solve wave equation with discontinuous coefficients numerically?

Here is a brute force solution that would work no matter what is the discontinuity and nonlinearity in $c(x,t)$. Write your PDE as a system of two: $ \dot{y}=z\\ \dot{z}=c^2(x,t) y_{xx} $ Now, ...
Maxim Umansky's user avatar
2 votes
Accepted

How to define a non-square Legendre pseudospectral differentiation matrix?

For the purpose of solving a differential equation, the differentiation matrix must be square (and invertible). You have added additional degrees of freedom -- thus increasing the number of columns -- ...
Christian Clason's user avatar

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