Chekli ayirmalar usuli haqida tushunchalar


Download 332.37 Kb.
bet5/7
Sana13.04.2023
Hajmi332.37 Kb.
#1350624
1   2   3   4   5   6   7
Bog'liq
6.Maruza. Chegaraviy masalalarni chekli ayirmalar usuli yordamida yechish asoslari

{Paskal tili dasturi }
uses crt, dos;
label 1;
var
y,h,a,b,t1,c,d,g,w,e,s,k:real;
n,m,i,j:integer;
x,t:array[0..60] of real;
u:array[0..60,0..60] of real;
function fnf(x:real):real;
begin fnf:=sin(3.14159*x); end;
function fnf1(t:real):real;
begin fnf1:=0 end;
function fnf2(t:real):real;
begin fnf2:=0 end;
begin
a:=1; s:=1; t1:=0.025; h:=0.1; n:=5; m:=5;
write(‗X argument chegaralari a,b ni kiriting=‘); readln(a,b);
write(‗X argument kesmada bo‗linishlar qadami H ni kiriting=‘); readln(H);
write(‗T argument yuqori chegarasi T1 ni kiriting=‘); readln(T1);
k:=h*h/2;
write(' t/x':6);
for i:=0 to n do
begin
x[i]:=i*h; write(' ',x[i]:6:4);
end; writeln;
for j:=0 to 2*m do for i:=0 to 2*n do
begin
t[j]:=j*k; u[0,j]:=fnf1(t[j]); u[n,j]:=fnf2(t[j]);
x[i]:=i*h; u[i,0]:=fnf(x[i]);
end;
for j:=0 to 2*m do for i:=1 to 2*n do
begin
u[i,j+1]:=(u[i-1,j]+4*u[i,j]+u[i+1,j])/6
end;
for j:=0 to m do
begin t[j]:=j*k; write(t[j]:5:4);
for i:=0 to n do
begin
write(' ',u[i,j]:6:4);
end;
writeln;
end;
readln;
end.
Bir jinisli bo’lmagan parabolik tenglama uchun aralash masala.
To’r usuli bilan bir jinisli bo’lmagan parabolik turdagi

tenglama uchun aralash masalani yechish mumkin .
Bu holda tugunlarning oshkor holdagi sxemasida foydalangan holda ayirmalar tenglamasi quydagicha bo’ladi:

Bunda bo’lsa,

bo’ladi, bo’lsa,

bo’ladi. Bu holda xatolikni quydagicha baholash o’rinlidir. Yuqoridagi tenglama uchun :


Bu yerda

Misol. Ayirmalar tenglamasidan foydalanib,

tenglamaning
.
shartni qanoatlantiruvchi taqribiy yechimini topamiz.
Yechish : O’zgaruvchi argument x uchun h=0.1 qadam tanlaymiz. bo’lganligidan t argument uchun qadam l= /2=0.005 1-jadvalni boshlang’ich va chegaraviy qiymatlari bilan hamda simmetriklikni e’tiborga olib faqat x=0,0.1,0.2,0.3,0.4,0.5, lar uchun to’ldiramiz u(x,t) funksiya birinchi qatlamdagi qiymatlarni boshlang’ich va chegaraviy shartlardan foydalanib, j=0 , bo’lganda

formuladan foydalanamiz:

Bu holda

va hakazo ning i=2,3,4,5 larda ham qiymatlarini topib jadvalni to’ldiramiz.

asosan: ikkinchi qatlamda j=1 bo’lganda

formulaga

bo’ladi. Huddi shuningdek, ning qiymatlarini 0.010, 0.015, 0.020, 0.025 lar uchun ham hisoblaymiz. Jadvalning oxirida aniq yechim

va ayirma ning qiymatlarini t=0.005 uchun berilgan xatolikni takkoslash uchun

formuladan foydalanib quyidacha baholashni kuramiz. Berilgan masala uchun


bu yerda

9 ‘---------------DASTUR ----------------------
10 ‘-- parabolik turdagi bir jinsli bulmagan xususiy hosilali tenglama ----
12 ‘------------uchun chegaraviy masalaning yechimini topish---------
14 REM SAVE"‘arf0.bas",a
20 DIM U(60,60),X(60),T(60)
30 DEF FNF0(X,T)=3*T*SIN(X)
40 DEF FNF(X)=SIN(3.14*X)
50 DEF FNF1(T)=0
60 DEF FNF2(T)=0
70 READ A,B,T1,H
72 INPUT" X argument yuqori chegarasi S ni kiring="; s
74 INPUT” X argument kesmasidagi bo‘linish kadami H ni kirieing=”; h
76 INPUT” T argument yuqori chegarasi T1 ni kiring="; t1
80 K=H*H/2 : N=B/H : M=T1/K
90 FOR I=0 TO N : X(I)=I*H
100 FOR J=0 TO M : T(J)=J*K : F0(I,J)=FNF0(X(I),T(J))
110 U(1,J)=FNF1(T(J)) : U(N,J)=FNF2(T(J)) :NEXT J :NEXT I
120 FOR I=0 TO N
130 U(I,0)=FNF(X(I))
140 NEXT I
150 FOR J=0 TO M : FOR I=1 TO N
160 U(I,J+1)=(U(I-1,J)+U(I+1,J))/2+K*F0(I,J)
170 NEXT I : NEXT J : GOSUB 230 : PRINT ": T/X ";
180 FOR I=0 TO N-5 : PRINT " :";USING "##.####";X(I);:NEXT I: PRINT " :"
190 GOSUB 230
200 FOR J=0 TO M : PRINT ": ";USING "##.####";T(J);: FOR I=0 TO N-5
210 PRINT " :";USING "##.####";U(I,J);
220 NEXT I : PRINT " :" : GOSUB 230 : NEXT J : GOTO 260
230 PRINT "-----------"; : FOR I=0 TO N-5 : PRINT "---------"; : NEXT I
240 PRINT : RETURN
250 DATA 1,1,0.025,.1
260 END
RUN
----------------------------------------------------------------------------
: T/X : 0.0000 : 0.1000 : 0.2000 : 0.3000 : 0.4000 : 0.5000 :
-----------------------------------------------------------------------------
: 0.0000 : 0.0000 : 0.3089 : 0.5875 : 0.8087 : 0.9509 : 1.0000 :
-----------------------------------------------------------------------------
: 0.0050 : 0.0000 : 0.2938 : 0.5588 : 0.7692 : 0.9044 : 0.9511 :
-----------------------------------------------------------------------------
: 0.0100 : 0.0000 : 0.2794 : 0.5315 : 0.7316 : 0.8602 : 0.9046 :
-----------------------------------------------------------------------------
: 0.0150 : 0.0000 : 0.2658 : 0.5055 : 0.6959 : 0.8182 : 0.8605 :
-----------------------------------------------------------------------------
: 0.0200 : 0.0000 : 0.2528 : 0.4809 : 0.6619 : 0.7783 : 0.8185 :
-----------------------------------------------------------------------------
: 0.0250 : 0.0000 : 0.2405 : 0.4574 : 0.6297 : 0.7403 : 0.7787 :
-----------------------------------------------------------------------------
Ok
Quyida issiqlik oʻtkazuvchanlikning chiziqli masalalarini qaraymiz.

Download 332.37 Kb.

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




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