procedure TForm1.Button3Click(Sender: TObject);
var u: array [0..20,0..50] of real;
h,tay,x,t1:real;
i,j,l,n,m,t,sh,ih:integer;
begin
sh:=100;
n:=20;
m:=50;
l:=1;
t:=300;
h:=l/n;
tay:=t/m;
//Инициализация массива
for i:=0 to n do
begin
for j:=0 to m do
u[i,j]:=0;
end;
//Конец инициализация массива
for I:=0 to n do
begin
x:=i*h;
u[I,0]:=sqr(2)*SIN(pi*x);
end;
for j:=0 to m do u[0,j]:=0 ;
for j:=0 to m do
u[n,j]:=0;
for j:=1 to m do
begin
// FORM2.Chart1.Series[0].Add(u[i,j],'',clred);
for i:=1 to n-1 do
begin
u[i,j]:=u[i,j-1]+(tay/sqr(h))*(u[i+1,j-1]-2*u[i,j-1]+u[i-1,j-1]);
Memo1.Lines.Add('u('+inttostr(i)+ ','+ IntToStr(j)+ ')=' +FloatToStr(u[i,j]));
WITH FORM2 DO
BEGIN
Chart1.Series[0].Add(u[i,j],'',clred);
END;
end;
end;
form2.ShowModal;
end;