0
$\begingroup$

I am trying to evaluate the following:

Simplify[Meter Nano Re[(a + I b)/(Meter Nano)], Assumptions -> Element[{a, b}, Reals]]

However, Mathematica returns:

Meter*Nano*Re[(a + I*b)/(Meter*Nano)]

And if I try:

Convert[Meter Nano Re[(a + I b)/(Meter Nano)], 1]

I get the error:

Convert::incomp: "Incompatible units in Meter Nano Re[(a+I b)/(Meter Nano)] and 1."

How can I factor out the "Meter Nano" from within Re[] and simplify the above to:

a

One solution:

As suggested by rcollyer, use ComplexExpand:

ComplexExpand[Meter Nano Re[(a + I b)/(Meter Nano)]]

which gives

a

Note: ComplexExpand, as written above, assumes a and b are Reals.

$\endgroup$
  • 1
    $\begingroup$ Have you tried ComplexExpand? $\endgroup$ – rcollyer Apr 2 '13 at 3:26
  • $\begingroup$ Please use the code markup, as per my edits, to display code. $\TeX$, while pretty, does not copy well. $\endgroup$ – rcollyer Apr 2 '13 at 3:41
1
$\begingroup$
ComplexExpand[Meter Nano Re[(a + I b)/(Meter Nano)]]

a

As a side note: in v9, the Miscellaneous`Units` package that you are using (and which you don't mention in your question) has been superseded by the new built-in unit system. The above expression would have been simplified without Simplify:

Quantity[1, "Nanometers"]Re[Quantity[a + I*b, "Nanometers"^(-1)]] 

-Im[b] + Re[a]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.