MathGroup Archive 1998

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

Search the Archive

Re: Simplifying algebraic expr: howto?



Daniel G. Hyams wrote:
> I have an expression (for example):
> 
> u*(nx*u + ny*v)     ---- (1)
> 
> and a definition:
> 
> theta = nx*u+ny*v
> 
> How do I get mathematica to simplify the expression (1) such that it
> returns:
> 
> u*theta ?
> 

Daniel,
One way is

In[1]:=
u*(nx*u + ny*v)/.{nx*u+ny*v->theta}

Out[1]=
theta u

You  might want to accumulate several rules in a list

myRules = {nx*u+ny*v->thet, ....}

and use them all together

expr/.myRules

and even repeatedly

expr//.myRules


-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: Urgent Help please
  • Next by Date: Re: Drawing curves with equation.
  • Prev by thread: RE: Simplifying algebraic expr: howto?
  • Next by thread: Re: Simplifying algebraic expr: howto?