Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Fit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76207] Re: Fit
  • From: CKWong <CKWong.P at gmail.com>
  • Date: Thu, 17 May 2007 06:57:37 -0400 (EDT)
  • References: <f2ejm8$d2$1@smc.vnet.net>

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.



  • Prev by Date: Re: more documentation finder palettes
  • Next by Date: Re: Re: Compatibility woes
  • Previous by thread: Re: Fit
  • Next by thread: Re: Fit