{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Solution-HW6

# Solution-HW6 - HW#6 Solution 25.1 The analytical solution...

This preview shows pages 1–3. Sign up to view the full content.

HW#6 Solution 25.1 The analytical solution can be derived by separation of variables dy y x dx = 2 12 . ln . y x x C = + 3 3 12 Substituting the initial conditions yields C = 0. Taking the exponential give the final result y e x x = 3 3 1.2 The result can be plotted as 0 1 2 0 1 2 25.2 Euler’s method with h = 0.5 x y dy / dx 0 1 -1.2 0.5 0.4 -0.38 1 0.21 -0.042 1.5 0.189 0.19845 2 0.288225 0.80703 Euler’s method with h = 0.25 gives x y dy / dx 0 1 -1.2 0.25 0.7 -0.79625 0.5 0.500938 -0.47589 0.75 0.381965 -0.2435 1 0.321089 -0.06422 1.25 0.305035 0.110575 1.5 0.332679 0.349312 1.75 0.420007 0.782262 2 0.615572 1.723602

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The results can be plotted along with the analytical solution as 0 1 2 0 1 2 25.3 For Heun’s method, the value of the slope at x = 0 can be computed as 0.6 which can be used to compute the value of y at the end of the interval as y ( . ) ( . ( )) . . 05 1 0 12 1 05 0 4 = + = The slope at the end of the interval can be computed as y '( . ) . ( . ) . ( . ) . 05 0 4 05 12 0 4 0 38 2 = = − which can be averaged with the initial slope to predict y ( . ) . . . . 05 1 0 6 0 38 2 05 0 605 = + = This formula can then be iterated to yield j y i j ε a 0 0.4 1 0.605 33.9 2 0.5563124 8.75 3 0.5678757 2.036 4 0.5651295 0.4859 The remaining steps can be implemented with the result x i y i 0.5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}