MATLAB: Lsqnonlin – Use levenberg-marquardt with real parameters and complex function

levenberg marquardtlsqnonlinminimizing

I want to minimize the term f(x)-v (where v is a constant complex vector number). The Function f(x) take an complex input vector and returns an complex vector. For my computations, i want that x has a certain curve (Equation 2 in the picture, x is sigma). So, each element in the x-vector should have 3 parameters x_infinity, x_zero and tau that are real (!) numbers. The problem is: if i use a complex function in lsqnonlin (levenberg-marquardt), the all the parameters are directly complex. How can i command to the solver to just consider real parameters?

Best Answer

Break the function into real and imaginary parts. In other words, modify your objective function from an N x 1 vector to 2N x 1 consisting of the real and imaginary parts,
f_new(x) = [real(f(x)); imag(f(x))]