Methods for Solving 2-point Boundary Value Problems Chaiwoot - - PowerPoint PPT Presentation

methods for solving 2 point
SMART_READER_LITE
LIVE PREVIEW

Methods for Solving 2-point Boundary Value Problems Chaiwoot - - PowerPoint PPT Presentation

Methods for Solving 2-point Boundary Value Problems Chaiwoot Boonyasiriwat August 20, 2020 Boundary Value Problems To obtain a unique solution to a differential equation, conditions on the solution or its derivative must be specified.


slide-1
SLIDE 1

Methods for Solving 2-point Boundary Value Problems

Chaiwoot Boonyasiriwat

August 20, 2020

slide-2
SLIDE 2

▪ To obtain a unique solution to a differential equation, conditions on the solution or its derivative must be specified. ▪ If the conditions are specified at a single point, we have an initial value problem. ▪ If the conditions are specified at more than one point, we have a boundary value problem (BVP). ▪ For ODE, conditions are specified at 2 points leading to a two-point BVP.

Boundary Value Problems

Heath (2002, p. 422)

slide-3
SLIDE 3

▪ “Since a higher-order ODE can always be transformed to a first-order system of ODEs, so it suffices to consider only the first-order case.” ▪ A general first-order 2-point BVP for an ODE has the form with boundary conditions

First-order 2-point BVP

Heath (2002, p. 423)

slide-4
SLIDE 4

▪ “Boundary conditions are separated if any component

  • f g involves solution values only at a or at b.”

▪ “Boundary conditions are linear if they have the form ▪ Example: Separated linear boundary conditions 2nd-order scalar BVP is equivalent to 1st-order system with separated linear boundary conditions

First-order 2-point BVP

Heath (2002, p. 423)

slide-5
SLIDE 5

"For the general first-order 2-point BVP with boundary conditions let denote the solution to the ODE with initial condition for " “For a given ya, the solution of the IVP is a solution of the BVP if the system of nonlinear algebraic equations has a unique solution.”

First-order 2-point BVP

Heath (2002, p. 424)

slide-6
SLIDE 6

▪ “The shooting method replaces a given BVP by a sequence of IVPs.” ▪ A first-order two-point BVP is equivalent to the system

  • f nonlinear algebraic equations

▪ “One way to solve the BVP is to solve the nonlinear system .” ▪ “Evaluation of requires solving an IVP to determine .”

Shooting Method

Heath (2002, p. 427-428)

slide-7
SLIDE 7

Consider the BVP The initial slope is varied until the solution to the IVP at x =  matches the desired boundary value. The boundary conditions are The nonlinear system to be solved is

Shooting Method

Heath (2002, p. 428)

slide-8
SLIDE 8

“The first component of will be zero if .” “So, we must solve the scalar nonlinear equation in x2, for which we can use a root finding algorithm.”

Shooting Method

Heath (2002, p. 428)

slide-9
SLIDE 9

Consider the two-point BVP for the 2nd-order ODE with boundary conditions which can be transformed into a system of 1st-order ODEs where and The next step is to guess the initial slope value and to solve the corresponding IVP for . Then vary the initial slope until the right boundary condition is satisfied.

Example

Heath (2002, p. 429)

slide-10
SLIDE 10

First trial: using RK4 with h = 0.5 and Second trial: using RK4 with h = 0.5 and

Example: We want y1(1) = 1

Heath (2002, p. 429)

slide-11
SLIDE 11

Third trial: using RK4 with h = 0.5 and

Example: We want y1(1) = 1

Heath (2002, p. 429-430)

slide-12
SLIDE 12

▪ “The shooting method solves a BVP by approximately satisfying the ODE from the beginning and iterates until the boundary conditions are satisfied.” ▪ “The finite difference (FD) method satisfies the boundary conditions from the beginning and iterates until the ODE is approximately satisfied.” ▪ “The finite difference converts a BVP into a system of algebraic equations rather than a sequence of IVPs as in the shooting method.” ▪ “In a FD method, a set of mesh points within the domain is introduced and then any derivatives appearing in the ODE

  • r boundary conditions are replaced by FD approximations

at the mesh points.”

Finite Difference Method

Heath (2002, p. 431)

slide-13
SLIDE 13

Consider the BVP with Dirichlet boundary conditions We introduce mesh points where and seek approximate solution values The derivatives in the ODE are replaced by 2nd-order FD approximations

Example: 2 Dirichlet BCs

Heath (2002, p. 431)

slide-14
SLIDE 14

The ODE then becomes a system of algebraic equations “The system of algebraic equations resulting from a FD method for a two-point BVP may be linear or nonlinear, depending on whether f is linear or nonlinear in y and y'.”

Example: 2 Dirichlet BCs

Heath (2002, p. 431)

slide-15
SLIDE 15

Consider the BVP with boundary conditions Here, the mesh points are where and seek approximate solution values The derivatives in the ODE are replaced by 2nd-order FD approximations

Example: Dirichlet-Neumann BCs

Adapted from an example given in Heath (2002, p. 431)

slide-16
SLIDE 16

The ODE then becomes a system of algebraic equations The right BC contributes the last algebraic equation to the system of equations. Here, a one-sided 2nd-order FD approximation is used.

Example: Dirichlet-Neumann BCs

Adapted from an example given in Heath (2002, p. 431)

slide-17
SLIDE 17

Consider the two-point BVP with boundary conditions Let the mesh points are From the boundary conditions, we know that We then only seek an approximate solution Using finite difference approximations at x = 0.5, the ODE becomes

Example: FD

Heath (2002, p. 431-432)

slide-18
SLIDE 18

“Substituting the boundary data, mesh size, and right- hand side function for this example, we obtain” Rearranging this yields

Example: FD

Heath (2002, p. 431-432)

slide-19
SLIDE 19

“For a scalar two-point BVP with boundary conditions we seek an approximate solution of the form where the are basis functions defined on and c is an n-vector of parameters to be determined.” “Popular choices of basis functions include polynomials, B-splines, and trigonometric functions.”

Collocation Method

Heath (2002, p. 432-433)

slide-20
SLIDE 20

▪ “To determine the vector of parameter c, we define a set of n points , called collocation points, and force the approximate solution to satisfy the ODE at the interior collocation points and the boundary conditions at the end points.” ▪ “The simplest choice of collocation points is to use an equally-spaced mesh.” This choice is suitable if the basis functions are trigonometric functions. ▪ “If the basis function are polynomials, then the Chebyshev points will provide greater accuracy.”

Collocation Method

Heath (2002, p. 433)

slide-21
SLIDE 21

“Having chosen collocation points and smooth basis functions that we can differentiate analytically, we can now substitute the approximate solution and its derivatives into the ODE at each interior collocation points to obtain a set of algebraic equations while enforcing the boundary conditions yields two additional equations” “The system of n equations in n unknowns is then solved for the parameter vector c that determines the approximate solution function v.”

Collocation Method

Heath (2002, p. 433)

slide-22
SLIDE 22

Consider the two-point BVP with boundary conditions Let the collocation points are Using the first three monomials as the basis functions, the approximate solution has the form “The derivatives of this function are given by”

Example: Collocation Method

Heath (2002, p. 434)

slide-23
SLIDE 23

Requiring the ODE to be satisfied at the interior collocation point gives the equation

  • r

Requiring the left BC to be satisfied at gives Requiring the right BC to be satisfied at gives Solving this linear system yields The approximate solution is

Example: Collocation Method

Heath (2002, p. 431-432)

slide-24
SLIDE 24

For this problem, the true solution is The figure below shows the true solution (solid line) and the collocation solution (dashed line).

Example: Collocation Method

Heath (2002, p. 435)

slide-25
SLIDE 25

▪ “Satisfying the differential equation at a given point is not the same as agreeing with the exact solution to the differential equation at that point, since two functions can have the same slope at a point without having the same value there.” ▪ “Thus, we do not expect the approximate solution to be exact at the collocation points.” ▪ When the basis functions have global support (basis functions are nonzero over the entire domain), this yields a spectral method. ▪ When the basis functions have compact support, this yields a finite element method.

Collocation Method

Heath (2002, p. 435)

slide-26
SLIDE 26

▪ Collocation solutions satisfy differential equations at collocation points -- the residual is zero at these points. ▪ We can minimize the residual over the entire interval of integration. ▪ “Consider the scalar Poisson equation in one dimension with homogeneous boundary conditions” We also seek an approximate solution of the form

Weighted Residual Method

Heath (2002, p. 436)

slide-27
SLIDE 27

Substituting the approximate solution into the differential equation yields the residual “The weighted residual method forces the residual to be

  • rthogonal to each of a given set of weight functions wi,

which yields a linear system Ax = b whose solution given the vector of parameters c.”

Weighted Residual Method

Heath (2002, p. 437)

slide-28
SLIDE 28

The collocation method is a weighted residual method in which the weight functions are the Dirac delta functions That is

Collocation Method (revisited)

Heath (2002, p. 437)

slide-29
SLIDE 29

“The least squares method minimize the function by setting each component of its gradient to zero”

Least Squares Method

Heath (2002, p. 437)

slide-30
SLIDE 30

which is a symmetric system of linear algebraic equations Ax = b where “These integrals can be evaluated either analytically or by numerical integration.” The least squares method is a weighted residual method in which the weight functions are

Least Squares Method

Heath (2002, p. 437)

slide-31
SLIDE 31

In the Galerkin method, the weight functions are chosen to be the same as the basis functions, that is, “With this choice of weight functions, the orthogonality condition becomes

  • r

Using integration by parts yields

Galerkin Method

Heath (2002, p. 438)

slide-32
SLIDE 32

The orthogonality condition becomes Assuming the basis function satisfy the homogeneous boundary conditions , the orthogonality condition then becomes

Galerkin Method

Heath (2002, p. 438)

slide-33
SLIDE 33

which is a symmetric system of linear algebraic equations Ax = b where In structural analysis, A is called the stiffness matrix and b is called the load vector. “Like collocation, the Galerkin method can be used with basis function having global support (i.e., a spectral method) or local support (i.e., a finite element method).”

Galerkin Method

Heath (2002, p. 438)

slide-34
SLIDE 34

Consider the two-point BVP with boundary conditions Let use piecewise linear polynomials as basis functions with knots located at

Example: Galerkin Method

Heath (2002, p. 439)

slide-35
SLIDE 35

“We seek an approximate solution of the form” “From the boundary conditions, we must have” “To obtain the remaining parameter c2, we impose the Galerkin orthogonality condition on the interior basis function and obtain the equation” The approximate solution is

Example: Galerkin Method

Heath (2002, p. 439-440)

slide-36
SLIDE 36

Example: Galerkin Method

Heath (2002, p. 440)

This figure shows the true solution (solid line) and the piecewise linear Galerkin solution (dashed line).

slide-37
SLIDE 37

37

▪ Heath, M. T., 2002. Scientific Computing: An Introductory Survey, Second Edition, McGraw-Hill.

References