Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spectral-method]

The tag has no usage guidance.

0
votes
1answer
56 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 ...
1
vote
1answer
45 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 ...
2
votes
1answer
83 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 ...
3
votes
3answers
156 views

Role of weight function in Galerkin methods

I have difficulties in understanding the role of the weight function $w(x)$ that occurs in the solution of PDEs via the Galerkin approach. Consider a linear differential equation of the form $$ \...
1
vote
2answers
517 views

Continuum removal algorithm in python

I'm using python 2.7 (on jupyter notebook, win10 64 bit) to perform my analysis. I need to perform continuum removal (CR) on a reflectance spectrum data. I need it to be as described here. EDITED: ...
13
votes
2answers
574 views

Why can ill-conditioned linear systems be solved precisely?

According to the answer here, large condition number (for linear system solving) decreases the guaranteed number of correct digits in the floating point solution. Higher order differentiation matrices ...
1
vote
0answers
69 views

Solve a PDE BVP with Spectral methods in time and space?

I have a PDE (coming from a Bellman equation with $z$ under brownian motion). Let $z \in [0,\infty)$ and $t \in [0,T]$. To sketch the equation: $$ (r - g(t)) v(t,z) = \pi(t,z) + (\gamma - g(t))v_z(...
1
vote
1answer
335 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
0answers
68 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 ...
1
vote
0answers
32 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 ...
0
votes
1answer
89 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) ...
1
vote
0answers
43 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 ...
4
votes
0answers
93 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 ...
1
vote
2answers
117 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'...
3
votes
2answers
114 views

Finite element method in $x$, $y$, spectral method in $z$

I'm working on a certain problem of slow, non-Newtonian, thin-film flow. This problem can be modelled with the incompressible Stokes equations: $\nabla\cdot 2\mu(\dot\varepsilon)\dot\varepsilon - \...
3
votes
1answer
190 views

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

I am going to discuss my reasons for wanting this first, as this may in fact not be what I am looking for. My reason for asking this that I have finished writing a piece of code that solves, $-\nabla ...
2
votes
1answer
488 views

Spectral methods, Spectral Volume methods, Spectral Difference methods

Could someone explain the link (if any) between the spectral methods (SM), as presented for example here and the so called spectral volume methods (SV) and spectral difference methods (SD) for CFD ? ...
4
votes
0answers
58 views

Differential eigenproblem with eigenvalue in boundary condition

Statement of the problem I need to (numerically) solve an eigenproblem of the type $$-\omega^2\mathcal{D}_1\vec{x}=\mathcal{D}_2\vec{x}$$ on the interval $[-1,1]$, where $\mathcal{D}_1$ and $\...
1
vote
0answers
165 views

How to form the stiffness matrix for the Poisson equation using a spectral method

This is a follow-up question to How do I form the Chebyshev differentiation matrix in MATLAB? The goal of the following code is to solve the Poisson problem: ...
4
votes
1answer
895 views

How do I form the Chebyshev differentiation matrix in MATLAB?

I have some code that does exactly this, but I do not like to use things I do not understand. Here is the code ...
3
votes
0answers
91 views

Spectral/hp-finite elements for 4th order PDEs

Does anyone know of references discussing the solution of 4th order PDEs by way of spectral/hp-finite element methods? Specifically, I'm interested in the extension of the spectral element method, ...
3
votes
1answer
166 views

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

Problem I have a PDE that I'm trying to solve with spectral methods. The solution $y$ is always positive, and decays as $y \propto e^{-ax}$ for large $x$. The domain is $[0, \infty)$. (There are ...
1
vote
0answers
45 views

Second and Higher Order Order Corrector in Spectral Deferred Correction

I am trying to work out a second order or higher order correction for the method of Spectral deferred Correction (SDC). Specifically using as a corrector a second order or third order multi-step. In ...
1
vote
0answers
174 views

Numerically computing Viscous Burger

I am trying to solve the Viscous Burgers equation using the spectral method. $$u_t+uu_x = Du_{xx}$$ where $D$ is a constant (chosen to be zero) and with the initial condition $$u(x,0) = exp(-x/0.2)^2$$...
3
votes
1answer
630 views

Numerically computing the advection equation

I am trying to write a program to compute the advection equation. $$u_t +u_x = 0$$ I use the spectral method for the spatial derivative $u_x$ and the leapfrog method for the time derivative $u_t$. ...
4
votes
2answers
247 views

Interpolation with the roots of orthogonal polynomials & Spectral expansion

I'm a bit confused about the relationships between these two approximation methods mentioned in the title. Does this kind of interpolation also belongs to the field of spectral methods? Are the ...
2
votes
1answer
615 views

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

How can I get Gauss-Lobatto points on a quadrilateral or a triangle in $x$-$y$ plane? I am only getting abscissa coordinates and weights by solving Lobatto polynomials using Lobatto quadrature. ...
2
votes
1answer
71 views

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

Let's say I am solving a simple Poisson problem using a Mixed (DG) finite element method. If we use orthogonal polynomials as basis functions we can write the finite-dimensional linear system as $$ ...
3
votes
0answers
184 views

Spectral Collocation (or Weighted Residual) Methods to solve Stiff ODEs?

I have a system of ODEs which is (at least moderately) stiff. Consider the class of spectral collocation methods https://en.wikipedia.org/wiki/Spectral_method or the related class of weighted ...
4
votes
2answers
379 views

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

I know that spectral-methods which are weighted-residual methods can be applied to solve for the incompressible N-S equations. In particular, they are applied to Direct Numerical Simulations (DNS) for ...
7
votes
2answers
203 views

Enforcing non-negative constraint in fourier-spectral method

I have a PDE optimization problem, and a scalar field (which I am optimizing over) is supposed to be nonnegative everywhere in the domain. Since I am working in Fourier space for solving this problem ...
1
vote
0answers
94 views

Implicit time integrator for Chebyshev collocation method for linear hyperbolic system

I want to solve linear hyperbolic system using Chebyshev collocation method. As this method puts severe constraint on the time step for the explicit time integration, I decided to switch to implicit ...
1
vote
0answers
37 views

Aliasing question for a spectrally derived Lagrangian

Consider two functions $$X=\sum_{n=-N}^N i\ sign(n) y_n e^{-in\xi}; \quad \quad Y = \sum_{n=-N}^N y_n e^{-in\xi}.$$ where $y_n$ are the dependent variables of the system, and are functions of time. ...
1
vote
0answers
140 views

Am I using the incorrect implementation of the fast Chebyshev transform?

I was told that the fast Chebyshev transform has superior spectral convergence, but I am unable to verify its rumored convergence. I was given plots of its spectral convergence, where the signal's ...
4
votes
1answer
199 views

How to calculate numerical dispersion relations for Spectral Elements?

How can we determine the numerical dispersion relation of a Spectral Element Method which leads to coupled systems of algebraic equations? What approaches to do analysis of dispersion relations is ...
5
votes
3answers
381 views

Variable viscosity Stokes equation

One very efficient way to solve Stokes equation with periodic boundary conditions \begin{equation} -\eta \nabla^{2} \bf{v} + \nabla p = f \\ \nabla \cdot \bf{v} = 0 \end{equation} is using the ...
4
votes
1answer
92 views

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

I'm trying to solve a Stokes flow problem with a pseudo-spectral method in periodic boundary conditions. The equations of interest are $-\nabla^2 \bf{v} + \nabla p = \bf{f} \\ \nabla \cdot \bf{v} = ...
1
vote
1answer
302 views

Solve steady state reaction-diffusion/Helmholtz equation numerically

I am solving a problem of the form: $\dfrac{\partial u(x,y,t)}{\partial t} = \nabla^2 u(x,y,t) - f(x,y,t)u(x,y,t) - \kappa(x,y,t)$ At the moment, I am solving this at each time step by assuming a ...
1
vote
3answers
511 views

Solve diffusion equation with linear source term

I would like to solve numerically the diffusion equation, where the sink term depends linearly on the field, and there is field-independent sink: $\frac{\partial^2 u(x)}{\partial x^2} =f(x)u(x) - \...
-2
votes
1answer
810 views

explain the difference between 1D Poisson solvers

I compared 2 methods for 1 dimensional Poisson equation solution. One is finite-difference method, "Successive Overrelaxation" from http://www.cs.berkeley.edu/~demmel/cs267/lecture24/lecture24.html; ...
2
votes
1answer
113 views

Trignometric/Fourier spectral collocation with zero Dirichlet BC in 2D

I am concerned with numerical solution to the following problem on $[0,1]\times[0,1]$. $\dfrac{\partial\theta}{\partial t}+u(x,t).\nabla \theta(x,t)=\kappa \nabla^2\theta(t,x)$ with Dirichlet ...
9
votes
2answers
560 views

Boundary conditions Chebyshev differentiation

I was wondering if anyone has any experience dealing with boundaries when implementing chebyshev differentiation. I am currently trying to implement a no slip boundary condition to solve the ...
4
votes
1answer
455 views

Two approaches to solving diffusion equation in Fourier space

I want to numerically solve the diffusion equation $\partial_t u = D \partial_x^2 u$ in Fourier space, and can think of multiple ways to do it. Setup Option 1 Differentiating $u$ twice in Fourier ...
3
votes
0answers
174 views

Integration of nonlinear PIDE via spectral methods

At the mean-field level, the dynamics of a polariton condensate can be described by a type of nonlinear Schrodinger equation (Gross-Pitaevskii-type), for a classical (complex-number) wavefunction $\...
3
votes
3answers
722 views

Solving Stokes flow with walls using Oseen tensor

Introduction I've developed a code to solve for generalised, incompressible 2D Stokes flow $\eta \nabla^2 \mathbf{v} - \nabla p + \mathbf{S} = 0$ $\nabla . \mathbf{v} = 0$ where $\mathbf{S}$ can ...
1
vote
2answers
1k views

Computing Kolmogorov/Energy spectrum for turbulent boundary layer

Previously, I have calculated energy spectrum for 3D DNS data obtained for isotropic turbulence which is equally spaced in all three directions and then to compute the energy spectrum, one performs ...
5
votes
1answer
2k views

Sign differences in spectral decomposition in NumPy

I am trying to understand an example from a book, but I seem to get different answers depending on which spectral decomposition function I use in NumPy. I am trying to find a spectral decomposition $...
2
votes
1answer
382 views

2d pseudo-spectral turbulence simulation with random initial velocities

I am trying to write a 2d pseudo-spectral DNS code with random initial velocities. This is kind of a classic simulation where the very tiny vortices group together forming larger and larger vortices ...
7
votes
2answers
261 views

Spectral Methods in time

I was reading up on Spectral Methods for PDEs. In all the descriptions I read, while the position component is approximated via a Fourier series or other methods, the time component is still ...
2
votes
1answer
777 views

Partial derivatives of a 3D array in Matlab

I'm interested in taking some partial derivatives of a 3 dimensional array in Matlab - say $A(i,j,k)$ approximates $f(x_i,y_j,z_k)$. I need to approximate things like $\partial_{xy}f$, $\partial_{yz}...