Нажат кнопку "График" дает ошибку
Код:
procedure TForm1.Button1Click(Sender: TObject);
var u: array [0..20,0..50] of real;
h,tay:real;
i,j:integer;
begin
h:=0.05;
tay:=0.25;
for j:=0 to 50 do u[0,j]:=0;
for j:=0 to 50 do
u[1,j]:=0;
for j:=0 to 50 do
begin
for i:=1 to 20 do
begin
u[i,j+1]:=u[i,j]+(tay)/(sqr(h))*(u[i+1,j]-2*u[i,j]+u[i-1,j]);
Memo1.Lines.Add('u('+inttostr(i)+ ','+ IntToStr(j)+ ')=' +FloatToStr(u[i,j+1]));
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var u: array [0..10,0..30] of real;
h,tay:real;
i,j:integer;
begin
h:=0.05;
tay:=0.25;
form2.Chart1.Series[0].Clear;
for j:=0 to 30 do u[0,j]:=0;
for j:=0 to 30 do
u[1,j]:=0;
for j:=0 to 30 do
begin
for i:=1 to 10 do
begin
u[i,j+1]:=u[i,j]+(tay)/(sqr(h))*(u[i+1,j]-2*u[i,j]+u[i-1,j]);
// Memo1.Lines.Add('u('+inttostr(i)+ ','+ IntToStr(j)+ ')=' +FloatToStr(u[i,j+1]));
// FGRAF.Chart1.SeriesList[0].AddY(2,'DSDSDS');// .` :='SDSD';
WITH FORM2 DO
BEGIN
// Chart1.Series[0].Add(u[i,j+1],'',clred);
Chart1.Series[0].Add(u[i,j+1],'',clred);
END;
end;
end;
FORM2.ShowModal;
end;
end.
[/quote]