hw8solns

hw8solns - 151A HW 8 Solutions Will Feldman 1(a Calculus(b...

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

View Full Document Right Arrow Icon
151A HW 8 Solutions Will Feldman 1. (a) Calculus. (b) e in both cases by calculus. (c) For composite trapezoid rule the error bound is (for h = 1 /N the grid length) ± ± ± ± ± Z 1 0 f ( x ) dx - h 2 ( f (0) + N - 1 X k =1 2 f ( kh ) + f (1)) ± ± ± ± ± h 2 max ξ [0 , 1] | f 00 ( ξ ) | 12 . So in order to be sure that the error for composite trapezoid for f ( x ) = e x is less than 10 - 8 we should choose N - 2 e/ 12 < 10 - 8 i.e. N ( e · 10 8 12 ) 1 / 2 4760. Meanwhile for Simpson’s rule the error bound looks like ± ± ± ± Z 1 0 e x dx - I S N ( e x ) ± ± ± ± h 4 180 max ξ [0 , 1] | f (4) ( ξ ) | so we solve for N - 4 e/ 180 < 10 - 8 i.e. N 36. (d) Straightforward Matlab computations. 2. Similar to the Matlab computations from last assignment. If a method is of order α then we expect that as 1 /N = h 0 we have E ( N ) C (1 /N ) α or log E ( N ) = - α log N + ˜ C . That is, the dependence of the error E ( N ) on the number of grid panels N is log linear and the slope of the line is - α . Below code is a Matlab function which implements Trapezoid rule: function out = trapezoid(f,a,b,n)
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.

This note was uploaded on 01/30/2012 for the course MATH 131a taught by Professor Hitrik during the Spring '08 term at UCLA.

Page1 / 3

hw8solns - 151A HW 8 Solutions Will Feldman 1(a Calculus(b...

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