Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Confuse to collect the coefficient

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114413] Confuse to collect the coefficient
  • From: Autt <utt_alert90 at hotmail.com>
  • Date: Fri, 3 Dec 2010 05:23:24 -0500 (EST)

I have to collect the coefficient of Taylor series but It doesn't work eg.
n = 3
u = Normal[Series[x^2 + y^2, {x, 5, n}, {y, 5, n}]]
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[p[i, k - i]];]]
Print[q[1]];
Print[d];

In the finally the results of d is {{},{0},{1},{10},{{},{10}}}
Why is cannot union all of this in to the form of  {0,1,10}


  • Prev by Date: Re: Formatting integers in strings
  • Next by Date: Hodgkin-Huxley Equations
  • Previous by thread: Re: Simplify complex equation
  • Next by thread: Hodgkin-Huxley Equations