# Tag Info

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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...

### 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: <...

### 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? ...

### 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 ...
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 ...
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 ...

### 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 ...
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 ...

### 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 ...

### 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'>, ...

### 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 ...

### 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 ...

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 $\... 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) = \... 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 ... 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 ... 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. 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/... 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 ... 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 ... 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 ...