12 votes
Accepted

Motivation behind Collocation Method

I would not insist on demanding a geometrical meaning from Galerkin methods in general. There is a connection, but it becomes less meaningful as you extend it further and further. (In a sense, it ...
Christian Clason's user avatar
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

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

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

Numerically computing the advection equation

I see several issues: The DFT computed with fft puts the zero mode at the beginning of the array, and if you want to compute the derivative, it is necessary to ...
Kirill's user avatar
  • 11.4k
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,444
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

Interpolation with the roots of orthogonal polynomials & Spectral expansion

I hope I understood the question correctly. They try to compute exactly the same thing, so they really are equivalent. I'll use Chebyshev polynomials because they are easy to analyze. Given a ...
Kirill's user avatar
  • 11.4k
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,127
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,028
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
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,028
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,287
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,127
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,287
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,028
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

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,238
3 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
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,287
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,112
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,287
2 votes

Interpolation with the roots of orthogonal polynomials & Spectral expansion

Thanks for Kirill's detailed answer, which clarifies all the confusion in my head. According to Kirill's answer and the materials he provided, now I want to generalize it a bit to common cases. Let ...
user123's user avatar
  • 679
2 votes

Achieving high relative accuracy (vs. absolute accuracy) using spectral methods

So I went ahead and implemented a code in Matlab that can solve this problem using a spectral approach, utilizing a simple polynomial basis. Using a simple polynomial basis of order 20 resulted in the ...
spektr's user avatar
  • 4,238
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,500
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

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