The 2024 Developer Survey results are live! See the results

# Questions tagged [spectral-method]

For questions about spectral methods, a technique for solving differential equations by expressing them in terms of some computationally convenient basis (typically that obtained via fast fourier transform). Questions could relate to the theory behind the method or details of implementing for a particular problem.

93 questions
Filter by
Sorted by
Tagged with
1 vote
75 views

• 73
762 views

### Solving ODE with Spectral Method using Chebyshev Polynomials

I would like to solve following the basic equation of linear elasticity (for simplicity in 1D) $$\frac{d}{dx} \left( E \frac{du}{dx} \right) = 0 \quad \textrm{with} \quad u(1)=0, \; u(-1)=b$$ ...
• 33
1 vote
345 views

### Solving Poisson-like PDE with FFT

Problem I have an $n\times n$ grid, and each point on the grid is assigned two values: a score, and an (inverse) speed factor. There is a "turtle" moving along the grid, and it's goal is to ...
• 131
123 views

### Calculating the Jacobian for a function containing a derivative

I have the equation $F(t) = \phi u + \frac{1}{2}\frac{d^2u}{dt^2} + u^3$ and broadly speaking, my task is to calculate the $\phi$ and $u(t)$ such that $F(t) = 0$. I am testing out a new algorithm to ...
• 131
2k views

• 219
226 views

### Pros of Fourier-Galerkin spectral methods

What are the pros of Fourier-Galerkin spectral methods while solving PDEs? Here's the one that came in my mind first: Easy implementation: using this method, differentiation operator computation is ...
1 vote
229 views

### Poisson equation with FFT and normalization

I'm trying to understand how to solve Poisson equation with FFT. Say, if we have the simplest periodic example $$u_{xx}=-4\pi\cos(x)$$ The solution then should be $$u=4\pi\cos(x)$$ I really get ...
• 11
60 views

### Spectral Clustering by Andrew Ng paper: theorem proof question

I recently read the paper "On Spectral Clustering: Analysis and an Algorithm" by Ng et al. Much of the paper centers on Theorem 2 and equation 8. To me, it appears there is no given or referenced ...
71 views

### Spectral solver on em-pic

I'm recently studying for the spectral solver to implement EM-PIC code. I read an article and have some questions. Many PIC codes uses spectral solver to overcome numerical artifacts on FDTD. In the ...
233 views

### how to construct chebyshev differentiation matrix of even/odd polynomial

I know there is efficient way to construct chebyshev differentiation matrix $D_N$. The idea is to fit the function $f(x)$ with a polynomial of $p_N(x)$ of order $N$, and use the derivative $p_N'(x)$ ...
1 vote
750 views

### Dealing with boundary conditions using Fourier spectral methods

I am currently working on a project where I need to use Fourier spectral methods to solve the KS equation. I found this code which is using the Fourier spectral methods to solve the classic 1D heat ...
1 vote
173 views

### How to choose between compact finite differences and spectral methods

For a project in my advanced numerical method class I have to solve the 1D Kuramoto-Sivashinsky equation. $$u_t + u u_x + \lambda u_{xx} + \eta u_{xxxx} = 0.$$ As explained here I will solve it ...
359 views

### What is the difference between Methods of Weighted Residuals and Spectral Methods?

Methods of Weighted Residuals (MWR) [1] usually include Galerkin, collocation, method of moments, least-squares and subdomain methods. Spectral methods [2] usually include Galerkin, tau and ...
• 188
1 vote
1k views

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

In matlab, there are 2 commands named "eig" for full matrices and "eigs" for sparse matrices to compute eigenvalues of a matrix. And eig(A) computes all the eigenvalues of a full matrix and eigs(A) ...
• 981
876 views

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

I'm trying to implement various kinds of pseudospectral methods for direct optimization in Matlab using IPOPT. I've got some working Legendre-Gauss-Lobatto code, but would like to use the flipped ...
• 143
180 views

### Imposition of Dirichlet BC for Fourier pseudospectral in this paper

I was trying to implement the algorithm from the paper "Adapting a Fourier pseudospectral method to Dirichlet boundary conditions for Rayleigh–Benard convection". I am having a hard time to ...
225 views

### Average value divergence in spectral method for Poisson equation

I'd like to know how to deal with a divergence when trying to solve the Poisson equation for electrostatics with a simple spectral method. I'm not sure how to best state my problem, so I'll explain ...
• 151
282 views

### build a simple incompressible solver with spectral method

I am trying to build a simple solver for the incompressible fluid in a periodic box to learn the spectral method. I am following the textbook (Peyret R. Spectral methods for incompressible viscous ...
906 views

• 376
1 vote
645 views

### Chebyshev spectral differentiation matrix for mapped domain

This is a follow up to this question. I have mapped from Chebyshev space to the physical space using the mapping $x = ((1-w)\xi^3 - x_p\xi^2 + w\xi + x_p + 1 )*(L/2)$. When in Chebyshev space I have ...
1 vote
94 views

### Find B-spline coefficients from values on collocation points

The context of my question is how to compute high order derivates on direct numerical simulation of turbulent channel flow. It is of particular interest for fluid dynamics and turbulence research. I ...
• 121
1 vote
68 views

### Pseudo-Spectral cosine transform

I'm trying to solve the following equation $$u_t = u_{xx} + u(1-u^2), u_x(\pm 1) = 0,$$ using the Fourier cosine transform. The nonlinear term gives a convolution which I would rather avoid, which is ...
• 184
110 views

### Need clarification on a piece of book excerpt about spectral element method!

I am reading "Using MPI (3rd edition)" from William Gropp, where in chapter 4 application section 4.13, it introduces an MPI application Nek5000/NekCEM which is based on spectral element method (SEM) ...
• 689
1 vote
82 views

### Perfect filtering of high frequencies in 2D FFT (Multidimensional 2/3 Rule)

Let $u_n$ be an array containing discrete values of the function $u(x,y)$. Performing a 2D FFT to this array we obtain $\hat{u_n}$ representing the values of $\hat{u}(k_x,k_y)$. I would like to ...
144 views

### Closed form PDF/CDF using Orthogonal Polynomial Expansion (gPC)

Consider a random variable which is given by an orthogonal polynomial expansion in one parameter (or polynomial chaos expansion PCE), i.e. ,  f(\alpha) = \sum\limits_{n=0}^{\infty} \hat{f} (n) \psi ...
• 245
1 vote
271 views

### How is the dense system usually dealt with in spectral method?

Unlike finite element (FEM) or finite difference methods (FDM), where the original PDE is transformed into a sparse linear system, spectral methods return a dense linear system. For a large system, it'...
• 689