P17_6 - t c = c + h; end e Itrap = (by - ay)*(trap(1) +...

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

View Full Document Right Arrow Icon
function P17_6 f analytic = ((8/3)*(1) - (4/3)*(1^3) + (1/2)*(1^4)) - ((8/3)*(-1) - (4/3)*((-1)^3) + (1/2)*((-1)^4)) ( ax = 0; a bx = 2; b ay = -1; a by = 1; b n = 2; n h = (by-ay)/n; h c = ay; c for r = 1:3 f trap(r) = (bx-ax)*(f(ax, c) + 2*f(h,c) + f(bx, c))/(2*n);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t c = c + h; end e Itrap = (by - ay)*(trap(1) + 2*trap(2) + trap(3))/(2*n) I c = ay; c for r = 1:3 simp(r) = (by - ay) function new = f(x,y) f new = x^2 - 2*y^2 + x*y^3;...
View Full Document

This note was uploaded on 09/21/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Ask a homework question - tutors are online