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