MathGroup Archive 2012

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

Search the Archive

Re: Rule replacement doesn't work after NDSolve?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124068] Re: Rule replacement doesn't work after NDSolve?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sat, 7 Jan 2012 05:26:03 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

On 1/6/12 at 4:18 AM, g.crlsn at gmail.com (gac) wrote:

>I see that the FullForm[-2*I] is also not
>Times[Complex[-2,0],Complex[0,1]].

>So this won't work either:

>-2*I/.Complex[0,1]->Complex[0,-1]

>to replace only I with -I, we need to use parentheses:

>-2*(I/.I->-I)

No, it is not necessary to use parentheses. This works:

In[8]:= 2 I /. Complex[_, a_] -> -a I

Out[8]= -2 I




  • Prev by Date: Re: DirectoryStack[] not showing top directory stack item
  • Next by Date: Re: Default sort of vector is by "complexity" of expression!!?????
  • Previous by thread: Re: Rule replacement doesn't work after NDSolve?
  • Next by thread: problem calculating a square simplex IFS triangularization