Muhammad al-Xorazmiy nomidagi Toshkent axborot texnalogiyalari universituti.
2-MUSTAQIL ISH №2
Mavzu: Chiziqli bo‘lamagan tenglamalar sistemasini taqribiy yechish haqida umumiy tushuncha; Berilgan chiziqli bo‘lmagan tenglamalar sistemasini Nyuton usulida taqriban yechish
Bajardi:Shokirov. A
Tekshirdi: Sadaddinova. S
CHIZIQSIZ TENGLAMALAR SISTEMASINI TAQRIBIY YECHISHNI ANIQLIKDA ZEYDEL USULI BILAN TOPISH
#include
#include
using namespace std;
int main ()
{
float a[100], b[100], c[100];
int i=0;
a[0]=65*1./12;
b[0]=78*1./10;
c[0]=41*1./9;
a[i+1]=65*1./12-3*1./12*b[i]-4*1./12*c[i];
b[i+1]=78*1./10-2*1./10*a[i+1]-1*1./10*c[i];
c[i+1]=41*1./9-3*1./9*a[i+1]-2*1./9*b[i+1];
cout<<"\n\t"<while(sqrt(pow((a[i+1]-a[i]),2)+pow((b[i+1]-b[i]),2)+pow((c[i+1]-c[i]),2))>=0.001)
{
i=i+1;
a[i+1]=65*1./12-3*1./12*b[i]-4*1./12*c[i];
b[i+1]=78*1./10-2*1./10*a[i+1]-1*1./10*c[i];
c[i+1]=41*1./9-3*1./9*a[i+1]-2*1./9*b[i+1];
cout<}
cout<<"ANIQLIK: "<cout<<" Yechim: "<<12*a[i+1]+3*b[i+1]+4*c[i+1]<<"\n\t";
return 0;
}
A B C D E F G
0
|
5,416667
|
7,8
|
4,555556
|
|
|
|
1
|
1,948148
|
6,954815
|
2,360658
|
3,468519
|
0,845185
|
2,194897
|
2
|
2,891077
|
6,985719
|
2,039481
|
0,942929
|
0,030904
|
0,321177
|
3
|
2,99041
|
6,99797
|
2,003648
|
0,099333
|
0,012251
|
0,035833
|
4
|
2,999292
|
6,999777
|
2,000286
|
0,008882
|
0,001807
|
0,003362
|
5
|
2,999961
|
6,999979
|
2,000018
|
0,000669
|
0,000202
|
0,000268
|
|
|
|
|
|
|
|
Quyidagi ko‘rinishdagi sistema berilgan bo‘lsin.
(1)
Biz buyerda sistemaning yagona yechimi mavjud bo‘lgan soha D ma’lum deb hisoblaymiz. Shu sohadagi taqribiy yechimni berilgan >0 aniqlikda topish uchun quyidagi iteratsion jarayon tatbiq qilinadi. Avvalo boshlang‘ich yaqinlashish tanlanadi. Keyingi qadamlar esa quyidagi formulalar bilanhisoblanadi.
(2)
Bu yerda
(3)
(8) formulalarda funksiyalar va ularning hosilalarining qiymatlari nuqtada hisoblanadi. (7) formulalar bo‘yicha hisoblashlar esa talab qilingan aniqlik bajarilguncha, ya’ni
(4)
Shart bajarilguncha davom ettiriladi.
Misol
Yechilishi
bu yerda f1(x,y)= f2(x,y)=
x
|
y
|
d
|
d1
|
d2
|
E
|
1
|
0,5
|
2
|
-8,25
|
1
|
|
5,125
|
0
|
10,25
|
17,26563
|
-31,9688
|
4,155192535
|
3,4405488
|
3,118902
|
37,32843
|
30,26393
|
41,80638
|
3,544704266
|
2,6298015
|
1,998942
|
18,29111
|
4,539477
|
2,773937
|
1,382614702
|
2,3816221
|
1,847287
|
14,97225
|
0,312152
|
-0,05963
|
0,290847377
|
2,3607734
|
1,85127
|
14,79818
|
0,00206
|
-0,00083
|
0,02122574
|
2,3606342
|
1,851325
|
14,79718
|
9,42E-08
|
-3E-08
|
0,000149978
|
#include
using namespace std;
int main()
{
float f1,f2,f1xhosila,f2xhosila,f1yhosila,f2yhosila,D, D1, D2,x[10],y[10];
int n;
cout<cout<<"Ikkita chiziqsiz tenglamalar sistemasini taqribiy yechishda NYUTON usuli"<cout<x[0]=1; y[0]=0.5;
for(n=0; ;n++)
{
f1=pow(x[n],2)-2*x[n]-y[n]+1;
f2=pow(x[n],2)+pow(y[n],2)-9;
f1xhosila=2*x[n]-2;
f1yhosila=-1;
f2xhosila=2*x[n];
f2yhosila=2*y[n];
D=f1xhosila*f2yhosila-f1yhosila*f2xhosila;
D1=f1*f2yhosila-f2*f1yhosila;
D2=f2*f1xhosila-f1*f2xhosila;
x[n+1]=x[n]-D1/D;
y[n+1]=y[n]-D2/D;
cout<<"x["<if(sqrt(pow(x[n+1]-x[n],2)+pow(y[n+1]-y[n],2))<0.004)
break;
}
cout<cout<<"tenglamaning taqribiy yechimi"<Download 106,92 Kb. Do'stlaringiz bilan baham: |