chapter 17 boundary value problems. standard form of two-point boundary value problem in total,...
TRANSCRIPT
Chapter 17
Boundary Value Problems
Standard Form of Two-Point Boundary Value Problem
1 2
1 1 1 1 2 1
2 2 2 1 2 2
( )( , , , , ), 1, 2, ,
At point : ( , , , , ) 0, 1, 2, ,
At point : ( , , , , ) 0, 1,2, ,
ii N
j N
k N
dy xf x y y y i N
dxx B x y y y j n
x B x y y y k n
In total, there are n1+n2=N boundary conditions.
Example, Eigenvalue Problem
2
2
( )( )
with (0) 0, (1) 0
d y xy x
dxy y
1 2 3
1 2
2 3 1
3
1 1 3 3
Let , ',
y
0
(0) 0, (1) 0, (0) (1)
y y y y y
y
y y y
y
y y y y
is also unknown.
Shooting Method
Use Newton-Raphson to get the target
The Shooting Method (start)
• At the starting point x1 we have n1
conditions to satisfy, thus we have n2=N-n1 freely variable starting parameters
• Let
be the initial values of y which is parametrized by n2 V-values without constraint.
21 1 1 2( ) ( ; , , , ) 1, 2, ,i i ny x y x V V V i N
The Shooting Method (discrepancy)
• Using any standard ODE solver to find the solution at x2. Compute a difference between the required boundary condition and actual value:
• Our objective is to search the root of F with respect to V.
2 2 2 2( ) ( , ( )) 1, 2, ,k kF B x x k n V y
Newton-Raphson for Root2
2
1
1
1 1
0 ( ) ( ) ( )
or 0 where
Update by
Compute by finite diference
( , , , ) ( , , , )
ni
i i jj j
iij
j
i j j i ji
j j
FF F V O V
V
FJ
V
F V V V F V VF
V V
V V V
F J V
V V V V V J F
J
An Example2
1 2
1 2
1 1
2 1
1 2
1 2 1
2 1 1
3, (0) 4, (1) 1
2Let , , rewrite as
(0) 4, (1) 13
21, 2
So we let (0), (0) 4
( ) ( ) (1) 1
y y y y
y y y y
y yy y
y y
n n N
V V y y
F V B y y
Relaxation Methods
Work with finite differences
Difference Method
• Consider
• Discretize the interval xj=a+jh and equation
( ) ( ), ( ) , ( )y q x y g x y a y b
0
1 12
1
,
2( ) ( ), 1, 2, ,
i i ii i i
n
y
y y yq x y g x i n
hy
The difference equations form a linear system Ay = b if the equation is linear.
Reviews
• Errors in numerical calculations• Linear systems• Interpolations• Integrations of definite integrals and differential
equations• Random number and Monte Carlo• Least squares and optimizations• Root finding• Sorting, computational complexity• FFT
Topics not Covered
• Eigenvalue problems, Ax=x• Evaluation of special functions
• Integral equations
• Partial differential equations (PDE)
Review Problem 1Mix and Match
Problems
Solve Ax = b
Det(A)
Approximate f(x) by polynomial
Integrate
Fit a straight line
Find minima
Solve ODE or PDE
Estimate error of fit
Compute condition number
Traveling salesman
Nonlinear equation
Methods
Crout’s Newton-Raphson Relax
Gaussian quadrature Trapzoidal rule
Romberg method LU SVD FFT
Lagrange formula Neville’s shooting
Gauss-Jordan elimination Euler
Back/forward substitution Bulirsch-Stoer
Spines Steepest descent Symplectic
Conjugate gradient Secant Metropolis
Golden section Bisection Heapsort
Simulated annealing Bit-reversal
Wavelet Variance Normal equation
Levenberg-Marquardt Runge-Kutta
Review Problem 2
• Error in numerical calculation, catastrophic cancellation
• Discuss the pitfalls of solving the quadratic equation by the standard formula
2
2
1,2
0
4
2
ax bx c
b b acr
a
Read the IEEE 754 webpage article “What every computer scientist should know about floating-point arithmetic”.
Review Problem 3
• To interpolate or extrapolate with polynomials, we do Neville’s algorithm with Lagrange interpolation formula. Discuss what is required (computationally) if we consider rational functions (This is known as Padé approximation).
20 1 2
20 1 2
NND
D
a a x a x a x
b b x b x b x
Review Problem 4
• Work out the steps for Conjugate Gradient and Steepest Descent for minimum of the following function
1( )
2where
3 2 2,
2 6 8
T Tf x x Ax b x
A b
The minimum is at
(2,2).
Review Problem 5
• Discuss the general features (trajectories in phase space) of the ordinary differential equation of a pendulum. What method should be best used to solve it numerically?
2
2sin( ) 0
d
dt
Other Routine Problems
• Gauss elimination• Solve LU decomposition with Crout’s• Do interpolation with Neville’s• The errors in well-known integration rules• Do quick sort or heap sort on data• Newton Raphson iteration formula• Normal equation for least-square• Euler/midpoint methods for ODE
Conceptual Type of Problems
• Existence of solutions
• O(N?) of an algorithm, why fast or slow
• Accuracy of methods O(h?)
• Basic analysis techniques (e.g. Taylor series expansion)
• Key idea in an algorithm or a method (e.g., conjugate gradient, gaussian quadrature, Romberg, quick sort, FFT, etc)