Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: smart change of variables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87719] Re: [mg87695] smart change of variables?
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Wed, 16 Apr 2008 05:02:14 -0400 (EDT)
  • References: <200804151051.GAA27960@smc.vnet.net>

Barrow wrote:
> Dear all,
> 
> I have a arithmetic problem.
> I have an expression expr = (p1 + 2*p2)*(k1 + 2*k2)
> where p1 + p2 = k1 + k2
> I wanna make the following change of variables,
> s = (p1 + p2)^2
> t = (p1 - k1)^2
> u = (p1 - k2)^2
> 
> Is it possible to tell Mathematica to express expr
> in terms of s, t, and u automatically?
> 
> Thanks so much.
> any ideas would be appreciated.
> Sincerely Barrow

More or less. You can create a Groebner basis out of the defining 
polynomials, such that variables p1, p2, k1, and k2 are ordered higher 
than s, t, and u. Then generalized division (aka polynomial reduction) 
of expr will do what it can to make such a replacement.

polys = {s-(p1+p2)^2,t-(p1-k1)^2,u-(p1-k2)^2,p1+p2-(k1+k2)};
vars = {p1,p2,k1,k2,s,t,u};
gb = GroebnerBasis[polys, vars];

In[19]:= InputForm[PolynomialReduce[(p1+2*p2)*(k1+2*k2), gb, vars][[2]]]
Out[19]//InputForm= 3*k2*p2 + (3*s)/2 + t/2 - u/2

In general the replacement will be dependent on variable and monomial 
ordering. But I'm fairly certain that you will be stuck with some part 
not replaced no matter waht orders are used, since this particular 
variable/monomial ordering does not manage to reduce k2*p2.

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Package to 'graft' Lists onto Matrices
  • Next by Date: Re: Documentation Center Tutorial
  • Previous by thread: Re: smart change of variables?
  • Next by thread: Re: smart change of variables?