Re: Re: Replace and ReplaceAll -- simple application
- To: mathgroup at smc.vnet.net
- Subject: [mg106491] Re: [mg106457] Re: Replace and ReplaceAll -- simple application
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Thu, 14 Jan 2010 05:49:49 -0500 (EST)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <200912270006.TAA12080@smc.vnet.net> <hh72dp$kud$1@smc.vnet.net> <hh9vfo$1rk$1@smc.vnet.net> <200912290618.BAA02632@smc.vnet.net> <hhf5kg$go6$1@smc.vnet.net> <200912310814.DAA24681@smc.vnet.net> <hhkj1a$4tl$1@smc.vnet.net> <201001131058.FAA06877@smc.vnet.net>
- Reply-to: murray at math.umass.edu
An interesting pair of examples. But users of any CAS system just have to learn the basic rules -- the relevant one here being that replacements are made on the FullForm, so that I, that is, Complex[0,1] does NOT appear in the FullForm of the original expression (before the replacement is attempted) in the second of the two examples! The only "cure" for this I can see is for Mathematica's fundamental evaluation sequence to be radically changed, so that 2 I, meaning 2*I, does NOT first get replaced automatically by Complex[0,2]. The consequences of such a radical change could cascade throughout the entire system, with most unwanted effect. So one simply has to learn how things work here, and teach them to others. I don't think any number of new "inconvenient" examples or fulminations against the state of things here is going to change that state. On 1/13/2010 5:58 AM, AES wrote: > In article<hhkj1a$4tl$1 at smc.vnet.net>, > What you say is certainly correct -- but I believe it bypasses the core > point. An individual with a physics background may manipulate the > impedance for an RL circuit by writing > > R + I w L /. I -> -I > > while one with an EE background may very naturally write this as > > R + I 2 Pi f L /. I -> -I > > (or, in many textbooks, R + 2Pi I L /. I -> -I) > > And, **one of these will get a wrong answer**. -- 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
- References:
- Re: Replace and ReplaceAll -- simple application
- From: AES <siegman@stanford.edu>
- Re: Replace and ReplaceAll -- simple application