MathGroup Archive 2008

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

Search the Archive

Re: Re: Symbolic complex conjugation?


It might be useful to add that an expression like -a I does contain I   
*before* evaluation but not *after* evaluation. So:

  Unevaluated[-a  I] /. HoldPattern[I] -> -I

  I a

There is an analogous phenomenon involving expressions like 2/3 and  
Rational[2,3]: the first is evaluated into the second. Hence

2/3 /. (a_)/(b_) -> b/a
2/3

but

Unevaluated[2/3] /. (a_)/(b_) -> b/a
3/2

Andrzej Kozlowski

On 25 Jun 2008, at 19:24, Murray Eisenberg wrote:

> I'll just type I in output to denote what you called Isymbol, and I  
> show
>  fractions in output as in-line, not 2D.
>
> The equations and Solve expressions are distractions here.  so are the
> complicated names and extra structure in the solution of the second
> Solve result.
>
> You are asking, then, why the result of the second of the following is
> not what you expect:
>
>    test=Ia; test/.I -> -I
> -I a
>
>    actual=top/(-I something + else); actual/.I -> -I
> top/(else - I something)
>
> The explanation is in what you see if you look at the FullForms:
>
>    FullForm[test]
> Times[Complex[0,1],a]
>
>    FullForm[actual]
> Times[Power[Plus[else,Times[Complex[0,-1],something]],-1],top]
>
> Or, look at this:
>
>    FreeQ[#, I] & /@ {test, actual}
> {False,True}
>
> What is I, really?
>
>    FullForm[I]
> Complex[0,1]
>
> In short, there is no I in the expression actual!
>
> To accomplish what you want, you could do this:
>
>    actual/. -I -> I
> top/(else + I something)
>
> AES wrote:
>> I'm sorry, but I just don't understand why the following test case  
>> works
>> just fine:
>>
>> [In copying it, I've substituted "Isymbol" for the \[ImaginaryI] that
>> actually appears in the Out[] cells.]
>>
>>   In[202]:= eqna={a+I b==0};
>>   solna=Solve[eqna,b];
>>   b=b/.solna[[1]];
>>   bStar=b/.{I->-I};
>>   {b, Star}
>>
>>   Out[205]={ -Isymbol a, Isymbol a }
>>
>> but the actual calculation that prompted the test case doesn't:
>>
>>   In[206]:= eqnp={((dwa/2)+I(w-wa))p-I (kappa/(2 w))dN e==0};
>>   solnp=Solve[eqnp,p];
>>   p=p/.solnp[[1]];
>>   pStar=p/.{I->-I}
>>
>>   Out[208]= { (dN e kappa)/(w (-Isymbol dwa+2 w-2 wa)),
>>                        (dN e kappa)/(w (-Isymbol dwa+2 w-2 wa)) }
>>
>> And actually, I guess my real concern is not understanding "how it
>> happens" -- but more "how it can happen" that Mathematica can do
>> something this potentially damaging to some innocent user.
>>
>
> -- 
> Murray Eisenberg                     murray at math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower      phone 413 549-1020 (H)
> University of Massachusetts                413 545-2859 (W)
> 710 North Pleasant Street            fax   413 545-1801
> Amherst, MA 01003-9305
>



  • Prev by Date: Re: Export PDF plot or Save Selection As -- big troubles with
  • Next by Date: Re: NMaximize problem
  • Previous by thread: Re: Symbolic complex conjugation?
  • Next by thread: Re: Symbolic complex conjugation?