Пример: Транспортная логистика
Я ищу:
На главную  |  Добавить в избранное  

Кибернетика /

Вычисление интеграла методом Ньютона-Котеса (теория и программа на Паскале)

←предыдущая следующая→
1 2 3 4 5 6 7 8 9 



Скачать реферат


end;

repeat

if keypressed then

begin

c:=readkey;

case c of

#80:

x:=x-1;

#72:

x:=x+1;

end;

setfillstyle(1,11);

case (abs(x) mod 5) of

0:

begin

bar(80,170,330,190);

setfillstyle(1,15);

bar(80,200,330,220);

bar(80,290,330,310);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,' Нажмите Enter для');

outtextxy(360,155,' ввода количества узлов');

end

else

begin

outtextxy(360,140,' Press Enter to put');

outtextxy(360,155,'in the number of units.');

end;

end;

1:

begin

bar(80,200,330,220);

setfillstyle(1,15);

bar(80,170,330,190);

bar(80,230,330,250);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,' Нажмите ENTER для ввода');

outtextxy(360,155,'приделов интегрирования.');

end

else

begin

outtextxy(360,140,' Press ENTER to put in');

outtextxy(360,155,'the bounds of integral.');

end;

end;

2:

begin

bar(80,230,330,250);

setfillstyle(1,15);

bar(80,200,330,220);

bar(80,260,330,280);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,' Нажмите ENTER для ввода');

outtextxy(360,155,'функции.');

end

else

begin

outtextxy(360,140,' Press ENTER to enter');

outtextxy(360,155,'function.');

end;

end;

3:

begin

bar(80,260,330,280);

setfillstyle(1,15);

bar(80,230,330,250);

bar(80,290,330,310);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,' Нажмите ENTER для начала');

outtextxy(360,155,'подсчета самого интеграла.');

end

else

begin

outtextxy(360,140,' Press ENTER to begin');

outtextxy(360,155,'integral calculations.');

end;

end;

4:

begin

bar(80,290,330,310);

setfillstyle(1,15);

bar(80,260,330,280);

bar(80,170,330,190);

helpwin(ea);

end;

end;

setcolor(12);

if ea mod 2 =0 then

begin

outtextxy(80,130,'Меню ввода параметров нахождения');

outtextxy(80,140,' интеграла');

outtextxy(80,180,' Ввести количество узлов(n)');

outtextxy(80,210,' Ввести приделы интегрирования');

outtextxy(80,240,' Ввести функцию');

outtextxy(80,270,' Считать интеграл');

outtextxy(80,300,' Выход ');

end

else

begin

outtextxy(80,130,'Menu of entering the parameters');

outtextxy(80,140,' of integral');

outtextxy(80,180,' Put in the number of units ');

outtextxy(80,210,' Enter the bounds of integral');

outtextxy(80,240,' Enter function');

outtextxy(80,270,' Count integral');

outtextxy(80,300,' Exit ');

end;

end;

until c=#13;

c:='t';

case (abs(x) mod 5) of

0:

begin

wwodn(ea,n);

end;

1:

wwodab(ea,a,b);

2:

begin

helpwin(ea);

setcolor(15);

setfillstyle(1,9);

bar(70,200,340,300);

rectangle(75,205,335,295);

rectangle(77,207,333,293);

if ea mod 2 =0 then

begin

outtextxy(86,227,'Введите функцию f(x):');

setcolor(14);

outtextxy(360,140,' В этом окне необходимо');

outtextxy(360,155,' ввести саму функцию.');

outtextxy(360,200,'Примечание: 1.данная программа ');

outtextxy(360,215,'распознает только ');

outtextxy(360,230,'элементарные функции.');

outtextxy(360,245,'(x,cos(x) и др.)');

outtextxy(360,260,’2.При неправильном вводе’);

outtextxy(360,275,’по умолчанию f(x)=x;’);

outtextxy(360,275,’3.Если после нажатия ENTER’);

outtextxy(360,275,’ничего не произошло, то

outtextxy(360,275,’занововведите функцию.’);

end

else

begin

outtextxy(86,227,'Enter function f(x):');

setcolor(14);

outtextxy(360,140,' In this window you have');

outtextxy(360,155,' to enter the function.');

outtextxy(360,200,'Note: This version of ');

outtextxy(360,215,'programm can indentify only ');

outtextxy(360,230,'simple functions, as');

outtextxy(360,245,'x,cos(x) and other.');

end;

setfillstyle(1,0);

bar(86,255,330,275);

readln;

gotoxy(13,17);

read(st);

writeln(st);

readln;

end;

3:if (n0)and(ab)and(st'')and((abs(x) mod 5)=3);

end;

procedure win3(ea:word;n:integer;a,b:real;int:double;f:string;h:array of double;var k:word);

{Последнее окно просмотра результатов}

var

i:integer;

c:char;

x:longint;

p1,p:string;

y:array[0..16] of double;

begin

funktia(n,a,b,y,1,f);

f:='('+f+')'+'dx =';

repeat

x:=-600000;

newsc(ea);

setfillstyle(1,2);

bar(170,120,490,360);

setcolor(14);

rectangle(175,125,485,355);

rectangle(177,127,483,353);

settextstyle(0,0,0);

setfillstyle(1,1);

bar(180,170,480,190);

if ea mod 2 =0 then

begin

outtextxy(180,135,Функция распознана.Интеграл подсчитан.');

outtextxy(180,180,' Посмотреть значение интеграла');

outtextxy(180,210,'Посмотреть коэффициенты Ньютона-Котеса');

←предыдущая следующая→
1 2 3 4 5 6 7 8 9 



Copyright © 2005—2007 «Mark5»