Muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti dif fakulteti


Download 38.02 Kb.
Sana18.06.2022
Hajmi38.02 Kb.
#765143
Bog'liq
Algoritmni loyihalash 3-amaliy ish
1ANNOTATSIYA, 1ANNOTATSIYA, 1ANNOTATSIYA, 1ANNOTATSIYA, 1ANNOTATSIYA, 1ANNOTATSIYA, 1ANNOTATSIYA, qo'llanma kimyo, Фаттоҳ Назаров, biznes huzhzhatlarini yuritish, biznes huzhzhatlarini yuritish, 2-57-мактаб ОКТЯБРЬ ХИСОБОТ 2020-ЙИЛ қўшимча, fanI7, Салат, Салат


O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI


MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT
TEXNOLOGIYALARI UNIVERSITETI
DIF FAKULTETI


2 – BOSQICH DIF 317-20 GURUH TALABASI
YULDASHEV IQBOLJONNING
ALGORITMLARNI LOYIHALASH FANIDAN
TAYYORLAGAN


3-AMALIY ISHI


Bajardi: Yuldashev Iqboljon
Toshkent – 2022
Variant N-30

Dastur kodi :


#include
#include
using namespace std;
int main(){
double t[21] , f[21] , y_m[21 ], a[10] , b[10] , c[10] , T , sum_f=0 , h , v;
cout<<"x va unga mos f ni kiriting:\n";
for(int i=0 ; i<21 ; i++ ){
cout<<"x["<
cin>>t[i];
cout<<"f["<
cin>>f[i];
}
T = t[20];
h = T / 20;
cout<
for(int i=1 ; i<20 ; i++)
sum_f+=f[i];
a[0] = 2 * ( ( f[0] + f[20] ) / 2 + sum_f ) * h / T;
b[0] = 0;
for(int k=1 ; k<11 ; k++){
a[k] = f[0]*sin(k*M_PI*h/T) - f[20]*sin(2*k*M_PI*(T-(h/2))/T);
for(int i=1 ; i<20 ; i++)
{
v=i*h;
a[k] += f[i]*( sin(2*M_PI*k*(v+(h/2))/T)-sin(2*M_PI*k*(v-(h/2))/T) );
}
a[k]/=(M_PI*k);
cout<<"a"<
}
cout<
for(int k=1 ; k<11 ; k++){
b[k] = f[0]* (cos(k*M_PI*h/T) -1) + f[20]*( 1-cos(2*k*M_PI*(T-(h/2))/T) );
for(int i=1 ; i<20 ; i++)
{
v=i*h;
b[k] += f[i]*( cos(2*M_PI*k*(v+(h/2))/T)-cos(2*M_PI*k*(v-(h/2))/T) );
}
b[k]/=(-1*M_PI*k);
cout<<"b"<
}
c[0]=0;
cout<<" \n\n";
for(int i=1;i<11;i++){
c[i]=sqrt(a[i]*a[i]+b[i]*b[i]);
cout<<"c"<
}
// c1 -> max;
double fi = atan(a[1]/b[1]);
cout<<"\n\n model qiymatlar va ularning xatoliklari : "<
for(int i=0 ; i<21 ; i++){
v=h*i;
y_m[i]=c[1]*sin(2*M_PI*v/T + fi );
cout<<"y"<
}
}


Ushbu dastur furye koeffitsiyentlarini a(n) va b(n) larni hisoblab beradi :


Natija:
x va unga mos f ni kiriting:
x[0]=0
f[0]=7.192
x[1]=0.0000007
f[1]=8.5087
x[2]=0.0000014
f[2]=8.99176
x[3]=0.0000021
f[3]=8.59395
x[4]=0.0000028
f[4]=7.33423
x[5]=0.0000035
f[5]=5.394
x[6]=0.0000042
f[6]=2.90518
x[7]=0.0000049
f[7]=0.131437
x[8]=0.0000056
f[8]=-2.65568
x[9]=0.0000063
f[9]=-5.18331
x[10]=0.000007
f[10]=-7.204
x[11]=0.0000077
f[11]=-8.5199
x[12]=0.0000084
f[12]=-9.00216
x[13]=0.0000091
f[13]=-8.60354
x[14]=0.0000098
f[14]=-7.36303
x[15]=0.0000105
f[15]=-5.402
x[16]=0.0000112
f[16]=-2.91238
x[17]=0.0000119
f[17]=-0.137836
x[18]=0.0000126
f[18]=2.65008
x[19]=0.0000133
f[19]=5.17852
x[20]=0.000014
f[20]=7.2


a(n) va b(n) natijalari:

a0 = 7e-07


a1 = 7.16981
a2 = 0.00159201
a3 = 0.00155824
a4 = -0.000578708
a5 = -0.00179883
a6 = -0.000530018
a7 = 0.00131071
a8 = 0.00122422
a9 = -0.000432319
a10 = -0.00127458

b1 = 5.37338


b2 = -0.0024293
b3 = 0.000283732
b4 = 0.0011414
b5 = -0.000508666
b6 = -0.00205845
b7 = -0.00131622
b8 = 0.000571596
b9 = 0.0010459
b10 = -0.000254648


Endi C(n) larni hisoblaymiz va ular orasidan qolganlaridan juda ko`p marta katta bo’lganini aniqlab olamiz ya’ni yetakchi garminikani topamiz :
c1 = 8.95988
c2 = 0.00290448
c3 = 0.00158386
c4 = 0.00127973
c5 = 0.00186937
c6 = 0.00212559
c7 = 0.00185752
c8 = 0.00135108
c9 = 0.00113173
c10 = 0.00129977

C(n) ning qiymatlari orasida biz qidirgan qiymat C1 da kuzatildi !


Yetakchi garmonika amplitudasi : A =8.95988
Chastotasi : w =17.91976
Boshlang’ich siljish burchaklari : j = 0.644979 radian
Model funksiyaning ko’rinishi : f_model ( t ) = C1 * sin ( 2*p*t/T + j )
j = arctg(a1/b1)

Model funksiyaning berilgan har bir t vaqtdagi qiymatlari va dastlabki qiymatlarga nisbatan nisbiy xatolik :


y0 = 7.16981 0.308508%
y1 = 8.47936 0.344799%
y2 = 8.95889 0.365522%
y3 = 8.56147 0.377996%
y4 = 7.32598 0.112466%
y5 = 5.37338 0.382284%
y6 = 2.89479 0.357503%
y7 = 0.132846 1.0717%
y8 = -2.64211 0.51111%
y9 = -5.15843 0.479985%
y10 = -7.16981 0.474569%
y11 = -8.47936 0.475802%
y12 = -8.95889 0.480628%
y13 = -8.56147 0.48904%
y14 = -7.32598 0.50317%
y15 = -5.37338 0.529811%
y16 = -2.89479 0.60384%
y17 = -0.132846 3.62053%
y18 = 2.64211 0.300876%
y19 = 5.15843 0.387931%
y20 = 7.16981 0.419277%

Download 38.02 Kb.

Do'stlaringiz bilan baham:




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