Constraints in complex curve fitting

Hi all,

I'm writing an all at once fitting function to fit a complex valued wave with complex-valued parameters. I will need to use some constraints on the parameters though, and haven't been able to find how Igor handles constraints on complex-valued parameters. Can I specify separate constraints for the real and imaginary components of each constraint? I have tried an expression like "imag(K0) < 1" as a constraint, but it doesn't look like this is allowed. 

I could just rewrite the function to separate the real and imaginary parameters into a set of all real parameters, but wanted to check if there's a simpler way to do this! 

 

It appears that constraints for complex fitting is an area I overlooked when creating the complex fitting feature. My apologies!

Knowing how the complex coefficients are handled internally, I tried constraints of the form Kn where n = 2*p+(imag ? 1 : 0). That is, to set a constraint on the real part of K1, you would use K2. For the imaginary part, it would be K3. That crashed, though, so don't try it.

I like your suggestion of imag(Kn) and real(Kn), and probably I need to allow the confusing scheme so that when people leave out "imag" and "real" it still works.

I am now working on it...

It would be helpful to me if you would send a message to support@wavemetrics.com so that we can converse about the details. I will update this thread when I have more to report.

Well, the next nightly build of Igor 9 will have a fix such that the kludgey, confusing method will work correctly and not crash Igor.