啊,忘了例子。
procedure Func(x: array of Double
var y: array of Double);
begin
y[0] := Sqr(x[0]) + Sqr(x[1]) - 1;
y[1] := 0.75 * Sqr(x[0]) * x[0] + 0.9 - x[1];
end;
procedure TForm1.FormClick(Sender: TObject);
var
x, y: array [0..1] of Double;
r: Integer;
begin
x[0] := -7
x[1] := -2;
y[0] := 0
y[1] := 0;
r := NLS(2, 1, 0.1, 1E-7, 1E4, x, y, Func);
ShowMessage(Format('%d: (%s, %s)',
[r, FormatFloat('0.0000000', x[0]), FormatFloat('0.0000000', x[1])]));
end;