Algoritmlash va tadbiqiy dasturlash


Download 277.64 Kb.
bet4/6
Sana15.03.2023
Hajmi277.64 Kb.
#1268658
1   2   3   4   5   6
Bog'liq
Algoritmlash va tadbiqiy dasturlash ” fanidan

Yechish:
5.2-jadval

J

Ayirmalar

Di

y/D

0
1
2
3
4
5

0.213 -0.05 -0.12 -0.20 -0.25 -0.31
0.05 0.163 -0.07 -0.15 -0.20 -0.26
0.12 0.07 0.093 -0.08 -0.13 -0.19
0.20 0.15 0.08 0.013 -0.05 -0.11
0.25 0.20 0.13 0.005 -0.037 -0.06
0.31 0.26 0.19 0.11 0.06 -0.097

-0.000019803
0.0000044499
0.0000015437
0.0000001716
0.0000007215
0.0000098040

-2526.22545
22547.69770
-111158.41938
1488006.99301
428740.12474
-38392.79886









1787177.37176

Pn+1(0.263)=0.00000015065


f(0,263)  L6(0.263)=0,269238
f(0,263)  0.269238
Berilgan jadval asosida tuziladigan Lagranj interpolyatsiya ko‘phadi yordamidami bilan berilgan argument qiymatida funksiya qiymatini (5.5) formula asosida hisoblash dasturini beramiz:

4’------------ 5.1- Dastur ----------------------
5 REM SAVE”lagr21.bas”,a
10 DIM Y(20), X(20)
20 PRINT TAB(9); “BERILGAN JADVALGA ASOSAN LAGRANJ INTERPOLYaTSIYa”
22 PRINT TAB(19); “KO‘PHADINI HISOBLASH”
24 READ N ’ (x,y) lar soni
30 FOR I = 1 TO N: READ X(I): NEXT I
40 FOR I = 1 TO N: READ Y(I): NEXT I
50 GOSUB 210: PRINT “: X”;
60 FOR I = 1 TO N: PRINT “ :”; USING “##.#####”; X(I);
70 NEXT I: PRINT “ :”: GOSUB 210: PRINT “: Y”;
80 FOR I = 1 TO N: PRINT “ :”; USING “##.#####”; Y(I);
90 NEXT I: PRINT “ :”: GOSUB 210
100 READ N1 ’ berilgan X1 argumentlar soni
110 FOR K = 1 TO N1
120 READ X1
130 S = 0
140 FOR I = 1 TO N: P = 1: FOR J = 1 TO N
150 IF I = J THEN 170
160 P = P * (X1 – X(J)) / (X(I) – X(J))
170 NEXT J
172 S = S + P * Y(I)
174 NEXT I
180 PRINT : PRINT TAB(19); “Y(“; USING “#####.###”; X1;
190 PRINT “)=”; USING “#####.#####”; S: NEXT K
200 END
210 PRINT “-----“; : FOR I = 1 TO N: PRINT “---------“;
220 NEXT I: PRINT “-----“: RETURN
232 REM x va y larning soni va qiymatlari
234 DATA 6
236 DATA 0.05, 0.01, 0.17,0.25, 0.30,0.39
240 DATA 0.050042, 0.100335, 0.171657, 0.255342, 0.309336, 0.376403
250 REM x1 argumentlar soni va qiymatlari
252 DATA 2, 0.263, 0.261
260 END
RUN
BERILGAN JADVALGA ASOSAN LAGRANJ INTERPOLYaTSIYa
KU’XADINI HISOBLASH

X:

0.05000

0.10000

0.17000

0.25000

0.30000

0.30000

Y:

0.05004

0.10034

0.17166

0.25534

0.30934

0.37640

Y( 0.263)= 0.2694333
Y( 0.261)= 0.2672608
Har bir o‘quvchi o‘zi tuzgan ixtiyoriy jadval uchun Lagranj interpolyattsiyalash ko‘phadini xsoblash uchun INPUT muloqat operatori bilan tuzilgan quyidagi dasturdan foydalanishi mumkin:
5’------------ 5.2- Dastur ----------------------

Download 277.64 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling