MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fit


CKWong a =E9crit :
> f[x_, y_] := 8000000 Sqrt[
>   2/=A3k] (-Erf[(-300 + x)/(4000 Sqrt[2])] + Erf[(300 + x)/(4000
>                   Sqrt[2])]) (-1/2 Sqrt[=A3k/2] Erf[(-300 + y)/(
>         4000 Sqrt[2])] + 1/2 Sqrt[=A3k/2] Erf[(300 + y)/(4000 Sqrt[2]=
)]);
>
> Gaussian2D[x_, y_, Radius_, Amplitude_] := Amplitude
>       Exp[-1/2 ((x/Radius)^2 + (y/Radius)^2)];
>
>
> ra = 2*10^4; n = 50;
> lst = Flatten[Table[N[{x, y, f[x, y]}],
>  {x, -ra, ra, ra/n},
>  {y, -ra, ra, ra/n}],1];
>
> sol = FindFit[lst, Gaussian2D[x, y, Radius, Amplitude],
>   {{Radius, ra/4},{Amplitude, 10^4}}, {x, y}];
>
> g[x_, y_] = Gaussian2D[x, y, Radius, Amplitude] /. sol;
>
> g is what you wanted.
>
>
Exactly!
Thank you as well as all repliers


  • Prev by Date: Re: All permutations of a sequence
  • Next by Date: Re: All permutations of a sequence
  • Previous by thread: Re: Fit
  • Next by thread: Dynamic PlotLabel in Math6?