Re: Common factors in a list
- To: mathgroup at smc.vnet.net
- Subject: [mg58338] Re: [mg58327] Common factors in a list
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Tue, 28 Jun 2005 21:56:38 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Mathematica will just undo the operation since the multiplication is automatic
expr1=a*{x,y,z}
{a x,a y,a z}
You can use a dummy operator such as CircleTimes
expr2=expr1/.{a_*x_,a_*y_,a_*z_}:>
CircleTimes[a,{x,y,z}]
a ? {x, y, z}
And clear it with
expr2/.CircleTimes:>Times
{a x,a y,a z}
Bob Hanlon
>
> From: "John Reed" <nospamjreed at alum.mit.edu>
To: mathgroup at smc.vnet.net
> Date: 2005/06/28 Tue AM 05:13:27 EDT
> Subject: [mg58338] [mg58327] Common factors in a list
>
> I'm working with a list (vector) that's composed of functions such as
> complex exponentials and Bessel functions. Some of the functions are
common
> to each element of the list. I'm trying to find a way to do the following:
>
> {a x, a y, a z}-> a *{x, y, z}
>
> In this expression, a, x, y, z are polynomials, exponentials and/or Bessel
> functions.
>
> So far I haven't had any luck with this. Does anyone have a simple
> solution?
>
> John Reed
>
>