Chapter 13 More about Boundary conditions Speaker: Lung-Sheng Chien Book: Lloyd N. Trefethen, Spectral Methods in MATLAB
Consider Chebyshev node onfor Preliminary: Chebyshev node and diff. matrix [1] Even case: Odd case: Uniform division in arc
Preliminary: Chebyshev node and diff. matrix [2] GivenChebyshev nodesand corresponding function value We can construct a unique polynomial of degree, called is a basis. where differential matrixis expressed as for where with identity Second derivative matrix is
Preliminary: Chebyshev node and diff. matrix [3] Letbe the unique polynomial of degreewith define, then impose B.C. and for We abbreviate,that is, In order to keep solvability, we neglect,that is, zero neglect Similarly, we also modify differential matrix as
Asymptotic behavior of spectrum of Chebyshev diff. matrix In chapter 10, we have showed that spectrum of Chebyshev differential matrix (second order) approximates with eigenmode Eigenvalue ofis negative (real number) and Large eigenmode ofdoes not approximate to Since ppw is too small such that resolution is not enough 1 2 Mode N is spurious and localized near boundaries
Preliminary: DFT [1] Definition: band-limit interpolant of, is periodic sinc function If we write, then Also derivative is according to Given a set of data pointwithis even, Then DFT formula for for
Preliminary: DFT [2] Direct computation of derivative of, we have Example: is a Toeplitz matrix. Second derivative is
Preliminary: DFT [3] For second derivative operation second diff. matrix is explicitly defined by using Toeplitz matrix (command in MATLAB) Symmetry property:
Preliminary: DFT [4] Eigenvalue of Fourier differentiation matrix iscorresponding to eigenvector for and has multiplicity 2 and when and, we have
How to deal with boundary conditions Method I: Restrict attention to interpolants that satisfy the boundary conditions. Example: chapter 7. Boundary value problems Method II: Do not restrict the interpolants, but add additional equations to enforce the boundary condition. Helmholtz equation: Poisson equation: Eigenvalue problem: Nonlinear ODE: Linear ODE:
Recall linear ODE in chapter 7 Chebyshev nodes: zero neglect Let be unique polynomial of degreewithand 1 for 2 Setfor Method I with exact solution
Inhomogeneous boundary data [1] Let be unique polynomial of degreewith and 1 for 2 Setfor Method I 1 zero neglect or say
Inhomogeneous boundary data [2] Method of homogenization satisfies, decompose, then which can be solved by method I method I directly method of homogenization Solution under N = 16 method I is good even for inhomogeneous boundary data exact solution
Mixed type B.C. [1] Let be unique polynomial of degreewith and 1 for 2 Setfor Method I How to do? Method II Let be unique polynomial of degreewith and for Setfor easy to do 1 2 zero neglect
Mixed type B.C. [2] Set 3, we add one more constraint (equation) zero Active variablewith governing equation from Neumann condition In general, replacebysince the method works for from interior point
Mixed type B.C. [3] Solution under N = 16 exact solution
Allen-Cahn (bistable equation) [1] Nonlinear reaction-diffusion equation: whereis a parameter 1 This equation has three constant steady state, ( consider ODE, equilibrium occurs at zero forcing) 2 is unstable andis attractor. is Logistic equation. for
Allen-Cahn (bistable equation) [2] 3 Solution tends to exhibit flat areas close to, separated by interfaces That may coalesce or vanish on a long time scale, called metastability. interface boundary value: for
Allen-Cahn : example 1 [1] with parameterand initial condition Let be unique polynomial of degreewith and 1 for 2 Setfor Method I 1 neglect or say
Allen-Cahn : example 1 [2] Temporal discretization: forward Euler with CFL condition ( eigenvalue ofis negative (real number) and) One can simplify above equation by using equilibrium ofat boundary point.
Allen-Cahn : example 1 [3] interface boundary value: Solution under N = 20 with parameterand initial condition Metastability up tofollowed by rapid transition to a solution with just one interface.
Allen-Cahn : example 2 [1] with parameterand initial condition Let be unique polynomial of degreewith and 1 for 2 Setfor Method I Second, set
Allen-Cahn : example 2 [2] However we cannot simplify as following form since is NOT an equilibrium. Let be unique polynomial of degreewith for Setfor Method II Neglectcomputed from 2, and reset
Allen-Cahn : example 2 [3] Step 1: Step 2: Solution under N = 20, method II Final interface is moved from toand transients vanish earlier at instead of and
Allen-Cahn : example 2 [4] graph concave up ? Threshold is In fact we can estimate trend of transient at point and, thenbut
Laplace equation [1] subject to B.C. boundary data is continuous Let be unique polynomial, and 1 2 Set for Method I for (interior point) for Briefly speaking, method I take active variables as However method 1 is not intuitive to write down linear system if we choose Kronecker-product
Laplace equation [2] Set for Method II (all points) 1 2 (interior points) 3 Additional constraints (equations) for boundary condition. for method II take active variables as Technical problem: 1. How to order the active variables 2. How to build up linear system (matrix) 3. How to write down right hand side vector (including second derivative and additional equation) Let be unique polynomial, for
Laplace equation : order active variable [3] MATLAB use column-major, so we index active variable by column-major and column-major
Laplace equation : order active variable [4]
Laplace equation : find boundary point [5]
Laplace equation : find boundary point [6] b is index set of boundary points, if we write down equations according to index of active variables, then we can use index set b to modify the linear system. Chebyshev differentiation matrix: (second order)
Laplace equation : construct matrix [7] Definition: Kronecker product is defined by Set for 2 (interior points)
Laplace equation : construct matrix [8] 3 Additional constraints (equations) for boundary condition. for We need to replace equation of on boundary points by Index of boundary points for such that(boundary point) where four corner points each edge has N-1 points
Laplace equation : right hand side vector [9] Boundary data: identify
Laplace equation : right hand side vector [10] Boundary data: identify
Laplace equation : results [11] Solution under N = 5, method II Solution under N = 24, method II
Wave equation [1] subject to B.C. Periodic B.C. in x-coordinate 1 Separation of variables leads to Fourier discretization in x 2 Chebyshev discretization in y, we must deal with Neumann B.C. 3 Leap-frog formula in time Leap-frog eigenvalue of(chebyshev diff. matrix) is negative and eigenvalue of(Fourier diff. matrix) is eigenvalue of(Fourier diff. matrix) is negative and Hence stability requirement ofis ( author chooses)
Wave equation [2] Periodic B.C. in x-coordinate 1 Fourier discretization in x 2 Chebyshev discretization in y Method II Let be unique polynomial of degreewith for Setfor replacecomputed from 2 by Neumann B.C. Chebyshev diff. matrix
Wave equation: order active variable [3] column-major In this example, we don’t arrange as vector but keep in 2-dimensional form say, the same arrangement of xx and yy generated by meshgrid(x,y)
Wave equation: action of Chebyshev operator [4] Chebyshev 2nd diff. matrix index ( i,j ) is logical index according to index of ordinates x, y
Wave equation: action of Fourier operator [5] Fourier 2nd diff. matrix Take transpose
Wave equation: action of operator [6] Let active variable be, then operator for Laplacian is Combine with Leap-frog formula in time where initial condition is Gaussian pilse traveling rightward at speed 1 Question: how to match Neumann boundary condition
Wave equation: Neumann B.C. in y-coordinate [7] 3 replacecomputed from 2 by Neumann B.C. We require foror say
Wave equation: Neumann B.C. in y-coordinate [8] or say where written as Step 1: time evolution by Leap-frog Step 2: correct boundary data where Given Procedure of wave equation simulation
Wave equation: result [9] Solution under, method II Theoretical optimal value is (see exercise 13.4)
Exercise 13.2 [1] The lifetimeof metastable state depends strongly on the diffusion constant The value of t at whichfirst becomes monotonic in x. with parameterand initial condition 1 what is graph of 2 Asymptotic behavior of as
Exercise 13.2 [2] (1)Resolution is adaptive and (2)Monotone under tolerance