MathGroup Archive 2008

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

Search the Archive

Re: Collect coefficients of array variables during

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87013] Re: [mg86971] Collect coefficients of array variables during
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 29 Mar 2008 04:21:56 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Off[Part::partd, Part::pspec];

eqn1 = 10. A[[1, 1]] + b A[[1, 1]] + c A[[1, 2]] + 3. A[[1, 2]];

eqn1 // Simplify

(b+10.) A[[1,1]]+(c+3.) A[[1,2]]

If Simplify doesn't work try FullSimplify or hit it with a hammer:

Collect[eqn1, Union[Cases[eqn1, A[[__]], Infinity]]]

(b+10.) A[[1,1]]+(c+3.) A[[1,2]]


Bob Hanlon

---- Gopinath Venkatesan <gopinathv at ou.edu> wrote: 
> Hello Mathematica Friends
> 
> If we have an array variable, and assuming after intermediate calculations, some equations are found to be below.
> 
> eqn1=10. A[[1,1]]+b A[[1,1]]+c A[[1,2]]+3. A[[1,2]] (only for illustration)
> 
> Simplify[] does not combine the coefficients under same array member, i.e. instead of (10.+b)A[[1,1]]+(c+3.)A[[1,2]], it is showing the earlier mentioned form.
> 
> Is there a way to collect them and simplify them. But when I checked for simple cases, Simplify[] seems to work.
> 
> Thanks for the suggestions.
> 
> Regards,
> Gopinath
> University of Oklahoma
> 



  • Prev by Date: variance of product of 2 independent variables
  • Next by Date: Re: Collect coefficients of array variables during calculation:
  • Previous by thread: Re: variance of product of 2 independent variables
  • Next by thread: Dynamic and J/Link