Slope Fields and Euler’s Method 10/31/2011
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 -2 1 -2 -1 -1 1 -1 -1 0 2 0 0 0 -2 1 -1
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Warm up Suppose dy dx = y − x − 1. Sketch part of the slope field for the following points: dy x y dx -2 0 1 -2 1 2 -2 -1 0 -1 1 1 -1 -1 -1 0 2 1 0 0 -1 0 -2 -3 1 -1 -3
Euler’s Method Assume that you have an IVP that looks like dy dx = F ( x , y ) , y ( x 0 ) = y 0 Pick an increment of x -steps, called ∆ x .
Euler’s Method Assume that you have an IVP that looks like dy dx = F ( x , y ) , y ( x 0 ) = y 0 Pick an increment of x -steps, called ∆ x . Start at ( x 0 , y 0 ), and plot a segment with run ∆ x and slope F ( x 0 , y 0 ). The end is ( x 1 , y 1 ). From each ( x i , y i ), generate ( x i +1 , y i +1 ) by plotting a segment with run ∆ x and slope F ( x i , y i ).
Euler’s Method Assume that you have an IVP that looks like dy dx = F ( x , y ) , y ( x 0 ) = y 0 Pick an increment of x -steps, called ∆ x . Start at ( x 0 , y 0 ), and plot a segment with run ∆ x and slope F ( x 0 , y 0 ). The end is ( x 1 , y 1 ). From each ( x i , y i ), generate ( x i +1 , y i +1 ) by plotting a segment with run ∆ x and slope F ( x i , y i ). m=F(x 0 ,y 0 ) x i +1 = x i + ∆ x m* Δ x = y i + ∆ x ∗ F ( x i , y i ) y i +1 Δ x
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 1 2 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 2 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 -1 -1 2 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 -1 -1 -1 -1+1*(-1) 2 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 -1 -1 -1 -1+1*(-1) 2 0 -2 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 -1 -1 -1 -1+1*(-1) 2 0 -2 -3 -2+1*(-3) 3
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 i x i y i F ( x i , y i ) y i +1 0 -2 -1 0 -1+1*0 1 -1 -1 -1 -1+1*(-1) 2 0 -2 -3 -2+1*(-3) 3 1 -5 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 0 -2 -1 1 2 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 1 2 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 1 -1 2 2 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 2 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 2 -1 4 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 - 5 - 5 4 + 1 2 *(- 5 2 -1 4 ) 4 4 3 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 - 5 - 5 4 + 1 2 *(- 5 2 -1 4 ) 4 4 - 1 - 15 3 2 8 ∆ x = 1 , y 3 = − 5
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 - 5 - 5 4 + 1 2 *(- 5 2 -1 4 ) 4 4 - 1 - 15 - 19 - 15 8 + 1 2 *(- 19 3 8 ) 2 8 8 4 0 -3.0625 -4.0625 ∆ x = 1 , y 3 = − 5 1 5 -5.0938 -6.5938 2 6 1 -8.3906 = y 6
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 - 5 - 5 4 + 1 2 *(- 5 2 -1 4 ) 4 4 - 1 - 15 - 19 - 15 8 + 1 2 *(- 19 3 8 ) 2 8 8 4 0 -3.0625 -4.0625 ∆ x = 1 , y 3 = − 5 1 5 -5.0938 -6.5938 2 ∆ x = . 1 , y 30 = − 14 . 449 6 1 -8.3906 = y 6
Back to dy dx = y − x − 1 = F ( x , y ) , P 0 = ( − 2 , − 1). x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ ( y i − x i − 1) Example: ∆ x = 1 / 2 F ( x i , y i ) i x i y i y i +1 -1+ 1 0 -2 -1 0 2 *0 - 3 - 1 -1+ 1 2 *(- 1 1 -1 2 ) 2 2 - 5 - 5 - 5 4 + 1 2 *(- 5 2 -1 4 ) 4 4 - 1 - 15 - 19 - 15 8 + 1 2 *(- 19 3 8 ) 2 8 8 4 0 -3.0625 -4.0625 ∆ x = 1 , y 3 = − 5 1 5 -5.0938 -6.5938 2 ∆ x = . 1 , y 30 = − 14 . 449 6 1 -8.3906 = y 6 Actual solution: y = − e x +2 + x + 2, y (1) ≈ − 17 . 0855
Spreadsheet set up: in cell. . . A1 B1 C1 D1 A2 B2 C2 F2 put. . . i xi yi mi 0 ∆ x x 0 y 0 (In the last example, x 0 was -2 and y 0 was -1 and ∆ x was 1, 1 2 ,...) in cell. . . D2 B3 C3 put. . . = F ( B 2 , C 2) =B2+$F$2 =C2+$F$2*D2 x i +1 = x i + ∆ x y i +1 = y i + ∆ x ∗ m i (In the last example, F ( B 2 , C 2) was C2 − B2 − 1)
Another example dx = y 2 + 3 y If dy and y (0) = − 1, what is y (3)? x + 4
Another example dx = y 2 + 3 y If dy and y (0) = − 1, what is y (3)? x + 4 Can I just solve? Separate... � 1 � 1 y 2 + 3 y dy = x + 4 dx
Another example dx = y 2 + 3 y If dy and y (0) = − 1, what is y (3)? x + 4 Can I just solve? Separate... � 1 � 1 ??? = y 2 + 3 y dy = x + 4 dx = ln | x + 4 | + C
Another example dx = y 2 + 3 y If dy and y (0) = − 1, what is y (3)? x + 4 Can I just solve? Separate... � 1 � 1 ??? = y 2 + 3 y dy = x + 4 dx = ln | x + 4 | + C Estimate! Try ∆ x = 1
Another example dx = y 2 + 3 y If dy and y (0) = − 1, what is y (3)? x + 4 Can I just solve? Separate... � 1 � 1 ??? = y 2 + 3 y dy = x + 4 dx = ln | x + 4 | + C Estimate! Try ∆ x = 1 x 0 = 1, y 0 = − 1 m 0 = x 1 = y 1 = m 1 = x 2 = y 2 = m 2 = x 3 = y 3 =
Recommend
More recommend