Гіперболічна залежність
Текст програми CLS REM MNK DIM X(50), Y(50) INPUT "Vvedit kilkist doslidiv N "; N FOR I = 1 TO N PRINT "Vvedit "; I; "znachennia X,Y" INPUT X(I), Y(I) NEXT I PRINT "hiperbolichna" LET S1 = N: LET S2 = 0: LET S3 = 0 LET S4 = 0: LET S5 = 0 FOR I = 1 TO N LET S2 = S2 + (1 / X(I)): LET S3 = S3 + Y(I) LET S4 = S4 + (1 / X(I)) * (1 / X(I)) LET S5 = S5 + (1 / X(I)) * Y(I) NEXT I LET B = (S2 * S3 - S1 * S5) / (S2 * S2 - S1 * S4) LET A = (1 / S1) * (S3 - B * S2) PRINT "Y="; A; "+"; B; "/X" LET S = 0 FOR I = 1 TO N LET S = S + (Y(I) - (A + B / X(I))) ^ 2 NEXT I LET S = SQR(S / (N - 2)) PRINT "Seredne kvadratychne vidhylennia", USING "###.######"; S OPEN "hiperb.dat" FOR OUTPUT AS #1 PRINT #1, "hiperbolichna zalejnist" PRINT #1, "Y="; A; "+"; B; "/X" PRINT #1, "Seredne kvadratychne vidhylennia", USING "###.######"; S PRINT #1, "X", "Y", "Yr" FOR I = 1 TO N PRINT #1, X(I), Y(I), A + B / X(I) NEXT I CLOSE #1 END Результати exponentna zalejnist Y=83.17641 +-2.938014 /X Seredne kvadratychne vidhylennia 14.744231 X Y Yr 0,1 54,1 53,79628 10 60,1 82,88261 20 66,1 83,02951 30 71,2 83,07848 40 76,1 83,10297 50 80,8 83,11765 60 85,7 83,12745 70 90,6 83,13445 80 95,6 83,13969 90 99,8 83,14377 100 104,6 83,14703 Графік
|