MathGroup Archive 2010

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

Search the Archive

Re: How to get coefficient list from a Series Command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114446] Re: How to get coefficient list from a Series Command
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Sat, 4 Dec 2010 06:16:23 -0500 (EST)
  • References: <idakdb$m2u$1@smc.vnet.net>

On Dec 3, 3:30 am, Autt <kajornrungsil... at gmail.com> wrote:
> Greeting,
> I've a list issued from  multivariate series like : K={a1+a2*x +a3*y
> +a4*x^2*+a5*x*y +a6*y^2 }
> I need to have {a1, a2 , a3 ,a4,a5,a6}
>
>  How to do that please?
> e.g.
> n = 3
> u = Normal[Series[x^4 + y^4 + x^2, {x, 5, n}, {y, 5, n}]]
> c[0] = {};
> d = {};
> q[0] = {};
> For[k = 1 , k <= n - 1, k++,
>  For[i = 0 , i <= k , i++,
>   p[i, k - i] =
>    SeriesCoefficient[u, {x, 5, i}, {y, 5, k - i}];
>   q[k] = Union[{q[k - 1], {p[i, k - i]}}];
>   d = Union[d, q[k]];
>
>   Print[d];
>
> Best regard,

c = CoefficientList[u,{x,y}]

{{-1250,500,-150,20},{500,0,0,0},{-149,0,0,0},{20,0,0,0}}

c[[i,j]] is the coefficient of x^(i-1)*y^(j-1).

TableForm[c, TableHeadings->MapThread[#1^Range[0,#2-1]&,
{{x,y},Dimensions@c}], TableAlignments->Right]

         1     y   y^2   y^3
  1  -1250   500  -150    20
  x    500     0     0     0
x^2   -149     0     0     0
x^3     20     0     0     0


  • Prev by Date: Re: Replacement Rule with Sqrt in denominator
  • Next by Date: Re: Cyclical Decimal Expansion
  • Previous by thread: Re: Mathematica and Symbolic Manipulation
  • Next by thread: I look for a bi-modal distribution