O ’ZBEKISTON RESPUBLIKASI OLIY VA O’RTA MAXSUS TA’LIM VAZIRLIGI
MIRZO ULUG’BEK NOMIDAGI
O’ZBEKISTON MILLIY UNIVERSITETI
JIZZAX FILIALI AMALIY MATEMATIKA FAKULTETI KOMPYUTER ILMLARI VA
DASTURLASHTIRISH KAFEDRASI
SONLI USULLAR FANIDAN
Mavzu: chiziqli algebraik tenglamalar sistemasini yechishning teskari matritsa yordamida yechish usuli. Nyutonning interpolyatsion formulalari
Mustaqil ishi
Bajardi: Almardonov rustamjon.
Tekshirdi: Xamdamov Yigitali .
Jizzax-2022
Nyuton interpolyatsiyon formulasi. Chiziqli algebraik tenglamalar sistemasini yechishning teskari matritsa yordamida yechish usuli.
Reja:
Nyuton interpolyatsiyon formulasi.
Chiziqli algebraic tenglamalarsistemasini
yechishning teskari matritsa yordamida yechish usuli.
Bu yerda [a,b] kesmada kiritilgan teng qadamli, ya’ni yonma-yon turgan tugun nuqtalarining orasidagi masofa h o‘zgarmas bo‘lgan, n to‘rda qiymatlari berilgan f(x) funktsiya uchun interpolyatsiyalash ko‘phadini qurish masalasini qaraymiz. Bu ko‘phadni Lagranj interpolyatsiyalash ko‘phadi sifatida ham qurish mumkinligi aniq. Ammo bu yerda qurish jihatidan Lagranj interpolyatsiyalash ko‘phadidan soddaroq bo‘lgan Nyuton interpolyatsiyalash ko‘phadlarini qurish usulini beramiz. Avvalo, chekli ayirmalar tushunchasini kiritamiz. Agar teng h qadamli n to‘rda f(x) funktsiyaning qiymatlari f(xi)=yi(i=0,1,2,…, n) berilgan bo‘lsa
yi=yi+1- yi (i=0,1,2,…, n-1)
ayirmalar 1-tartibli chekli ayirmalar,
2yi=yi+1-yi (i=0,1,2,…, n-2)
ayirmalar 2-tartibli chekli ayirmalar va hokazo
m(yi)=m-1yi+1-m+1yi (i=0,1,2,…,n-m), (mn)
ayirmalar m-tartibli chekli ayirmalar deb yuritiladi. Chekli ayirmalarning ta’rifidan ko‘rinadiki, n to‘rda berilgan funksiyaning y, 2y, …., ny chekli ayirmalari mavjud bo‘lib, n-dan yuqori tartibli chekli ayirmalari yo‘qdir.
Yuqoridagi formulalar asosida 5-tartibli chekli ayirmalar jadvalini tuzamiz:
x
|
y
|
⌂y
|
⌂2y
|
⌂3y
|
⌂4y
|
⌂5y
|
x0
|
y0
|
⌂y0=y1-y0
|
⌂2y0=⌂y1-⌂y0
|
⌂3y0=⌂2y1-⌂2y0
|
⌂4y0=⌂3y1-⌂3y0
|
⌂5y0=⌂4y1-⌂4y0
|
x1=x0+h
|
y1
|
⌂y1=y2-y1
|
⌂2y1=⌂y2-⌂y1
|
⌂3y1=⌂2y2-⌂2y1
|
⌂4y0=⌂3y2-⌂3y1
|
|
x2=x0+2h
|
y2
|
⌂y2=y3-y2
|
⌂2y2=⌂y3-⌂y2
|
⌂3y2=⌂2y3-⌂2y2
|
|
|
x3=x0+3h
|
y3
|
⌂y3=y4-y3
|
⌂2y3=⌂y4-⌂y3
|
|
|
|
x4=x0+4h
|
y4
|
⌂y4=y5-y4
|
|
|
|
|
x5=x0+5h
|
y5
|
|
|
|
|
|
…
|
…
|
|
|
|
|
|
Bu formulaning qoldiq hadi
ko’rinishda bo’ladi.
Endi qoldiq had to’g’risida bir oz to’xtalib o’taylik. Ayrim hollarda, xususan qiymatlar tajriea yo’li bilan hosil qilingan bo’lsa, baholash ancha mushkul bo’ladi. Shuning uchun qo’pol bo’lsa ham, soddaroq yo’l bilan baholash ma’quldir. Qaralayotgan oralikda hosila , demak, ayirma ham sekin o’zgaradi deb faraz qilib, formula bilai berilgan qoldiq hadda qatnashuvchi hosilani ayirma bilan alamashtiramiz.
Teng qadamli n to‘rda berilgan funktsiyaning interpolyatsiyalash ko‘phadini
Pn=a0+a1(x-x0)+a2(x-x0)(x-x1)+a2(x-x0)(x-x1)(x-x2)+…+an(x-x0)(x-x1)…(x-xn-1) ko‘rinishda izlaylik. U holda (5.10) da (5.9) ga asosan koeffitsentlarni quyidagicha aniqlaymiz.
Nyuton interpolyatsiya ko‘phadining qiymatini aniqlash
uses crt;
var
i,j,n:integer;
s,’,s1,t,x1:real;
x:array[0..7] of real;
y:array[0..7,0..7] of real;
begin
clrscr;
writeln(‘ Nyuton interpolyatsiya ko‘phadining qiymatini aniqlash ‘);
write(‘(x,y)-juftliklar soni N= ‘);read(n);
writeln(‘(x,y)-juftliklarni kriting ‘);
for i:=0 to n do
begin
{gotoxy((i)*10,4);}
write(‘x(‘,i,’)=’);read(x[i]);
{gotoxy((i)*10,4);}
write(‘y(‘,i,’)=’);read(y[0,i]);
end;
writeln(‘ berilgan argument qiymati:’);
write(‘x=’);read(x1);
t:=(x1-x[0])/(x[2]-x[1]);
for i:=1 to n do
for j:=0 to n-1 do y[i,j]:=y[i-1,j+1]-y[i-1,j];
s:=y[0,0];
s1:=1;’:=1;
for i:=1 to n do begin
for j:=1 to i do begin
s1:=s1*(t-(j-1));
‘:=‘*j;
end;
s:=s+y[i,0]*s1/’;
end;
readln;
writeln(‘ Ko‘phadning qiymati: ‘);
write(‘y(‘,x1:2:3,’)=’,s:4:4);
readln;
end.
Nyuton interpolyatsiya ko‘phadining qiymatini aniqlash
(x,y)-juftliklar soni N=3
(x,y)-juftliklarni kriting
x(0)=0.1
y(0)=0.25
x(1)=0.2
y(1)=0.37
x(2)=0.3
y(2)=0.4
x(3)=0.4
y(3)=0.48
Sonli differentsiyalashda Nyuton interpolyatsiyalash
formulasidan foydalanish
1. Chiziqli algebraik tenglamalar sistemasini yechishning matritsa usuli.
Ushbu n noma’lumli n ta chiziqli algebraik tenglamalar sistemasi berilgan bolsin.
Java dasturlash tilida codi
private static float[][] matritsa(float[][] matr,int length) {
float[][] backMatr = new float[length] [length];
for (int i=0; ifor (int j = 0; j < length; j++)
{
if (i == j)
backMatr[i][j] = 1;
else
backMatr[i][j] = 0;
}
double p = 0, q = 0, s =0;
for (int i = 0; i < length; i++)
{
p = matr[i] [i];
for (int j = i + 1; j < length; j++)
{
q = matr[j] [i];
for (int k = 0; k < length; k++)
{
matr[j] [k] = (float) (matr[i] [k] * q - matr[j] [k] * p);
backMatr[j] [k] = (float) (backMatr[i][k] * q - backMatr[j][k] * p);
}
}
}
for (int i = 0; i < length; i++)
{
for (int j = length - 1; j >= 0; j--)
{
s = 0;
for (int k = length - 1; k > j; k--)
s += matr[j][ k] * backMatr[k][i];
backMatr[j][i] = (float) ((backMatr[j][i] - s) / matr[j][j]);
}
}
return backMatr;
}
Dostları ilə paylaş: |