Sie sind auf Seite 1von 17

Shooting Method

Major: All Engineering Majors


Authors: Autar Kaw, Charlie Barker

http://numericalmethods.eng.usf.
edu

Transforming Numerical Methods Education for STEM


Undergraduates

01/19/15

http://numericalmethods.eng.usf.e
du

Shooting Method

http://numericalmethods.eng.usf
.edu

Shooting Method
The shooting method uses the methods used in solving initial value
problems. This is done by assuming initial values that would have
been given if the ordinary differential equation were a initial value
problem. The boundary value obtained is compared with the actual
boundary value. Using trial and error or some scientific approach,
one tries to get as close to the boundary value as possible.

http://numericalmethods.eng.usf.edu

Example
d 2u 1 du u

2 0,
2
dr
r dr r
u 5 0.0038731,
u 8 0.0030770

Let

du
w
dr

Where a = 5
and
b=8

Then

dw 1
u
w 2 0
dr r
r
4

http://numericalmethods.eng.usf.edu

Solution
Two first order differential equations are given as
du
w, u 5 0.0038371
dr
dw
w u
2 , w 5 not known
dr
r r

Let us assume
w 5

du
5 u 8 u 5 0.00026538
dr
85

To set up initial value problem


du
w f1 r , u , w , u 5 0.0038371
dr
dw
w u
2 f 2 r , u , w , w 5 0.00026538
dr
r r
5

http://numericalmethods.eng.usf.edu

Solution Cont
Using Eulers method,

ui 1 ui f1 ri , ui , wi h
wi 1 wi f 2 ri , ui , wi h
Let us consider 4 segments between the two boundaries,
r 5
and
then,
r 8

85
h
0.75
4

http://numericalmethods.eng.usf.edu

Solution Cont
For

i 0, r0 5, u0 0.0038371, w0 0.00026538

u1 u0 f1 r0 , u0 , w0 h

0.0038371 f1 5,0.0038371,0.00026538 0.75


0.0038371 0.00026538 0.75
0.0036741

w1 w0 f 2 r0 , u0 , w0 h

0.00026538 f 2 (5,0.0038371,0.00026538) 0.75


0.00026538 0.0038371
0.00026538

0.75
2
5
5

0.00010938

http://numericalmethods.eng.usf.edu

Solution Cont
For

i 1, r1 r0 h 5 0.75 5.75, u1 0.0036741, w1 0.00010940

u2 u1 f1 r1 , u1 , w1 h

0.0036741 f1 5.75,0.0036741,0.00010938 0.75


0.0036741 0.00010938 0.75
0.0035920

w2 w1 f 2 r1 , u1 , w1 h

0.00010938 f 2 5.75,0.0036741,0.00010938 0.75


0.00010938 0.00013015 0.75
0.000011769

http://numericalmethods.eng.usf.edu

Solution Cont
For i 2, r2 r1 h 5.75 0.75 6.5

u2 0.0035920, w2 0.000011785

u3 u2 f1 r2 , u2 , w2 h

0.0035920 f1 6.5,0.0035920,0.000011769 0.75


0.0035920 0.000011769 0.75
0.0035832

w3 w2 f 2 r2 , u2 , w2 h

0.000011769 f 2 6.5,0.0035920,0.000011769 0.75


0.000011769 0.000086829 0.75
0.000053352

http://numericalmethods.eng.usf.edu

Solution Cont
For

i 3, r3 r2 h 6.50 0.75 7.25 u3 0.0035832, w3 0.000053332

u4 u3 f1 r3 , u3 , w3 h

0.0035832 f1 7.25,0.0035832,0.000053352 0.75


0.0035832 0.000053352 0.75
0.0036232

w4 w3 f 2 r3 , u3 , w3 h

0.000011785 f 2 5.75,0.0035832,0.000053352 0.75


0.000053352 0.000060811 0.75
0.000098961

So at r r4 r3 h 7.25 0.75 8

u 8 u4 0.0036232

10

http://numericalmethods.eng.usf.edu

Solution Cont
du
dr

Let us assume a new value for 5


w 5 2

du
5 2 u 8 u 5 2 0.00026538 0.00053076
dr
85

Using h 0.75 and Eulers method, we get


u 8 u 4 0.0029665"

While the given value of this boundary condition is


u 8 u4 0.0030770

11

http://numericalmethods.eng.usf.edu

Solution Cont

Using linear interpolation on the obtained data for the two assumed valu
du
5
dr

we get

u 8 0.00030770

du
5 0.00053076 0.00026538 0.0030770 0.0036232 0.00026538
dr
0.0029645 0.0036232

0.00048611
Using h 0.75 and repeating the Eulers method with
w(5) 0.00048611

u 8 u4 0.0030769
12

http://numericalmethods.eng.usf.edu

Solution Cont
u4of
Using linear interpolation to refine the value
8 which gives you,
till one gets close to the actual valueu of
u1 u 5 0.0038731

u 5.75 u 2 0.0035085

u 6.50 u3 0.0032858
u 7.25 u4 0.0031518
u 8.00 u5 0.0030770
13

http://numericalmethods.eng.usf.edu

Comparisons of different
initial guesses

14

http://numericalmethods.eng.usf.edu

Comparison of Euler and


Runge-Kutta Results with
exact results

Table 1 Comparison of Euler and Runge-Kutta results with exact resul


r (in)

5
5.75
6.5
7.25
8

15

RungeKutta (in)

t %

Exact (in)

Euler (in)

3.873110

3.873110

3.873110

3.556710

3.508510

3.336610

3.285810

3.182910

3.151810

3.077010

3.077010

0.0000
1.3731
1.5482
9.896710
1

1.950010
3

3.555410
3

3.334110
3

3.179210
3

3.072310
3

t %
0.0000
3.582410
2

7.403710
2

1.161210
1

1.516810
1

http://numericalmethods.eng.usf.edu

Additional Resources
For all resources on this topic such as digital
audiovisual lectures, primers, textbook chapters,
multiple-choice tests, worksheets in MATLAB,
MATHEMATICA, MathCad and MAPLE, blogs,
related physical problems, please visit
http://numericalmethods.eng.usf.edu/topics/sho
oting_method.html

THE END
http://numericalmethods.eng.usf.edu

Das könnte Ihnen auch gefallen