QUIZ-10-All Problems

QUIZ-10-All Problems - y = − y x 2 = f x y Euler method y...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: y ' = − y + x 2 = f ( x, y ) Euler method y ( 0) = 0 yi +1 = yi + f ( xi , yi )h h= i 0 1 2 3 4 5 6 7 8 9 10 This means y0=0, x0=0 x_i 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 y_i 0 0 0 0 0.01 0.03 0.05 0.08 0.12 0.17 0.24 0.1 f(x_i, y_i) 0 0.01 0.04 0.09 0.15 0.22 0.31 0.41 0.52 0.64 0.76 Predictor : Corrector : Final Value y(1) yi0+1 = yi + f ( xi , yi )h yi +1 = yi + f ( xi , yi ) + f ( 2 Corrector Predictor Huen's Method i 0 1 2 3 4 5 6 7 8 9 10 x_i 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 y_i 0 0 0 0.01 0.02 0.04 0.06 0.1 0.14 0.2 0.27 f(x_i, y_i) 0 0.01 0.04 0.08 0.14 0.21 0.3 0.39 0.5 0.61 0.73 y_i+1^0 f(x_i+1, y_i+1^0) 0 0 0.01 0.02 0.03 0.06 0.09 0.14 0.19 0.26 0.01 0.04 0.08 0.14 0.22 0.3 0.4 0.5 0.62 0.74 Final Value y(1) 2 1 yi +1 = yi + k1 + k 2 h 3 3 Runge Kutta i 0 1 2 3 4 x_i 0 0.1 0.2 0.3 0.4 y_i 0 0 0 0.01 0.02 k1= f(x_i, y_i) x_i+3/4*h y_i+3/4*k1*h 0 0.08 0 0.01 0.18 0 0.04 0.28 0.01 0.08 0.38 0.01 0.14 0.48 0.03 k2 0.01 0.03 0.07 0.13 0.2 ; k1 = f ( x i , yi ) ; k 5 6 7 8 9 10 0.5 0.6 0.7 0.8 0.9 1 0.04 0.06 0.1 0.14 0.2 0.27 0.21 0.3 0.39 0.5 0.61 0.73 0.58 0.68 0.78 0.88 0.98 1.08 Final Value y(1) 0.05 0.09 0.13 0.18 0.24 0.32 0.28 0.37 0.47 0.59 0.71 0.84 REAL ANSWER 0.26 This means y0=0, x0=0 These two cells are hard coded with x0 and y0 The rest contain the x_i+1=x_i+h and the Euler udate yi0+1 = yi + f ( xi , yi )h yi +1 = yi + h ; f ( xi , yi ) + f ( xi +1 , yi0+1 ) h 2 k1 = f ( x i , yi ) ; k 2 = f ( xi + 3 3 h, yi + k1h) 4 4 ...
View Full Document

This note was uploaded on 08/31/2011 for the course ENGR 3723 taught by Professor Staff during the Summer '11 term at Oklahoma State.

Ask a homework question - tutors are online