|
DataMuseum.dkPresents historical artifacts from the history of: MIKADOS |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about MIKADOS Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2528 (0x9e0) Notes: Mikados TextFile, Mikados_K Names: »SIMPSON«
└─⟦92e6f589c⟧ Bits:30003895/4xCOMAL3b.imd 4 * COMAL - SPC/1 - Disketter til bogen └─⟦this⟧ »SIMPSON« └─⟦faca42ef2⟧ Bits:30003895/4xCOMAL1.imd 4 * COMAL - SPC/1 - Disketter til bogen └─⟦this⟧ »SIMPSON«
0010 // -------------------------- simpson ----------------------------- 0020 // Simpsontilnærmelse til et interval ved fortsat intervalhalvering, 0030 // Integranden skal angives i linie 50 0040 PROC FNF(X) 0050 FNF:=EXP(X) 0060 ENDPROC FNF 0070 // 0080 CLEAR 0090 INPUT "Indtast venstre og højre intervalpunkt: ":A,B 0100 INPUT "Indtast antal intervalhalveringer: ":ANTALHALVERING 0110 PRINT 0120 PRINT "Højre intervalendepunkt: ";A 0130 PRINT 0140 PRINT "Venstre intervalendepunkt: ";B 0150 PRINT 0160 PRINT "Der benyttes ";ANTALHALVERING;" intervalhalveringer." 0170 PRINT 0180 PRINT 0190 PRINT "Intervalantal Simpsontilnærmelse" 0200 PRINT 0210 FOR J:=0 TO ANTALHALVERING DO 0220 SUM1:=0;SUM2:=0 0230 H:=(B-A)/2**J 0240 FOR I:=1 TO 2**J-1 DO 0250 SUM1:=SUM1+FNF(A+H*I) 0260 NEXT I 0270 FOR I:=1 TO 2**J DO 0280 SUM2:=SUM2+FNF(A+(2*I-1)*H/2) 0290 NEXT I 0295 SUM:=FNF(A) 0300 SUM:=(SUM+FNF(B)+4*SUM2+2*SUM1)*H/6 0310 PRINT USING " ##### ###########.#######":2**J,SUM 0320 NEXT J