Re: Fit

• To: mathgroup at smc.vnet.net
• Subject: [mg76274] Re: Fit
• From: Mathieu G <ellocomateo at free.fr>
• Date: Fri, 18 May 2007 06:33:59 -0400 (EDT)
• References: <f2ejm8\$d2\$1@smc.vnet.net> <f2hcg5\$2cv\$1@smc.vnet.net>

```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
>
>
> 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?