I have data set which I would like to fit to the function
$\quad \quad f(r) = A\cos(kr - \pi/4 + \phi_1)\times\exp(i(-2\log(r) + \phi_2))$,
where $k$ is a constant I know and $(A,\phi_1,\phi_2)$ are the fitting parameters. In fact, if I split my data set into real and imaginary parts and fit these separately to the function above, using a command like
solRe = FindFit[ReU, A*Cos[k*x - π/4 + B] Cos[-2 Log[x] + C], {A, B, C}, x]
solIm = FindFit[ImU, A*Cos[k*x - π/4 + B] Sin[-2 Log[x] + C], {A, B, C}, x],
everything works well. I get the same value for B
for the two fits, which is encouraging. However, the values for A
and C
are different. Therefore I would like to fit to the complex ansatz. I tried doing this with
soltot = FindFit[U, A*Cos[k*x - π/4 + B] Exp[I (-2 Log[x] + C)], {A, B, C}, x]
but I get errors. Does anyone have an idea how I could do such a fit?
FindArgMin[]
/NArgMin[]
. $\endgroup$