       Re: Fitting with a complex equation

• To: mathgroup at smc.vnet.net
• Subject: [mg18668] Re: [mg18403] Fitting with a complex equation
• From: Paul Abbott <paul at physics.uwa.edu.au>
• Date: Thu, 15 Jul 1999 01:45:53 -0400
• Organization: University of Western Australia
• References: <199907070411.AAA21525@smc.vnet.net.> <7m1889\$5i0\$11@dragonfly.wolfram.com>
• Sender: owner-wri-mathgroup at wolfram.com

```Gibum wrote:

> I'm having a trouble with the determining parameters of the equation with
> the experimental data.
> This is my equation.
>
> f(x)=Abs[A/(wa-x-I Ga)+k E^(I t)]^2

It is a good idea to simplify this explicitly real expression before
proceeding any further.  In the code below, FindMinimum is using the
secant method because the required derivatives cannot be computed in
closed form (because of the Abs[] in f(x)).

The following short Notebook shows one way to compute and simplify f(x)

Notebook[{
Cell[BoxData[
x /. \[InvisibleSpace]Complex[a_, b_] :>
Complex[a, \(-b\)]\)], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
\(TraditionalForm\`\(\((A\/\(wa - x - \[ImaginaryI]\ Ga\) + \
\[ExponentialE]\^\(\[ImaginaryI]\ t\)\ k)\)\^*\) \((A\/\(wa - x - \
\[ImaginaryI]\ Ga\) + \[ExponentialE]\^\(\[ImaginaryI]\ t\)\ k)\) //
Expand\)], "Input"],

Cell[BoxData[
\(TraditionalForm\`A\^2\/\(\((\(-\[ImaginaryI]\)\ Ga + wa - x)\)\
\((\
\[ImaginaryI]\ Ga + wa - x)\)\) +
\(\[ExponentialE]\^\(\(-\[ImaginaryI]\)\ \
t\)\ k\ A\)\/\(\(-\[ImaginaryI]\)\ Ga + wa - x\) +
\(\[ExponentialE]\^\(\
\[ImaginaryI]\ t\)\ k\ A\)\/\(\[ImaginaryI]\ Ga + wa - x\) +
k\^2\)], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
Collect[ComplexExpand[%,
TargetFunctions -> {Re,
Im}], \((Ga\^2 + \((wa - x)\)\^2)\)]\)\)], "Input"],

Cell[BoxData[
\(TraditionalForm\`A\^2\/\(Ga\^2 + \((wa - x)\)\^2\) + \(2\ k\
\((\((wa - \
x)\)\ \(cos(t)\) + Ga\ \(sin(t)\))\)\ A\)\/\(Ga\^2 + \((wa - x)\)\^2\) +
k\^2\)], "Output"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
\(TraditionalForm\`Collect[%, \((Ga\^2 + \((wa - x)\)\^2)\)]\)], \
"Input"],

Cell[BoxData[
\(TraditionalForm\`k\^2 + \(A\^2 + 2\ k\ \((\((wa - x)\)\ \(cos(t)\)
+ Ga\
\ \(sin(t)\))\)\ A\)\/\(Ga\^2 + \((wa - x)\)\^2\)\)], "Output"]
}, Open  ]]
}
]

Cheers,
Paul

____________________________________________________________________
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia
Nedlands WA  6907                     mailto:paul at physics.uwa.edu.au
AUSTRALIA                            http://physics.uwa.edu.au/~paul

God IS a weakly left-handed dice player
____________________________________________________________________

```

• Prev by Date: Re: NDSolve of partial differentiel equation
• Next by Date: Re: Menu Control
• Previous by thread: Fitting with a complex equation
• Next by thread: Re: Fitting with a complex equation