Download presentation
Presentation is loading. Please wait.
Published byAdrian Bishop Modified over 9 years ago
1
Chapter 13 More about Boundary conditions Speaker: Lung-Sheng Chien Book: Lloyd N. Trefethen, Spectral Methods in MATLAB
2
Consider Chebyshev node onfor Preliminary: Chebyshev node and diff. matrix [1] Even case: Odd case: Uniform division in arc
3
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
4
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
5
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
6
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
7
Preliminary: DFT [2] Direct computation of derivative of, we have Example: is a Toeplitz matrix. Second derivative is
8
Preliminary: DFT [3] For second derivative operation second diff. matrix is explicitly defined by using Toeplitz matrix (command in MATLAB) Symmetry property:
9
Preliminary: DFT [4] Eigenvalue of Fourier differentiation matrix iscorresponding to eigenvector for and has multiplicity 2 and when and, we have
10
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:
11
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
12
Inhomogeneous boundary data [1] Let be unique polynomial of degreewith and 1 for 2 Setfor Method I 1 zero neglect or say
13
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
14
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
15
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
16
Mixed type B.C. [3] Solution under N = 16 exact solution
17
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
18
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
19
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
20
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.
21
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.
22
Allen-Cahn : example 2 [1] with parameterand initial condition Let be unique polynomial of degreewith and 1 for 2 Setfor Method I Second, set
23
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 1 2 3 Neglectcomputed from 2, and reset
24
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
25
Allen-Cahn : example 2 [4] graph concave up ? Threshold is In fact we can estimate trend of transient at point and, thenbut
26
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
27
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
28
Laplace equation : order active variable [3] MATLAB use column-major, so we index active variable by column-major 6 5 4 3 2 1 12 11 10 9 8 7 18 17 16 15 14 13 24 23 22 21 20 19 30 29 28 27 26 25 36 35 34 33 32 31 and column-major
29
Laplace equation : order active variable [4]
30
Laplace equation : find boundary point [5]
31
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)
32
Laplace equation : construct matrix [7] Definition: Kronecker product is defined by Set for 2 (interior points)
33
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
34
Laplace equation : right hand side vector [9] Boundary data: 6 5 4 3 2 1 12 11 10 9 8 7 18 17 16 15 14 13 24 23 22 21 20 19 30 29 28 27 26 25 36 35 34 33 32 31 identify
35
Laplace equation : right hand side vector [10] Boundary data: identify 6 5 4 3 2 1 12 11 10 9 8 7 18 17 16 15 14 13 24 23 22 21 20 19 30 29 28 27 26 25 36 35 34 33 32 31
36
Laplace equation : results [11] Solution under N = 5, method II Solution under N = 24, method II
37
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)
38
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 1 2 3 replacecomputed from 2 by Neumann B.C. Chebyshev diff. matrix
39
Wave equation: order active variable [3] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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)
40
Wave equation: action of Chebyshev operator [4] Chebyshev 2nd diff. matrix 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 index ( i,j ) is logical index according to index of ordinates x, y
41
Wave equation: action of Fourier operator [5] Fourier 2nd diff. matrix 123456 789101112 131415161718 192021222324 252627282930 313233343536 Take transpose
42
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
43
Wave equation: Neumann B.C. in y-coordinate [7] 3 replacecomputed from 2 by Neumann B.C. We require foror say
44
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
45
Wave equation: result [9] Solution under, method II Theoretical optimal value is (see exercise 13.4)
46
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
47
Exercise 13.2 [2] (1)Resolution is adaptive and (2)Monotone under tolerance
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.