Курсовая работа: Метод наискорейшего спуска
end;
if(ComboBox1.ItemIndex=1) then begin
f0:=sin(x0)*sin(x0)/(sin(y0)*sin(y0)+1);
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
f0:=sin(x0)*cos(y0*y0);
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[0,0]:='1';
StringGrid1.Cells[0,1]:=FloatToStr(x0);
StringGrid1.Cells[0,2]:=FloatToStr(y0);
StringGrid1.Cells[0,3]:=FloatToStr(f1);
if f1<f0 then begin
hx:=hx/2;
hy:=hy/2;
end;
i:=1;
while not((abs(gx)<e) and (abs(gy)<e))do