       Re: minimize with complex numbers

• To: mathgroup at smc.vnet.net
• Subject: [mg91255] Re: minimize with complex numbers
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Tue, 12 Aug 2008 04:45:19 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <g7p32p\$b07\$1@smc.vnet.net>

```shama shahbaz wrote:

> when i use minimize command with real numbers i get the required answer but
>  with complex number it doesnt give me any answer or error
>
> Syntax::sntxb : Expression cannot begin with "(1+1 i) ` x+(1-1 i) ` x".
> Syntax::tsntxi : "(1+1 i) ` x" is incomplete; more input is needed.
> Syntax::sntxi : Incomplete expression; more input is needed.
>
>
> My minimize expression is
>
> ((1+1i)*x +(1-1i)*x )^2 +(x+x)^2
>
> in methamatica it becomes
>
> Minimize[{( x+x)2
> +((1+1i)x+(1-1 i)x)2},{x,x}]
>
>
> i want my answer to be in complex number come somebody tell me where i am wrong

Minimize requires that all functions present in the input be
real-valued. (It does not work with complex coefficient either.)

Note that the code you posted does not contain the imaginary unit, which
is denoted in Mathematica by I (capital i). You must have some other
error(s) since, having used the correct symbol for the imaginary unit, I
did not get the same message as yours.

In:= expr = ((1 + 1 i)*x + (1 - 1 i)*x)^2 + (x + x)^2
Minimize[expr, {x, x}]

Out= (x + x)^2 + ((1 + i) x + (1 - i) x)^2

Out= {0, {x -> Piecewise[{{-1, i == 0}}],
x -> Piecewise[{{0, i > 0 || i < 0}}, 1]}}

In:= expr = ((1 + 1 I)*x + (1 - 1 I)*x)^2 + (x + x)^2
Minimize[expr, {x, x}]

Out= (x + x)^2 + ((1 + I) x + (1 - I) x)^2

During evaluation of In:= Minimize::objc: The objective function \
(x+x)^2+((1+I) x+(1-I) x)^2 contains a nonreal constant \
1+I. >>

Out= Minimize[(x +
x)^2 + ((1 + I) x + (1 - I) x)^2, {x, x}]

Regards,
-- Jean-Marc

```

• Prev by Date: mixed partial derivatives
• Next by Date: Importing Mathematica objects
• Previous by thread: minimize with complex numbers
• Next by thread: Re: minimize with complex numbers