Post Reply 
(71B) Integral Using Simpson’s Rule
06-27-2016, 03:28 AM
Post: #1
(71B) Integral Using Simpson’s Rule
Line 10 is where you have to define your function (of X).
Code:

Program SIMPSON  (200+ bytes)

10 DEF FNF(X)=insert function of X here
30 INPUT “LOWER:”;A
32 INPUT “UPPER:”;B
34 INPUT “# PART’NS (EVEN):”;N
36 RADIANS
38 T=FNF(A)+FNF(B)
40 H=(B-A)/N
50 FOR I=1 TO N-1
52 IF FP(I/2)=0 THEN 54 ELSE 56
54 T=2*FNF(A+I*H)+T @ GOTO 58
56 T=4*FNF(A+I*H)+T
58 NEXT I
60 T=T*H/3
62 DISP “INTEGRAL:”;T
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)