Title: Shooting Method
1Shooting Method
A slightly different way of solving the problem
Rewrite the solution as a linear combination of a
particular solution u to the nonhomogeneous
equation and a general solution v of the
homogeneous equation
The constant A can be found from the second
boundary condition
2Shooting Method
The second boundary condition requires
This solution satisfies the ODE and agrees with
both boundary conditions
3Second-Order ODE Example Problem
Consider a ball is hit so hard that it lands 300
m away after 3 sec
Lets assume that air resistance acts only on the
horizontal component of the flight and is
proportional to the horizontal velocity
The boundary conditions are x(0) 0
y(0) 1
x(3) 300 y(3) 0
and c 0.5 and dt 0.2
4Second-Order ODE Example Problem
1st Step Rewrite the two 2nd-order ODEs into
four 1st-order ODEs
5Second-Order ODE Example Problem
2nd Step Guess ux and uy and solve the
inhomogeneous equation
ux(0) 150 m/s uy (0) 16 m/s
x(3) 233 m y(3) 4.85 m
6Second-Order ODE Example Problem
3rd Step Solve the homogeneous equation
--gt set g 0
vx(0) 200 m/s vy (0) 18 m/s
x(3) 310 m y(3) 55 m
7Second-Order ODE Example Problem
Calculate A Trajectory u Av
8Second-Order ODE Example Problem
9Shooting Method
Second-order linear boundary value problem can
always be solved using two solutions with
different guesses for the initial slope!
Higher-order linear boundary value problem are
more difficult
Third-order linear boundary value problem Start
at the boundary where two of the three values are
specified
Fourth-order linear boundary value problem When
two conditions are specified at each boundary, we
need to combine four trial solutions
10Shooting Method for Nonlinear ODE-BVPs
Nonlinear ODE
Replace ODE with equivalent ODE but with
guessed initial slope t
Use the difference between u(b) and yb to adjust
u(a)
m(t) is function of the guessed value t
Use secant method or Newton method to find the
correct t value with m(t) 0 (in practice m(t)
tol)
11Secant Method
12Secant Method
13Nonlinear Shooting Based on Secant Method
Nonlinear ODE
Step 1 Use u(a) ya, u'(a) t(1) --gt
Error m(1)
Step 2 Use u(a) ya, u'(a) t(2) --gt
Error m(2)
Step 3 Use secant method to obtain a new estimate
Step 4 Iterate until Error tol
14Non-Linear Shooting Method
Convergence is aided by a good guess for the
unknown initial condition
When nonlinearity is weak it typically helps to
first determine a solution to the linearized
equation
We would find that the unknown initial condition
is y(-1) -6 for the linear equation.
Use this value as the start value for the
nonlinear iteration
15Non-Linear Shooting Method
y(-1) -6
Linear Nonlinear
it1
16Non-Linear Shooting Method
y(-1) -5.5
Linear Nonlinear
it2
17Non-Linear Shooting Method
y(-1) -5.13
Linear Nonlinear
it3
18Non-Linear Shooting Method
y(-1) -5.07
Linear Nonlinear
it4
19Non-Linear Shooting Method
y(-1) -5.06
Linear Nonlinear
it5
20Non-Linear Shooting Method
y(-1) -5.06
Linear Nonlinear
it10
21Non-Linear Shooting Method
y(-1) -5.06
Linear Nonlinear
it10
22Finite Difference Method
23Finite Difference Method
Lets look again at the linear 2nd-order ODE
Divide the interval of interest into subintervals
Replace the derivatives by appropriate
finite-difference approximations
24Finite Difference Method
Central difference approximations
Insert into ODE
25Finite Difference Method
We can use our Thomas Algorithm (from Spline
program)