BOUNDARY VALUE PROBLEMS School of Mathematics Semester 1 2008
OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
INTIAL VALUE PROBLEMS FOR ODES So far we have have encountered initial value problems We can start at one end and march to the other We have seen different methods of differing order We will select a method based upon: Accuracy the order of errors in the method Expense how time consuming a method is Stability yet to talk about this!!
INTIAL VALUE PROBLEMS FOR ODES So far we have have encountered initial value problems We can start at one end and march to the other We have seen different methods of differing order We will select a method based upon: Accuracy the order of errors in the method Expense how time consuming a method is Stability yet to talk about this!!
OUTLINE Review 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
BOUNDARY CONTITIONS All ODEs and PDEs require boundary conditions in order that a solution may exist In initial value problems, the boundary conditions are all on one side This is not always the case, for instance take the following problem: d 2 y dx 2 + κdy dx + xy = 0 with the boundary conditions y(0) = 0 and y(1) = 1. then we have conditions at both ends!
BOUNDARY CONTITIONS All ODEs and PDEs require boundary conditions in order that a solution may exist In initial value problems, the boundary conditions are all on one side This is not always the case, for instance take the following problem: d 2 y dx 2 + κdy dx + xy = 0 with the boundary conditions y(0) = 0 and y(1) = 1. then we have conditions at both ends!
BOUNDARY CONTITIONS All ODEs and PDEs require boundary conditions in order that a solution may exist In initial value problems, the boundary conditions are all on one side This is not always the case, for instance take the following problem: d 2 y dx 2 + κdy dx + xy = 0 with the boundary conditions y(0) = 0 and y(1) = 1. then we have conditions at both ends!
REDUCE THE PROBLEM TO AN ODE We can rewrite the problem above as a system of first order ODEs: Y 1 = y(x); Y 2 = dy dx ; dy 1 dx = Y 2; dy 2 dx = κy 2 xy 1. and the boundary conditions are: Y 1 (x = 0) = 0 and Y 1 (x = 1) = 0.
WHAT NEXT? Review In order to solve the problem by marching through x we need to assign a value to Y 2 (x = 0) How to choose a value of Y 2 our choice must satisfy the boundary condition y 1 (x) 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 x
WHAT NEXT? Review In order to solve the problem by marching through x we need to assign a value to Y 2 (x = 0) How to choose a value of Y 2 our choice must satisfy the boundary condition y 1 (x) 2 1.8 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 x
OUTLINE Review 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
TAKING A GUESS Review Start by making a guess, g, to Y 2 (0) so that Y(0) = ( Y1 (0) Y 2 (0) ) = ( 0. g Next, solve using your favourite method, to get Y(1) = ( Y1 (1) Y 2 (1) ) = ( β1 then by comparing the value β 1 to our boundary condition, we can see how good the guess was β 2 ) )
UP A BIT... DOWN A BIT... In order to make our guess better, we want to know whether we have shot above or below Let us look at the value φ(g) = Y 1 (1; g) 1, then the guess is right when φ = 0. This now looks like a root finding problem which leads us to
UP A BIT... DOWN A BIT... In order to make our guess better, we want to know whether we have shot above or below Let us look at the value φ(g) = Y 1 (1; g) 1, then the guess is right when φ = 0. This now looks like a root finding problem which leads us to
OUTLINE Review 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
CORRECTING THE GUESS Suppose we have taken a guess ĝ, then seek a correction dg such that φ(ĝ + dg) = 0 Then take a Taylor expansion around φ(ĝ) to obtain φ(ĝ + dg) = φ(ĝ) + dg dφ dg (ĝ) + O(dg2 ) So equating this to zero and rearranging we find our correction is dg = φ(ĝ) φ (ĝ)
REMINDER... Review Newton s root finding algorithm has quadratic convergence The formula is: x n+1 = x n f(x)/f (x) f(x) 0.8 0.6 0.4 0.2 0-0.2-0.4-0.6 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x Start with a guess x 0 = 0.8 In order to generate the green line, we need the gradient of f at x 0 = 0.8 The new guess is x 1 = 0.55625
REMINDER... Review Newton s root finding algorithm has quadratic convergence The formula is: x n+1 = x n f(x)/f (x) f(x) 0.8 0.6 0.4 0.2 0-0.2-0.4-0.6 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x Start with a guess x 0 = 0.8 In order to generate the green line, we need the gradient of f at x 0 = 0.8 The new guess is x 1 = 0.55625
OUTLINE Review 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
SECANT METHOD Review Our formula to generate new guesses is: How do we find φ (g n )? We could estimate it by to give the Secant Method g n+1 = g n φ(g n) φ (g n ) φ (g n ) = φ(g n) φ(g n 1 ) g n g n 1 g n+1 = g n φ(g n)(g n g n 1 ) φ(g n ) φ(g n 1 )
SECANT METHOD Review Our formula to generate new guesses is: How do we find φ (g n )? We could estimate it by to give the Secant Method g n+1 = g n φ(g n) φ (g n ) φ (g n ) = φ(g n) φ(g n 1 ) g n g n 1 g n+1 = g n φ(g n)(g n g n 1 ) φ(g n ) φ(g n 1 )
OUTLINE Review 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY
INITIAL VALUE PROBLEM FOR g Consider again dy 1 dx =Y 2 dy 2 dx = κy 2 xy 1 with Y(0) = (0, g) T Then we can write φ (g n ) = Y 1 g (1; g n) This suggests we should differentiate the original equations with respect to g
INITIAL VALUE PROBLEM FOR g Consider again dy 1 dx =Y 2 dy 2 dx = κy 2 xy 1 with Y(0) = (0, g) T Then we can write φ (g n ) = Y 1 g (1; g n) This suggests we should differentiate the original equations with respect to g
INITIAL VALUE PROBLEM FOR g Then the initial value problem for φ is given by { } ( d Y = dx g ( Y 0 g = x=0 1 κ Y 2 Y 2 g g x Y 1 g ). ), Then we may recover φ since φ (g n ) = Y 1 g (1; g n) and use newton s formula to generate new guesses
INITIAL VALUE PROBLEM FOR g Then the initial value problem for φ is given by { } ( d Y = dx g ( Y 0 g = x=0 1 κ Y 2 Y 2 g g x Y 1 g ). ), Then we may recover φ since φ (g n ) = Y 1 g (1; g n) and use newton s formula to generate new guesses
THE NEWTON-AUGMENTED SYSTEM Simultaneously solve for Y and φ, setting Y 1 = y, Y 2 = y, Y 3 = y/ g and Y 4 = y / g Resulting system looks something like dy dx = Y 2 κy 2 xy 1 Y 4 κy 4 xy 3, Y(x = 0) = 0 g 0 1.
SUMMARY Boundary value problems are commonplace in CFD and mathematics in general Newton s Shooting method is one of the most common methods for solving these types of problem Newton s method is quadratic, so should converge in 5-15 iterations Start worrying if it doesn t!
SUMMARY Boundary value problems are commonplace in CFD and mathematics in general Newton s Shooting method is one of the most common methods for solving these types of problem Newton s method is quadratic, so should converge in 5-15 iterations Start worrying if it doesn t!