Converting a number back to a symbol?
- To: mathgroup at smc.vnet.net
- Subject: [mg82881] Converting a number back to a symbol?
- From: AES <siegman at stanford.edu>
- Date: Fri, 2 Nov 2007 03:29:06 -0500 (EST)
- Organization: Stanford University
If we have an expression containing integer powers of the symbol u0 and we know that u0's numerical value is (or at least eventually will be) u0 = Pi/2, we know what happens if we write expr /. {u0 -> Pi/2} But what about the reverse case: we have an expression containing various integer powers of Pi, and we want to replace all the explicitly appearing Pi's by 2 u0. Writing expr /. {Pi-> 2 u0} doesn't seem to do it. Is there a way?