This preview shows page 1. Sign up to view the full content.
Unformatted text preview: errorsimp=(abs(Isimp-Itrue)/Itrue*100.) print "Integral by trapeziod with %i panels = %3.7f" % (numPanels,Itrap) print "Error for Trap is %3.4f percent" % errortrap print "Integral by Simpson 1/3 with %i panels = %3.7f" % (numPanels,Isimp) print "Error for Simp is %3.4f percent" % errorsimp print "True value = ", Itrue x=linspace(0,1,50) fill_between(x,exp(-x),y2=0,color='yellow') plot(x,exp(-x),'b-',lw=2) xlim(-0.2,1.2) xlabel('$x$',fontsize=18) ylabel('$f(x)$',fontsize=18)...
View Full Document
This note was uploaded on 10/05/2010 for the course PHYS phy503 taught by Professor Gladden during the Spring '09 term at Ole Miss.
- Spring '09