Re: with 5.2 Mac
- To: mathgroup at smc.vnet.net
- Subject: [mg59867] Re: with 5.2 Mac
- From: sbjensen at midway.uchicago.edu (Steuard Jensen)
- Date: Wed, 24 Aug 2005 06:31:09 -0400 (EDT)
- Organization: The University of Chicago
- References: <de6lnl$cfa$1@smc.vnet.net> <de9cni$q4o$1@smc.vnet.net> <deeo7l$339$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Quoth "Carl K. Woll" <carlw at u.washington.edu> in article <deeo7l$339$1 at smc.vnet.net>: > "Steuard Jensen" <sbjensen at midway.uchicago.edu> wrote: > > Quoth "David Park" <djmp at earthlink.net>: > >> From: Steuard Jensen [mailto:sbjensen at midway.uchicago.edu] To: mathgroup at smc.vnet.net > >> > Specifically, I have used $Assumptions to define some variables > >> > as real. I apply Conjugate to various expressions, and then > >> > Simplify the results. > >> Why don't you use... > >> ComplexExpand[Conjugate[x + I y]] > >> x - I*y > > ...my actual expressions include a mix of complex-valued and > > real-valued terms. So... I would have to pass a long list of > > complex variables to ComplexExpand each time. (And it's even > > possible that my extra TransformationFunctions might replace > > combinations of complex variables with real ones, so I might have > > to use ComplexExpand more than once.) > > In any case, whether or not ComplexExpand is the _best_ way to do > > this, I think that Simplify still ought to work as expected! :) I'm still curious about this issue (and the closely related problem with Refine that I've mentioned elsewhere). But that's drifting a bit from the topic of this particular sub-thread. > > ...thanks for your suggestion; even if it's not right for this > > problem, it could be useful for others. > I believe that ComplexExpand was created specifically for your type > of problem. If it doesn't work well for you, it would be nice if you > provided an example showing this. Looking back at my original objections above, I've started to wonder if I was just clinging to my original approach without really giving ComplexExpand a fair hearing. I still wonder if I might need to apply ComplexExpand and Simplify repeatedly in some cases in my work (that's one advantage of handling such issues in Simplify itself), but the more I think of it, the less I think it will be an issue. And of course you're right that I'd be able to just pass the name of that long list of complex variables. I had some silly worry that doing so would be a performance problem, but of course Simplify has to access $Assumptions every time, too. > As far as your objection concerning a long list of complex > variables, what is wrong with defining cvars={list of complexes}, > and then using > ComplexExpand[ expr, cvars ] When I briefly experimented with ComplexExpand some time ago, I think I gave up on it because its results came out in terms of Re[] and Im[]. But your confidence that it was the right tool for this job made me go back and look, and lo and behold, I can set the option TargetFunctions->Conjugate and it behaves exactly as I would want it to. (I was worried at first that it wouldn't distribute the Conjugate down to the complex number atoms, but it seems that it does.) My only remaining concern is performance. In another post in this thread, someone did a comparison of the speed with which various conjugation methods ran, and it looked a lot like ComplexExpand was considerably slower than the others. Do you have any sense of whether that's just an artifact of the very simple cases which he (and I) tested? (Then again, I'm tempted by the suggestion in another post that would automatically construct a list of complex variables in an expression by comparing the variables there to the list of reals in $Assumptions. That would presumably be considerably slower. And perhaps these operations will come up infrequently enough that I don't need to worry about performance at all.) Thanks for your help! (Even if it does look like I'll have to rewrite much of my existing work.) Steuard Jensen