Boundary-value problems

Download Report

Transcript Boundary-value problems

Boundary-Value Problems
• Boundary-value problems
are those where
conditions are not known
at a single point but rather
are given at different
values of the independent
variable.
• Boundary conditions may
include values for the
variable or values for
derivatives of the variable.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Initial Value Problem vs Boundary
Value Problem
• IVP: Know all the values of the variables when t  t0
• BVP: Know values of (some) variables at other
time values
• Eg Predator-Prey model:
dx
 ax  bxy
dt
dy
 cy  dxy, y (0)  1, y (10)  3
dt
• Eg Natural oscillation:
d 2x
dx
m 2  c  kx  0, x(0)  1, x(15)  0
dt
dt
Finite-Difference Methods
• A common method is a finite-difference
approach.
• In these techniques, finite differences are
substituted for the derivatives in the original
equation, transforming a linear differential
equation into a set of simultaneous algebraic
equations.
Example
d 2x
dx
• Convert m dt 2  c dt  kx  0, x(0)  1, x(15)  0
into n-1 simultaneous equations at each interior point
using centered difference equations:
dx xi 1  xi 1

dt
2t
d 2 x xi 1  2 xi  xi 1

2
dt
t 2
xi 1  2 xi  xi 1
xi 1  xi 1
m
c
 kxi  0
2
t
2t
(m  12 ct ) xi 1  (kt 2  2m) xi  (m  12 ct ) xi 1  0
Finite-Difference Example (cont)
• Since x0 and xn are known, they will be on
the right-hand-side of the linear algebra
system (in this case, in the first and last
entries, respectively):
kt 2  2m m  12 ct

2
1
m

c

t
k

t
 2m
2





m  12 ct

m  12 ct
  x1   (m  12 ct ) x0 


 
0
x

 2   

 



  




kt 2  2m  xn 1   (m  12 ct ) xn 
• Take m=20, k=20, c=5 and
t  0.1 .
Finite-Difference Method for
Nonlinear ODEs
• Root location methods for systems of
equations may be used to solve nonlinear
ODEs.
• Another method is to adapt a successive
substitution algorithm to calculate the values
of the interior points.
The Shooting Method
• One method for solving boundary-value
problems - the shooting method - is
based on converting the boundary-value
problem into an equivalent initial-value
problem.
• Generally, the equivalent system will not
have sufficient initial conditions and so a
guess is made for any undefined values.
• The guesses are changed until the final
solution satisfies all the boundary
conditions.
• Correct initial value(s):
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Boundary Conditions
• Dirichlet boundary conditions are those
where a fixed value of a variable is known at
a particular location.
• Neumann boundary conditions are those
where a derivative is known at a particular
location.
• Shooting methods can be used for either
kind of boundary condition.
Example 1
• Predator-Prey Model:
dx
 ax  bxy
dt
dy
 cy  dxy, y (0)  1, y (10)  3
dt
• Where x is the number of prey and y the
number of predators.
• Let a=1.2, b=0.6, c=0.8 and d=0.3.
• Solve for y(t), x(t).