       Re: Minimize with complex values

• To: mathgroup at smc.vnet.net
• Subject: [mg91487] Re: Minimize with complex values
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Sat, 23 Aug 2008 01:43:30 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <g8lpel\$imm\$1@smc.vnet.net>

```shama shahbaz wrote:

> i want to minimize the absolute value of the following expression  how ca=
> n i do this in methamatica
>
> [exp(pi/4) +exp(3*pi/4)*exp(jp)]+[exp(pi/4) *exp(-5*pi*/4)]+[exp(3*pi/4=
> )*exp(-3*pi*j/4)exp(jp)]+
>
> [exp(pi/4) *exp(-10*pi*j/4)]+[exp(pi/4) *exp(-3*pi*j/2)exp(jp)]+[exp(pi=
> /4)*exp(-15*pi*j/4)]+
>
> [exp(3*pi/4)*exp(-9*pi*j/4)exp(jp)]
>
> p is the unknown value ,and it represent the phase...which is other than 0 =
> ......is there any way to calculate it.
> Regards=0A=0A=0A

Say that "expr" holds your expression (written in correct Mathematica
syntax), then you could use *NMinimize[]*. Note that you can also add
constraint on the variable p.

In:= NMinimize[Abs[expr], p]

Out= {12.6907, {p -> -2.43096}}

In:= expr /. %[]

Out= -12.512 + 2.12222 I

In:= NMinimize[{Abs[expr], 0 < p < 2 Pi}, p]

Out= {12.6907, {p -> 3.85222}}

In:= expr /. %[]

Out= -12.512 + 2.12222 I

Regards,
-- Jean-Marc

```

• Prev by Date: Mathematica and F#
• Next by Date: Re: Minimize with complex values
• Previous by thread: Re: Minimize with complex values
• Next by thread: problems with condition in ReplaceAll