MathGroup Archive 1995

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

Search the Archive

Re: Rule Writing for x and 1/x

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg923] Re: Rule Writing for x and 1/x
  • From: Gennady <stupakov at slac.stanford.edu>
  • Date: Wed, 3 May 1995 00:02:08 -0400
  • Organization: SLAC

In article <3mnk14$dse at news0.cybernetics.net> REECE_D,
REECE+_D%A1%Electromagnetic_Sciences at mcimail.com writes:
>   Is there a way to write a single rule in MMA which will turn J/s into
W 
>and s/J into 1/W?
>   
>   {J/s->W} only works for case#1.


What about  this:

In[60]:=
rul={J->W s}

Out[60]=
{J -> s W}

In[61]:=
s/J/.rul

Out[61]=
1
-
W

In[62]:=
J/s/.rul

Out[62]=
W

Regards,
Gennady


  • Prev by Date: Re: Random[Real,{0,1},$MachinePrecision] isn't MachineNumber[] ???!!
  • Next by Date: Re: How do you input a solution from FindRoot into another equ
  • Previous by thread: Re: Random[Real,{0,1},$MachinePrecision] isn't MachineNumber[] ???!!
  • Next by thread: Re: How do you input a solution from FindRoot into another equ