Скачиваний:
26
Добавлен:
09.12.2013
Размер:
2.23 Кб
Скачать
Program IntBank;
Uses CRT;
Const a=0;
b=1;
eps=0.001;
t1=0.5773;
t2=0.7071;
t3=0.7947;
t4=0.1876;

Var x1,x2,pogr,pogrS,e,
int1,int2,int3,int,eps1:real;
i:integer;

Function x(t,a,b:real):real;
begin
x:=(a+b)/2+(b-a)/2*t;
end;

function f(x:real):real;
begin
f:=(x*x)*sin(4*ln(x))/ln(x)
end;

Begin
clrscr;
Writeln('‚лзЁб«Ґ­ЁҐ Ё­вҐЈа «  ЎҐ§ Ў ­ЄЁа®ў ­Ёп');
WriteLn('h(i)':17,'Q(i)':21,'e(i)':17);
WriteLn('-----------------------------------------------------------------------------');
x1:=a;x2:=b;e:=eps;
int:=0;pogrS:=0;i:=1;
repeat
int1:=(x2-x1)/2*(f(x(t1,x1,x2))+f(x(-t1,x1,x2)));
int2:=(x2-x1)/3*(f(x(t2,x1,x2))+f(x(-t2,x1,x2))+f(x(0,x1,x2)));
int3:=(x2-x1)/4*(f(x(t3,x1,x2))+f(x(-t3,x1,x2))+f(x(t4,x1,x2))+f(x(-t4,x1,x2)));
pogr:=abs(int2-int1)/63;
eps1:=e*(x2-x1)/(b-a);
if pogr<=eps1 then
begin
int:=int+int3;
pogrS:=pogrS+pogr;
WriteLn(' ', (x2-x1):5:5, ' | ' ,int:7:7, ' | ' , e*(x2-x1)/(b-a):5:9);
WriteLn;
x1:=x2;
x2:=b;
i:=i+1;
end
else x2:=(x2+x1)/2;
until b=x1;
writeln('Љ®«ЁзҐбвў® и Ј®ў=',i-1);
writeln('‘㬬  Ё­вҐЈа « =',int:0:12);
writeln('‘㬬  Ї®ЈаҐи­®б⥩=',pogrS:0:12);
readln;
Writeln('‚лзЁб«Ґ­ЁҐ Ё­вҐЈа «  c Ў ­ЄЁа®ў ­ЁҐ¬');
WriteLn('h(i)':17,'Q(i)':21,'e(i)':17);
WriteLn('-----------------------------------------------------------------------------');
x1:=a;x2:=b;e:=eps;
int:=0;pogrS:=0;i:=1;
repeat
int1:=(x2-x1)/2*(f(x(t1,x1,x2))+f(x(-t1,x1,x2)));
int2:=(x2-x1)/3*(f(x(t2,x1,x2))+f(x(-t2,x1,x2))+f(x(0,x1,x2)));
int3:=(x2-x1)/4*(f(x(t3,x1,x2))+f(x(-t3,x1,x2))+f(x(t4,x1,x2))+f(x(-t4,x1,x2)));
pogr:=abs(int2-int1)/63;
eps1:=e*(x2-x1)/(b-a);
if pogr<=eps1 then
begin
int:=int+int3;
pogrS:=pogrS+pogr;
WriteLn(' ', (x2-x1):5:5, ' | ' ,int:7:7, ' | ' , e*(x2-x1)/(b-a):5:9);
WriteLn;
e:=e+e*(x2-x1)/(b-a)-pogr;
x1:=x2;
x2:=b;
i:=i+1;
end
else x2:=(x2+x1)/2;
until b=x1;
writeln('Љ®«ЁзҐбвў® и Ј®ў=',i-1);
writeln('‘㬬  Ё­вҐЈа « =',int:0:12);
writeln('‘㬬  Ї®ЈаҐи­®б⥩=',pogrS:0:12);
readln;
end.
Соседние файлы в папке 2ЛАБА~1