Progonkaning to‘g‘ri yo‘li.
Barcha
1
...
2
,
1
,
2
1
,
2
1
,
N
k
v
b
v
m
k
v
m
k
54
koeffitsiyentlarni hisoblaymiz:
0
,
0
2
1
,
0
2
1
,
0
v
m
v
m
v
b
,
2
/
1
,
1
2
/
1
,
m
k
k
k
k
m
k
b
A
C
B
b
2
/
1
,
1
2
/
1
,
2
/
1
,
1
2
/
1
,
m
k
k
k
m
k
m
k
k
m
k
b
A
C
F
A
1
...
2
,
1
,
2
1
,
2
1
,
N
k
v
b
v
m
k
v
m
k
koeffitsiyentlarni hisoblab
bo‘lganimizdan so‘ng
1 2
,
v
N m
y
larni hisoblaymiz:
1 2
1 2
1 2
,
,
1,
1 2
,
1 2
1 2
,
1,
1
v
v
v
N m
N m
N
m
v
N m
v
v
N m
N
m
v
b
v
y
b
b
Bizga ma’lumki,
0
,
0
2
1
,
2
1
,
v
m
N
v
m
N
v
b
, u holda
1 2
,
0
v
N m
y
.
Progonkaning teskari yo‘li.
Barcha
1 2
1 2
1 2
,
,
,
,
,
0,
1, 2...
1
v
v
v
k m
k m
N m
b
v
y
k
N
lar topilgandan so‘ng barcha
1 2
,
,
1...1
v
k m
y
k
N
noma’lum-
larni quyidagi formuladan topamiz:
1 2
1 2
1 2
1 2
,
,
1,
,
,
1, 2,...,
1.
v
v
v
v
k m
k m
k
m
k m
y
b
y
v
k
N
Xuddi shinday
1 2
1 2
1 2
,
0,
,
,
1, 2,...
1;
0,
0
v
v
v
k m
m
N m
y
k
N
y
y
lar berilgan chegaraviy shartlardan hisoblanadi.
x
2
o‘q bo‘yicha progonka.
Har bir fiksirlangan
1
...
2
,
1
N
k
uchun (4.5) tenglamalar sistemasini yechamiz:
v
m
k
v
m
k
m
k
v
m
k
m
k
m
k
v
m
k
m
k
F
y
h
a
y
h
a
h
a
y
h
a
,
1
,
2
2
1
,
,
2
2
,
2
2
1
,
1
,
2
2
,
2
2
2
1
2
,
bu yerda
2
/
1
,
2
/
1
,
,
,
2
/
1
,
1
,
)
(
2
m
k
m
k
m
k
m
k
m
k
m
k
y
y
q
f
y
F
avvalgi
qadamlardagi hisoblashlardan ma’lum.
Quyidagi belgilashlarni kiritamiz:
55
1
,...
2
,
1
,
2
,
2
2
1
,
2
2
2
1
,
2
2
,
2
2
1
,
2
2
,
N
m
h
a
B
h
a
h
a
C
h
a
A
m
k
m
m
k
m
k
m
m
k
m
(4.5) tenglamalar sistemasini quyidagicha yozamiz:
m
k
m
k
m
m
k
m
m
k
m
F
y
B
y
C
y
A
,
1
,
,
1
,
(5.2)
Progonka har bir fiksirlangan
1
,...
2
,
1
N
k
uchun
amalga oshiriladi.
Progonkaning to‘g‘ri yo‘li.
Barcha
1
...
2
,
1
,
,
,
,
N
m
v
b
v
m
k
v
m
k
koeffitsiyentlarni hisoblaymiz:
,
1
,
,
m
k
m
m
m
m
k
b
A
C
B
b
1
,
,
1
,
,
m
k
m
m
m
k
m
k
m
m
k
b
A
C
F
A
.
1
...
2
,
1
,
,
,
,
N
m
v
b
v
m
k
v
m
k
koeffitsiyentlarni
hisoblab
bo‘lganimizdan so‘ng
,
v
k N
y
larni hisoblaymiz:
,
,
,
1
,
,
,
1
1
v
v
v
k N
k N
k N
v
k N
v
v
k N
k N
v
b
v
y
b
b
Ma’lumki
0
,
0
,
,
v
N
k
v
N
k
v
b
, u holda
,
0
v
k N
y
.
Progonkaning teskari yo‘li.
Barcha
1
,
,
,
,
,
0,
1, 2...
1
v
v
k m
k m
k N
b
v
y
m
N
lar topilgandan so‘ng barcha
,
,
1...1
v
k m
y
m
N
noma’lum-
larni quyidagi formuladan topamiz:
,
,
,
1
,
,
1, 2,...,
1
v
v
v
v
k m
k m
k m
k m
y
b
y
v
m
N
Xuddi shinday
0
,
0
;
1
,...
2
,
1
,
,
0
,
,
v
N
k
v
k
v
m
k
b
b
N
m
b
lar berilgan boshlang‘ich shartlardan hisoblanadi.
6. HISOB NATIJALARI VA ULARNING TAHLILI
56
Kurs ishini bajarish jara-
yonida Dirixle masalasini o‘zga-
ruvchan yo‘nalishlar usuli bilan
yechishni amalga oshiruvchi C++
tildagi dasturi tuzildi. Hisob
dasturi
vaqtning
uchinchi
qadamida to‘xtadi, ya’ni yetar-
licha aniqlikdagi yechimga er-
ishildi (2-rasm).
2-rasm
FOYDALANILGAN ADABIYOTLAR RO‘YXATI
1.
Годунов С.К., Рябенкий В.С. Разностные схемы. – М.:
Наука, 1977. – 440 c.
2.
Демидович Б.П., Марон И.А. Основы вычислителной
математики. – М.: Наука, 1970. – 664 с.
3.
Самарский А.А. Теория разностных схем. – М.: Наука,
1989. – 616 с.
4.
Самарский А.А., Гулин А.В. Численные методы. – М.:
Наука, 1989. – 432 с.
5.
Самарский А.А., Николаев Е.С. Методы решения се-
точных уравнений. – М.: Наука, 1978. – 600 с.
ILOVA (Dastur matni)
#include
#include
#include
#include
#define N 10
#define x0 0
#define xEnd 1
#define h 0.1
double mx (int n)
{
return (double)(n*h);
}
57
double ma (int n)
{
return (2.+mx(n)-h/2.)/2.;
}
double mf (int k,int m)
{
double res;
res=(mx(m)-1.)*(-3.*mx(m)/2.-2.*mx(k)*mx(m))+(mx(k)-1.)*(-
3.*mx(k)/2.-2.*mx(k)*mx(m))-(1.+mx(k))*(mx(m)-
mx(m)*mx(m))*(mx(k)-mx(k)*mx(k));
return res;
}
double mq (int k)
{
return 1.+mx(k);
}
double Lamda (int k,int m,int nu,int k1,int k2,int m1,int m2,int
n,double y[][N+1][N+1])
{
double res;
res=(ma(n+1.)*(y[nu][k+k1][m+m1]-y[nu][k][m])-
ma(n)*(y[nu][k][m]-y[nu][k+k2][m+m2]))/h/h;
return res;
}
double bA(double t,int n)
{
return ma(n)*t/2./h/h;
}
double bB(double t, int n)
{
return ma(n+1.)*t/2./h/h;
}
double bC(double t,int n)
{
return (1.+bB(t,n)+bA(t,n));
}
double mb(int k,int m, int n, int nu, int k1, int m1, double t,
double b[][N+1][N+1])
{
double res;
58
res=bB(t,n)/(bC(t,n)-bA(t,n)*b[nu][k+k1][m+m1]);
return res;
}
double bF(int k,int m, int nu, int k1, int k2, int m1, int m2, int n,
double y[][N+1][N+1],double t)
{
double res;
res=t*(Lamda(k,m,nu-
1,k1,k2,m1,m2,n,y)+mf(k,m)+mq(k)*y[nu-1][k][m])/2+y[nu-
1][k][m];
return res;
}
double bNU(float t,int k,int m,int nu, int k1, int k2, int m1,int
m2,
int
n1,
int
n2,
double
y[][N+1][N+1],
double
b[][N+1][N+1],double un[][N+1][N+1])
{
double res;
res=(bA(t,n1)*un[nu-
1][k+m2][m+k2]+bF(k,m,nu,k1,k2,m1,m2,n2,y,t))/(bC(t,n1)-
bA(t,n1)*b[nu-1][k+m2][m+k2]);
return res;
}
void main()
{
clrscr();
int i,j,check,nu,ch;
double e,t,b[2][N+1][N+1], un[2][N+1][N+1], y[4][N+1][N+1];
//nachalnie i kraevie uslovia
for (i=0;i<=N;i++){
for (j=0;j<=N;j++)
{
y[1][i][j]=0;
y[2][i][j]=0;
b[0][i][j]=0;
b[1][i][j]=0;
un[0][i][j]=0;
un[1][i][j]=0;
}
}
check=0;ch=0;e=0.001;t=0;
59
while (check==0)
{
nu=2;t=t+h/sin(M_PI*h);
for (i=0;i<=N;i++){
for (j=0;j<=N;j++)
{
y[nu-2][i][j]=y[nu][i][j];
}
}
//perviy polushag
nu=1;
//pryamoy hod progonki
for (i=1;i
for (j=1;j
{
b[nu-1][j][i]=mb(j,i,j,0,-1,0,t,b);
un[nu-1][j][i]=bNU(t,j,i,nu,0,0,1,-1,j,i,y,b,un);
}
}
//obratnii hod progonki
for (i=1;i
for (j=N-1;j>0;j--)
{
y[nu][j][i]=b[nu-1][j][i]*y[nu][j+1][i]+un[nu-1][j][i];
}
}
//vtoroy polushag
nu=2;
//pryamoy hod progonki
for (i=1;i
for (j=1;j
{
b[nu-1][i][j]=mb(i,j,i,1,0,-1,t,b);
un[nu-1][i][j]=bNU(t,i,j,nu,1,-1,0,0,j,i,y,b,un);
}
}
//obratnii hod progonki
for (i=1;i
for (j=N-1;j>0;j--)
{
60
y[nu][i][j]=b[nu-1][i][j]*y[nu][i][j+1]+un[nu-1][i][j];
}
}
//proverka shodimosti reshenia
check=1;
for(i=1;i
for(j=1;j
{
if(fabs(y[nu][i][j]-y[nu-2][i][j])>e){check=0;}
}
}
ch++;
cout<
}
ofstream fo;
fo.open("double2.txt", ios::out|ios::app);
for(i=0;i
for(j=0;j<4;j++)
{
fo << i << " " << j << " " << y[0][i][j] <<" " << y[2][i][j] <<
" " << mx(i)*(1.-mx(i))*mx(j)*(1.-mx(j)) <<" ";
}
fo<<"\n";
}
fo.close();
fo.open("double3.txt", ios::out|ios::app);
for(i=0;i
for(j=4;j<8;j++)
{
fo << i << " " << j << " " << y[0][i][j] <<" " << y[2][i][j] <<
" " << mx(i)*(1.-mx(i))*mx(j)*(1.-mx(j)) <<" ";
}
fo<<"\n";
}
fo.close();
fo.open("double4.txt", ios::out|ios::app);
for(i=0;i
for(j=8;j
{
61
fo << i << " " << j << " " << y[0][i][j] <<" " << y[2][i][j] <<
" " << mx(i)*(1.-mx(i))*mx(j)*(1.-mx(j)) <<" ";
}
fo<<"\n";
}
fo.close();
}
62
ABLAKUL ABDIRASHIDOV
HISOBLASH MATEMATIKASI
FANIDAN KURS ISHINI BAJARISH
UCHUN USLUBIY KO‘RSATMALAR
5130200 – Amaliy matematika va informatika
ta’lim yo‘nalishi bakalavr talabalari uchun
Muharrir G.Q.Rahumova
Musahhih G.Q. Rahumova
Texnik muharrir M.Ro‘ziboyev
2008 yil 19-iyun 68-buyruq.
2013 yil 29-avgustda noshirlik bo’limiga qabul qilindi.
2014 yil 10-iyulda original maketdan bosishga ruxsat etildi.
Bichimi 60x84/1, 16, «Times New Roman» garniturasi.
Ofset qog’ozi. «Risograf» matbaa uskunasida bosildi.
Shartli bosma tabog’i – 3,75. Nashriyot hisob tabog’i – 3,25.
Adadi 25 nusxa. 257-buyurtma.
_________________________________________
SamDU bosmaxonasida chop etildi.
140104, Samarqand sh., Universitet xiyoboni, 15
View publication stats
View publication stats
Do'stlaringiz bilan baham: |