body main banner  
torso

TPZD.8xp

Contributed by: Eric Anderson '07

Purpose: Estimates definite integrals using Trapezoidal Rule

Download TPZD.8xp

Source Code

:Pause "FUNCTION (ENTER IN QUOTES)"
:Input "Y1",Y1
:Disp "LOWER VALUE"
:Prompt A
:Disp "UPPER VALUE"
:Prompt B
:Disp "NO. TRAPEZOIDS"
:Prompt N
:((.5)((B-A)/N)(Y1(A)+Y1(B)+2sum(seq(Y1(C),C,((B-A)/N)+A,B-((B-A)/N),(B-A)/N)storeP
:Disp P
:Pause
:AstoreXmin
:BstoreXmax
:max(seq(Y1(K),K,A,B,.1))storeM
:(M+.05)storeYMax
:min(seq(Y1(Q),Q,A,B,.1))storeD
:(D-.05)storeYmin
:If D>0
:Then
:0storeYmin
:End
:If M<0
:Then
:0storeYMax
:End
:Pause "COPYRIGHT ERIC ANDERSON, 2005"
:DispG
:For(V,A+(B-A)/N,B-((B-A)/N),(B-A)/N
:Line(V,0,V,Y1(V))
:Line(V,Y1(V),V+((B-A)/N),Y1(V+(B-A)/N)
:Line(V,Y1(V),V-((B-A)/N),Y1(V-(B-A)/N

Generated by SourceCoder, 2005 Cemetech