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 ...
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 ...
user avatar
  • 11.4k
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 ...
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 ...
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 ...
user avatar
  • 11.4k
6 votes
Accepted

How can i get gauss-lobatto points on a quadrilateral?

For domains that are logically square or cubic (like your quadrilateral), you can use the tensor product (dimension-by-dimension) approach. That is, generate the 2D Gauss-Lobatto point matrix as the ...
user avatar
  • 2,106
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 ...
user avatar
  • 2,983
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. ...
user avatar
  • 188
5 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 ...
user avatar
  • 2,557
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: <...
user avatar
4 votes

explain the difference between 1D Poisson solvers

First, some notation for clarity. We're talking about solving $u_{xx}=f(x)$. So $u$ is the solution and $f$ is the right hand side. What makes you think either of your solutions is or is not correct? ...
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 ...
user avatar
  • 2,983
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 ...
user avatar
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 ...
user avatar
3 votes

How to calculate numerical dispersion relations for Spectral Elements?

The key steps are to consider the advection equation $u_t + au_x = 0$ where $a=\omega/k$ is the advection speed. Exact solutions to this equation is of the form $u(x,t) = f(x-at)$, where $f(y)$ is an ...
user avatar
3 votes
Accepted

How are Spectral Methods applied to CFD? In particular, how is the pressure-velocity coupling implemented?

For incompressible spectral DNS, often you'll see reference to John Kim, Parviz Moin and Robert Moser (1987): Turbulence statistics in fully developed channel flow at low Reynolds number, Journal of ...
user avatar
3 votes

Solve steady state reaction-diffusion/Helmholtz equation numerically

One approach to acceleration would go as follows: Assume that $A^t=A(u^t)$ is the matrix you try to solve with, i.e., you are looking to solve the linear systems $$ A^t x^t = b^t. $$ Let me assume ...
user avatar
3 votes

Computing Kolmogorov/Energy spectrum for turbulent boundary layer

1) One usually chooses one or two representative wall-normal distances and presents the spectra for <u'u'>, <v'v'>, ...
user avatar
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 ...
user avatar
  • 188
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 ...
user avatar
  • 2,983
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 $\...
user avatar
  • 3,673
2 votes

Solve diffusion equation with linear source term

In the comments you mentioned that $f$ has a very special form. Let $u:[a,b]\rightarrow \mathbb{R}$. Then $f:[a,b]\rightarrow\{0,1\}$ is defined for some set $S \subset [a,b]$ as follows: $$f(x) = \...
user avatar
  • 1,877
2 votes
Accepted

Zero-k mode in Pseudo-spectral solution of Stokes Flow

You are correct that the $k=0$ mode corresponds to the mean (volume averaged) velocity in the domain. Because the equations for Stokes flow are Galilean invariant they are undetermined up to a ...
user avatar
2 votes

Solving Stokes flow with walls using Oseen tensor

If you want to use nonperiodic boundary conditions, you could change the Fourier basis in the $y$-direction for your spectral method to a Chebyshev basis. Fast Chebyshev Transforms make use of Fast ...
user avatar
2 votes

How are Spectral Methods applied to CFD? In particular, how is the pressure-velocity coupling implemented?

Frequently some sort of velocity-pressure splitting is employed which gives a step in the method where the velocity and pressure are coupled directly.
user avatar
  • 10.8k
2 votes

Enforcing non-negative constraint in fourier-spectral method

This is more of a comment, but I believe the more common name for this is "positive trigonometric polynomial", so this book might be helpful. One approach (http://www.mit.edu/~parrilo/cdc03_workshop/...
user avatar
  • 11.4k
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 ...
user avatar
  • 3,673
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 ...
user avatar
  • 649
2 votes
Accepted

Solving new linear system that comes from an $p$ enrichment

What you are thinking of is something that uses the structure of the augmented matrix to make solution of the system simpler. For example, one could be tempted to think of forming the Schur complement ...
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 -- ...
user avatar

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