sol_hw8 - CE 335 Solutions to Homework 8 2) (a) [x +...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CE 335 Solutions to Homework 8 2) (a) [x + e -2x /2] x = 0. .. 4 = 4 + (e -8 - 1)/2 = 3.5002 (b) 4 * ((1 - 1) + (1 - e -8 ))/2 = 1.9993 error: |1.9993 - 3.5002|/3.5002 = 42.88% (c) n = 2: 4 * ((1 - 1) + 2(1 - e -4 ) + (1 - e -8 ))/4 = 2.9630 error: 15.35% n = 4: 4 * ((1 - 1) + 2(1 - e -2 ) + 2(1 - e -4 ) + 2(1 - e -6 ) + (1 - e -8 ))/8 = 3.3437 error: 4.47% (d) 4 * ((1 - 1) + 4(1 - e -4 ) + (1 - e -8 ))/6 = 3.2843 error: 6.17% (e) 4 * ((1 - 1) + 4(1 - e -2 ) + 2(1 - e -4 ) + 4(1 - e -6 ) + (1 - e -8 ))/12 = 3.4706 error: 0.84% (f) 4 * ((1 - 1) + 3(1 - e -8/3 )+ 3(1 - e -16/3 ) + (1 - e -8 ))/8 = 3.3884 error: 3.19% 8) (a) t = [1 2 3.25 4.5 6 7 8 8.5 9.3 10]; v = [5 6 5.5 7 8.5 8 6 7 7 5]; trapz(t, v) >> 60.425 [estimated distance traveled from t = 1 to t = 10] (b) p = polyfit(t, v, 3); q = polyint(p) polyval(q, 10) - polyval(q, 1) >> 60.195 1) exact solution: [(4/3)x 3 + 12x - 9/x] x = 1. ..2 = 28/3 + 12 + 9/2 = 155/6 = 25.833 to do Romberg integration to the targeted accuracy, use a function like in Figure 18.2:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

sol_hw8 - CE 335 Solutions to Homework 8 2) (a) [x +...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online