alfa[1]:=0;
beta[1,0]:=1;
for k:=0 to M do
begin
teta[0,k]:=1;
end;
for z:=1 to N-1 do
Begin
teta[z,0]:=0;
end;
for J:=0 to M-1 do
begin
for i:=1 to N-1 do
begin
Fi[i,j]:=(-teta[i,j]/tau)-tz*k0*(1-teta[i,j])*exp(-(E)/(R*(T0+teta[i,j]*(Tgor-T0))));
end;
for i:=2 to N do
begin
alfa[i]:=ai/(bi-ci*alfa[i-1]);
beta[i,j]:=-(ci*beta[i-1,j]-Fi[i-1,j])/(bi-ci*alfa[i-1]);
end;
teta[N,j+1]:=beta[N,j]/(1-alfa[N]);
for i:=N-1 downto 1 do
begin
teta[i,j+1]:=alfa[i+1]*teta[i+1,j+1]+beta[i+1,j];
end;
for i:=0 to N-1 do
begin
memo1.Lines.Add('TETA('+INTTOSTR(I)+','+INTTOSTR(J)+') = '+FLOATTOSTR(TETA[I,J]));
//Memo1.Lines.Add(FloatToStr(teta[N,j+1]));
end;
end;
end;