summaryrefslogtreecommitdiff
path: root/gauszFit.inc
blob: 61be566735c0ab7c5b739824af50a219ec73928f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{$IFDEF gauszFitBerechneWerte}
fehlers[nParams]:=0;
for ii:=0 to length(parameter[nParams,true])-1 do
  parameter[nParams,true,ii]:=0;

for ii:=wiMin to wiMax do begin
  t0:=ii-parameter[nParams,false,0];
  t1:=exp( - sqr(t0 * parameter[nParams,false,1]) );
  t2:=parameter[nParams,false,2] * t1;
  t3:=werte[offset+qpSchritt*ii] - t2 - parameter[nParams,false,3];
  fehlers[nParams]:=fehlers[nParams] + sqr(t3);
  parameter[nParams,true,0]:=parameter[nParams,true,0] - t3 * t2 * 2 * t0 * sqr(parameter[nParams,false,1]);
  parameter[nParams,true,1]:=parameter[nParams,true,1] + t3 * t2 * 2 * sqr(t0) * parameter[nParams,false,1];
  parameter[nParams,true,2]:=parameter[nParams,true,2] - t3 * t1;
  parameter[nParams,true,3]:=parameter[nParams,true,3] - t3;
end;
{$ENDIF}