Курсовая работа: Метод наискорейшего спуска
f0:=f1;
if(ComboBox1.ItemIndex=0) then begin
gx:=exp(x0)/(exp(x0*x0)+exp(y0*y0))-exp(x0*x0)*x0*(2*(exp(x0)+exp(y0))/((exp(x0*x0)+exp(y0*y0))*(exp(x0*x0)+exp(y0*y0))));
gy:=exp(y0)/(exp(y0*y0)+exp(x0*x0))-exp(y0*y0)*y0*(2*(exp(y0)+exp(x0))/((exp(y0*y0)+exp(x0*x0))*(exp(y0*y0)+exp(x0*x0))));
end;
if(ComboBox1.ItemIndex=1) then begin
gx:=2*sin(x0)*cos(x0)/(sin(y0)*sin(y0)+1);
gy:=-2*sin(x0)*sin(x0)*cos(y0)*sin(y0)/((sin(y0)*sin(y0)+1)*(sin(y0)*sin(y0)+1));
end;
if(ComboBox1.ItemIndex=2) then begin
gx:= cos(x0)*cos(y0*y0);
gy:=-2*sin(x0)*sin(y0*y0)*y0;
end;
x0:=x0+hx*gx;
y0:=y0+hy*gy;
if(ComboBox1.ItemIndex=0) then
f1:=(exp(x0)+exp(y0))/(exp(x0*x0)+exp(y0*y0));
if(ComboBox1.ItemIndex=1) then
f1:=sin(x0)*sin(x0)/(sin(y0)*sin(y0)+1);
if(ComboBox1.ItemIndex=2) then
f1:=sin(x0)*cos(y0*y0);
StringGrid1.Cells[i,0]:=IntToStr(i+1);
StringGrid1.Cells[i,1]:=FloatToStr(x0);
StringGrid1.Cells[i,2]:=FloatToStr(y0);
StringGrid1.Cells[i,3]:=FloatToStr(f1);
i:=i+1;
StringGrid1.ColCount:=i;
if f1<f0 then begin
hx:=hx/2;