К решению нелинейных вариационных задачРефераты >> Математика >> К решению нелинейных вариационных задач
b[i]: =-h*h*pCi];
c[l]:=a[l]; d[l]:=b[l];
for i: =2 to 157-1 do begin
c[i]: =a[i]-l/c[i-l];
d[i]: =b[i]+d[i-l]/c[i-l];
end;
y[156]: =d[156]/c[156];
for i: =2 to 156 do
y[157-i]: =(d[157-I] +y[157-i+l])/c[157-i];
end;
procedure kr(var xx,y :mas); р>влллели,<Л. ^сиг-С^Сл! ^wo^m.
var x,h: real;i: integer;a,p,g,f,r,1,b,c,d: mas; / </
begin
h: =2/n; x: =0;
for i: =0 to 100 do begin
P[i]:=0;
g[i]: =0;
fCi3: =x;
xx[i]: =x;
x: =x+h;
end;
У[0]: =0; y[100]: =1;
for i: =1 to 100 do begin
1[i]: =2-h*p[i];
a[i]: =(4-2*h*h*g[i])/l[i];
r[i]: =(2+h*p[i])/l[i];
end;
b[l]: =y[0]-2*h*h*f[l]/l[l];d[l]: =b[l];c[l]: =a[l];
for i: =2 to 99 do begin
- b[i]: =-2*h*h*f[i]/l[i];
c[i]: =a[i]-<r[i-l]/c[i-l]);
d[i]: =b[i]+(d[i-l]/c[i-l]);
end;
у[99]: =(d[99]+r[99]*y[100])/c[99];
for i: =2 to 99 do
yClOO-i]: =(d[100-i]+r[100-i]*y[100-i+l])/c[100-i];
end;
begin assign(ff,' b: res.dip');
rewrite(ff); writeln(ff); ^ vap(xx,y);
writeln(ff,' РЕШЕНИЕ ВАРИАЦИОННОЙ ЗАДАЧИ');
writeln(ff);
i: =0;jl: =0;
writeln(ff,' численное решение',
','аналитическое решение');
writeln(ff);
while <i<=157) and (jl<=1.57) do begin
yl:=sin(jl);
writeln(ff,' ',xx[i]: 1: 2,' ',y[i]:l:3,
',J1:1: 2,' ' ,yl: 1: 3);
i: =i+l;jl: =jl+0. 01; end;
I writeln(ff,' ' ,xx[157]: 1: 2,' ' ,у[157]:1: 3, ',J1:1: 2,' ' ,yl: 1: 3);
writeln(ff);
kr(xx,y);
writeln(ff);
writeln(ff,' РЕШЕНИЕ КРАЕВОЙ ЗАДАЧИ' );
writeln(ff);i: =0;j2: =0;
writeln(ff,' численное решение',
' /аналитическое решение' );
writeln(ff);
while (i<=100) and (j2<=l) do begin
y2: =j2*j2*j2/6+(5>Kj2/6);
writeln(ff,' ',xx[i]:1: 2_,' ' ,y[i]:1: 3, ' ,j2: 1: 2,' ',у2: 1: 3);
i: =i+l;j2: =j2+0. 01; end;
writeln(ff,' ',хх[100]: 1: 2,' ',у[100]:1: 3, ' ,з2: 1: 2,' ' ,у2: 1: 3);
close(ff);
end.