4-Amaliy ish Mavzu: Taqribiy integrallash usullari. Zaruriy aniqlikni ta’minlovchi qadamni tanlash


Download 0.76 Mb.
Sana18.06.2023
Hajmi0.76 Mb.
#1594586
Bog'liq
4-amaliy topshiriq


4-Amaliy ish
Mavzu: Taqribiy integrallash usullari. Zaruriy aniqlikni ta’minlovchi qadamni tanlash



1.Chap to’rtburchak usuli


#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;
double h=(b-a)/N;
double x=a;
double S=pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));
for (int i=1;ix=x+h;
S=S+pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));
}
S=S*h;
cout<<"S="<cout<<"N="<}

2.O’ng to’rtburchak usuli

#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;

double h=(b-a)/N;


double x=b;
double S=pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));

for (int i=1;i
x=x-h;
S=S+pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));
}
S=S*h;
cout<<"S="<cout<<"N="<}

3.O’rta to’rtburchak usuli

#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;

double h=(b-a)/N;


double x=a+h/2;
double S=pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));

for (int i=1;i
x=x+h;
S=S+pow((0.4*x*x+1.5),1.0/2)/(2.5+pow((2*x+0.8),1.0/2));
}
S=S*h;
cout<<"S="<cout<<"N="<}




1.Chap to’rtburchak usuli


#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;

double h=(b-a)/N;


double S=cos(a*a+0.8)/(1.5+sin(0.6*a+0.5));


for (int i=1;i
double x=a+i*h;
S=S+cos(x*x+0.8)/(1.5+sin(0.6*x+0.5));
}
S=S*h;
cout<<"S="<cout<<"N="<}

2.O’ng to’rtburchak usuli

#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;

double h=(b-a)/N;


double S=cos(b*b+0.8)/(1.5+sin(0.6*b+0.5));


for (int i=1;i
double x=b-i*h;
S=S+cos(x*x+0.8)/(1.5+sin(0.6*x+0.5));
}
S=S*h;
cout<<"S="<cout<<"N="<}

3.O’rta to’rtburchak usuli

#include


#include
using namespace std;
int main(){
double a,b,N;
cout<<"a="; cin>>a;
cout<<"b="; cin>>b;
cout<<"N="; cin>>N;

double h=(b-a)/N;


double S=0;


for (int i=1;i
double x=a+h/2+(i-1)*h;
S=S+cos(x*x+0.8)/(1.5+sin(0.6*x+0.5));
}
S=S*h;
cout<<"S="<cout<<"N="<}



Download 0.76 Mb.

Do'stlaringiz bilan baham:




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