MathGroup Archive 2010

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

Search the Archive

Re: [Please Help] How to get coefficient list from a

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114448] Re: [Please Help] How to get coefficient list from a
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 4 Dec 2010 06:16:45 -0500 (EST)

expr1 = a1 + a2*x + a3*y + a4*x^2 + a5*x*y + a6*y^2;

coef = CoefficientList[expr, {x, y}]

{{a1, a3, a6}, {a2, a5, 0}, {a4, 0, 0}}

>From example in documentation on CoefficientList

expr2 = Fold[FromDigits[Reverse[#1], #2] &, coef, {x, y}]

a1 + a2 x + a4 x^2 + (a3 + a5 x) y + a6 y^2

expr1 == expr2 // Simplify

True


Bob Hanlon

---- Autt <kajornrungsilp.i 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,




--

Bob Hanlon



  • Prev by Date: WolframAlpha[] give results but not parse!
  • Next by Date: Re: Mathematica and Symbolic Manipulation
  • Previous by thread: Re: WolframAlpha[] give results but not parse!
  • Next by thread: Re: [Please Help] How to get coefficient list from a