MathGroup Archive 2007

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

Search the Archive

Re: quadratic multiplication

On Dec 16, 4:36 am, KFUPM <hussain.alqaht... at> wrote:
> Dear all
> I have a very large expression which involves the multiplication of
> these variables:
> var ={u1,u2,u3,u4,u5,u6} with some other constants. In the expression,
> i want to suppress any quadratic or higher order multiplication of
> these varibles , e.g u1*u5  or u1*u4*u6 should be zero. And since, my
> expression is huge, i want to do this automatically. Any help in this
> regard is highly appreciated.
> Sincererly yours,

This has come up in past. I'll show a couple of simple methods rather
than try to dig up URLs to past threads.

The MoC (Method of Choice), I think, is to use Series after
multiplying each variable by some new indeterminate. Expand in powers
of that new indeterminate, and let Series clip at the desired degree.
Then convert back to a normal expression and make the new
indeterminate unity.

suppressHOT1[expr_, vars_List, deg_Integer] := Module[
  {t, subst},
  subst = Thread[vars -> t*vars];
  Normal[Series[expr /. subst, {t, 0, deg - 1}]] /. t -> 1

Here is an alternate method, using as "reducing relations" all the
quadratic powers of your variables.

suppressHOT2[expr_, vars_] := Module[
  quads = Union[Flatten[Outer[Times, vars, vars]]];
  PolynomialReduce[expr, quads, vars][[2]]

This second approach can be extended easily to higher orders, and can
be done via replacement rules instead of PolynomialReduce. Since this
direction is not, to my mind at least, the MoC, I don't pursue these

Here is a simple example using your variable set.

In[9]:= vars = {u1, u2, u3, u4, u5, u6};

In[19]:= expr =
  RandomInteger[{-10, 10}, {4, Length[vars] + 1}].Append[vars, 1]]

Out[19]= (-10 + 9*u1 + 5*u3 + 2*u4 + 6*u5 - 4*u6)*(-4 + 10*u1 +
   5*u2 - 3*u3 -
      3*u4 + 4*u5 - 3*u6)*(9 + 6*u1 - 10*u3 + 10*u4 - 10*u5 + 3*u6)*
   (-7 + 7*u1 - 7*u2 + 6*u3 + 2*u4 - 2*u5 + 8*u6)

In[24]:= suppressHOT1[expr, vars, 2]

Out[24]= -2520 + 9408*u1 + 630*u2 + 4330*u3 - 3466*u4 + 6112*u5 -

In[25]:= suppressHOT2[expr, vars]

Out[25]= -2520 + 9408*u1 + 630*u2 + 4330*u3 - 3466*u4 + 6112*u5 -

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: ListPlot ignoring default options
  • Next by Date: Re: Re: Help needed with new Export (v. 6)
  • Previous by thread: quadratic multiplication
  • Next by thread: Re: quadratic multiplication