Chekli ayirmalar usuli haqida tushunchalar
Download 332.37 Kb.
|
6.Maruza. Chegaraviy masalalarni chekli ayirmalar usuli yordamida yechish asoslari
DASTUR-1
8 REM SAVE"xx’ar2.bas",a 10 REM DASTUR-1 12 REM parabolik TENGLAMASI UCHUN 14 REM ARALASH MASALASINI YeCHISH 16 REM 20 DIM U(60,60),X(60),T(60) 22 DEF FNF(X)=SIN(3.141593*X) 30 DEF FNF1(T)=0 40 DEF FNF2(T)=0 50 READ A,B,T1,H 52 INPUT" X argument yuqori chegarasi S ni kiring="; s 54 INPUT” X argument kesmasidagi bo‘linish kadami H ni kirieing=”; h 56 INPUT” T argument yuqori chegarasi T1 ni kiring="; t1 60 K=H*H/2 : N=(B-A)/H : M=T1/K 70 FOR I=0 TO N : X(I)=I*H 80 NEXT I 90 FOR J=0 TO M : T(J)=J*K 100 U(0,J)=FNF1(T(J)) : U(N,J)=FNF2(T(J)) :NEXT J 110 FOR I=0 TO N 120 U(I,0)=FNF(X(I)) 130 NEXT I 140 FOR J=0 TO M : FOR I=1 TO N-1 150 U(I,J+1)=.5*(U(I-1,J)+U(I+1,J)) 160 NEXT I : NEXT J : GOSUB 220 : PRINT ": T/X "; 170 FOR I=0 TO N-5 : PRINT " :";USING "##.####";X(I);:NEXT I: PRINT " :" 180 GOSUB 220 190 FOR J=0 TO M : PRINT ": ";USING "##.###";T(J);: FOR I=0 TO N-5 200 PRINT " :";USING "##.####";U(I,J); 210 NEXT I : PRINT " :" : GOSUB 220 : NEXT J : GOTO 250 220 PRINT "-----------"; : FOR I=0 TO N-5 : PRINT "---------"; : NEXT I 230 PRINT : RETURN 240 DATA 1,1,0.025,.1 250 END RUN ---------------------------------------------------------------------------- : T/X : 0.0000 : 0.1000 : 0.2000 : 0.3000 : 0.4000 : 0.5000 : ---------------------------------------------------------------------------- : 0.000 : 0.0000 : 0.3090 : 0.5878 : 0.8090 : 0.9511 : 1.0000 : ----------------------------------------------------------------------------- : 0.005 : 0.0000 : 0.2939 : 0.5590 : 0.7694 : 0.9045 : 0.9511 : ----------------------------------------------------------------------------- : 0.010 : 0.0000 : 0.2795 : 0.5317 : 0.7318 : 0.8602 : 0.9045 : ----------------------------------------------------------------------------- : 0.015 : 0.0000 : 0.2658 : 0.5056 : 0.6959 : 0.8181 : 0.8602 : ----------------------------------------------------------------------------- : 0.020 : 0.0000 : 0.2528 : 0.4809 : 0.6619 : 0.7781 : 0.8181 : ----------------------------------------------------------------------------- : 0.025 : 0.0000 : 0.2404 : 0.4574 : 0.6295 : 0.7400 : 0.7781 : ----------------------------------------------------------------------------- Ok_ Download 332.37 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling