{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw2-1 - Homework#2 Section 1.4 t 1 y = y(0 = 1 y(a h = 0.1...

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

Homework #2 Section 1.4 1. y 0 = t y , y (0) = 1 (a) h = 0 . 1 n t n = t n - 1 + h y n = y n - 1 + hf ( t n - 1 , y n - 1 ) f ( t n , y n ) 0 0 1 0 1 0.1 1 0.1 2 0.2 1.01 0.1980 3 0.3 1.0298 * The approximations at t = 0 . 1, t = 0 . 2,and t = 0 . 3 are y 1 (0 . 1) 1, y 2 (0 . 2) 1 . 01, and y 3 (0 . 3) 1 . 0298. (b) h = 0 . 05 n t n = t n - 1 + h y n = y n - 1 + hf ( t n - 1 , y n - 1 ) f ( t n , y n ) 0 0 1 0 1 0.05 1 0.05 2 0.1 1.0025 0.0998 3 0.15 1.0075 0.1489 4 0.2 1.0149 0.1971 5 0.25 1.0248 0.2440 6 0.3 1.03698 * The approximations at t = 0 . 1, t = 0 . 2,and t = 0 . 3 are y 2 (0 . 1) 1 . 0025, y 4 (0 . 2) 1 . 0149, and y 6 (0 . 3) 1 . 03698. (c) The analytic solution is determined by separation of variables. dy dt = t y Z ydy = Z tdt 1 2 y 2 = 1 2 t 2 + c y 2 = t 2 + 2 c y = ± t 2 + 2 c Using the initial condition, y (0) = 1 1 = ± 2 c c = 1 2 1

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

View Full Document
Thus, y = t 2 + 1 and to four decimal place accuracy, y (0 . 2) = 1 . 0198. The errors in Euler’s ap- proximation are h = 0 . 1 error = y (0 . 2) - y 2 (0 . 2) = 1 . 0198 - 1 . 01 = 0 . 0098 h = 0 . 05 error = y (0 . 2) - y 4 (0 . 2) = 1 . 0198 - 1 . 0149 = 0 . 0050 . The smaller stepsize gives smaller error. 3. y 0 = 3 t 2 - y , y (0) = 1, [0 , 1] h = 0 . 1 t n y n t n y n 0 1 0.6 0.6822 0.1 0.9 0.7 0.7220 0.2 0.813 0.8 0.7968 0.3 0.7437 0.9 0.9091 0.4 0.6963 1 1.0612 0.5 0.6747 h = 0 . 2 t n y n 0 1 0.2 0.8 0.4 0.664 0.6 0.6272 0.8 0.71776 1 0.95821 The differential equation is not separable, so we have no exact solution for comparison. 8. y 0 = - t y , y (0) = 1 h = 0 . 1 t n y n t n y n 0 1 0.6 0.8405 0.1 1 0.7 0.7691 0.2 0.99 0.8 0.6781 0.3 0.9698 0.9 0.5601 0.4 0.9389 1 0.3994 0.5 0.8963 The analytical solution is similar to problem 1, and is given by y ( t ) = 1 - t 2 . 2
At t = 1, y (1) = 0, so we see that the absolute error at t = 1 is 0.3994. 14. y 0 = y 1 / 3 , y (0) = 0 (a) The solution starting at the initial point y (0) = 0 returns all zero values for y n . (b) y (0) = 0 . 01 h = 0 . 1 A few values are given in the following table.

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

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

{[ snackBarMessage ]}

Page1 / 9

hw2-1 - Homework#2 Section 1.4 t 1 y = y(0 = 1 y(a h = 0.1...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online