MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Solving complex equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91222] Re: Solving complex equations
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sat, 9 Aug 2008 07:50:01 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <g7h9m1$b6e$1@smc.vnet.net>

Adel Elsabbagh wrote:

> If I have a complex equation in the form of
> a+b I + c+d I == 3+ 4 I
> where a, b, c, and d are all assumed to be real.
> 
> How do I tell Mathematica 6 to separate the real and imaginary parts to make
> two equations in the form of
> a + c == 3, and
> b + d == 4.
> 
> I need this to apply it on a long list of equations.

A possible approach could be the following thought it might need some 
tweaking depending on the actual structure of your equations.

   expr = a + b I + c + d I == 3 + 4 I;

   Thread[ComplexExpand[expr] /.
      Plus[r___, Times[Complex[0, 1], Plus[i___]]] :> {Plus[r], i} /.
     Complex[a_, b_] -> List[a, b]]


   {a + c == 3, b + d == 4}

Regards,
-- Jean-Marc


  • Prev by Date: Re: Exported PDFs are too big in file size.
  • Next by Date: Re: Exported PDFs are too big in file size.
  • Previous by thread: Re: Solving complex equations
  • Next by thread: Re: Solving complex equations