MathGroup Archive 2006

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

Search the Archive

Re: Beginner--[Please Help]How to get coefficient list issued from a Series Command


In article <eg4rm4$f9b$1 at smc.vnet.net>, albert <awnl at arcor.de> wrote:

> abdou.oumaima at hotmail.com wrote:
> 
> > Greeting,
> > 
> > I've a list issued from power series like : K={a1+b1 x +c1 x^2 , a2+b2 x
> > +c2 x^2, a3+b3 x +c3 x^2} I need te have a1, a2 and a3.
> > Then b1,b2 and b3.
> > And  c1,c2 and c3.
> 
> This gives all coefficients:
> 
> In[7]:= coeffs = Map[CoefficientList[#,x]&,K]
> Out[7]=
> {{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3}}
> 
> Transpose the resulting matrix to get the coefficients in the form you
> indicated:
> 
> In[8]:= Transpose[coeffs]
> Out[8]=
> {{a1, a2, a3}, {b1, b2, b3}, {c1, c2, c3}}

> > I need to use all those coefficients in a Sum Command. How to do that
> > please?
> 
> I don't understand what you want to do, if you want to add all coefficients
> for the same power of x you could do:
> 
> In[9]:= Map[Total,Transpose[coeffs]]
> Out[9]=
> {a1 + a2 + a3, b1 + b2 + b3, c1 + c2 + c3}

There is no need to use Map or Transpose. Just use CoefficientList:

  k = {a1 + b1 x + c1 x^2, a2 + b2 x + c2 x^2, a3 + b3 x + c3 x^2};

  CoefficientList[k, x]

  {{a1, b1, c1}, {a2, b2, c2}, {a3, b3, c3}}

  Total[%]

  {a1 + a2 + a3, b1 + b2 + b3, c1 + c2 + c3}

Cheers,
Paul

_______________________________________________________________________
Paul Abbott                                      Phone:  61 8 6488 2734
School of Physics, M013                            Fax: +61 8 6488 1014
The University of Western Australia         (CRICOS Provider No 00126G)    
AUSTRALIA                               http://physics.uwa.edu.au/~paul


  • Prev by Date: Show results of Runge-Kutta Solution
  • Next by Date: Re: JLink OutOfMemoryError
  • Previous by thread: Re: Beginner--[Please Help]How to get coefficient list issued from a Series Command
  • Next by thread: RE:Beginner--[Please Help]How to get coefficient list issued from a Series Command