Message Boards Message Boards

0
|
8634 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Minimize and complex numbers

Posted 10 years ago

Hi, I keep running into a problem using minimize on a set of equations that are complex but after multiplying by the complex conjugate the imaginary part is zero but Minimize keeps outputting:

The objective function {((-0.802836+0. I)+scatter)^2,((-0.800188+0. I)+scatter)^2,((-0.835493+0. I)+scatter)^2,((-0.823595+0. I)+scatter)^2,((-0.807161+0. I)+scatter)^2,<<42>>,((-0.818022+0. I)+scatter)^2,((-0.811734+0. I)+scatter)^2,((-0.812057+0. I)+scatter)^2,<<115>>} should be scalar-valued. >>

So far I have tried to use the Re[] function to strip off the imaginary part but with the same results. Any ideas?

POSTED BY: Kris Brumbaugh
4 Replies

Perhaps the round-off errors introduce small imaginary parts in the function to minimize. Have you tried with Abs instead of multiplying by the conjugate?

POSTED BY: Gianluca Gorni
Posted 10 years ago

Try Chop. It replaces approximate real numbers close to zero with integer 0.

POSTED BY: David Keith
Posted 10 years ago

Thanks for the replies, the problem was on my end with the independent variable definition.

POSTED BY: Kris Brumbaugh

Direct manipulation

In[7]:= ((-0.800188 + 0. I) + scatter)^2 /. Complex[x_, __] -> x

Out[7]= (-0.800188 + scatter)^2
POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract