Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15552 > unrolled thread

Re: Cyclic generator of a cyclic expression

Started byBob Hanlon <hanlonr357@gmail.com>
First post2013-09-27 06:31 +0000
Last post2013-09-27 06:31 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Cyclic generator of a cyclic expression Bob Hanlon <hanlonr357@gmail.com> - 2013-09-27 06:31 +0000

#15552 — Re: Cyclic generator of a cyclic expression

FromBob Hanlon <hanlonr357@gmail.com>
Date2013-09-27 06:31 +0000
SubjectRe: Cyclic generator of a cyclic expression
Message-ID<l238nu$h60$1@smc.vnet.net>
I'm uncertain as to what you are asking. This may or may not help.


expr1 = x^4 + y^4 + z^4 - y^2 z^2 - z^2 x^2 - x^2 y^2;


expr2 = x^4 - y^2 z^2;



f1[elem_List] := ExpandAll[Total[
     Subtract @@ (#^2)^2 & /@
      Subsets[elem, {2}]]] /.
   (a_?NumericQ*
      x_^n_) :> Sign[a]*x^n;


Two examples:


f1 /@ {{x, y, z}, {t, x, y, z}}
{x^4 - x^2*y^2 + y^4 - x^2*z^2 - y^2*z^2 + z^4,
   t^4 - t^2*x^2 + x^4 - t^2*y^2 - x^2*y^2 + y^4 -
     t^2*z^2 - x^2*z^2 - y^2*z^2 + z^4}



f2[elem_List] :=
 First[elem]^4 - Times @@ Rest[elem]^2


Two examples:


f2 /@ {{x, y, z}, {t, x, y, z}}


{x^4 - y^2*z^2, t^4 - x^2*y^2*z^2}



f1[Variables[expr2]] == expr1


True



f2[Variables[expr1]] == expr2


True



Bob Hanlon


On Thu, Sep 26, 2013 at 3:42 AM, Francisco Javier Garc=EDa Capit=E1n <
garciacapitan@gmail.com> wrote:

> Dear friends,
>
> Given a cyclic expression say in x,y,z like
>
> x^4 + y^4 + z^4 - y^2 z^2 - z^2 x^2 - x^2 y^2
>
> what is your more or less elegant way to get a cyclic generator, like
>
> x^4 - y^2 z^2 ?
>
> Thank you very much.
>
> --
> ---
> Francisco Javier Garc=EDa Capit=E1n
> http://garciacapitan.99on.com
>
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web