Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Expansion Coefficients in Multivariate Series Expansions?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26599] Re: [mg26579] Expansion Coefficients in Multivariate Series Expansions?
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Thu, 11 Jan 2001 10:39:11 -0500 (EST)
  • References: <200101090651.BAA00200@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"A. E. Siegman" wrote:
> 
> Given an expression that is the sum of products of integer powers of
> three variables (say x,y,z) multiplied by numerical coefficients:
> 
>    f = c000 + c100 x + c010 y + c001 z + c110 x y + c211 x^2 y z + . . .
> 
> where the  cijk's are all real numbers, and f may or may not be in
> Normal (or other) form, how do I find the coefficient of a particular
> term, e.g. c100 for the x term (*not*  c1000 + c110 y), or  ckmn for the
> x^k y^m z^n term?
> 
> Neither Coefficient nor SeriesCoefficient seems to do this -- and the
> SeriesCoefficient[expr, {n1,n2,n3,..}] syntax seems to be mentioned but
> neither explained or illustrated in the on-line Help.
> 
> Thanks, siegman at stanford.edu


For nonzero powers Coefficient will work just fine.

To use SeriesCoefficient you first need a series.

In[59]:=  f = c000 + c100 x + c010 y + c001 z + c110 x y + c211 x^2 y z
;

In[60]:=  ee = Series[f, {x,0,3}, {y,0,3}, {z,0,3}];

In[62]:= SeriesCoefficient[ee, {0,0,0}]
Out[62]= c000


Another possibility is to iterate Coefficient.

In[63]:= Coefficient[Coefficient[Coefficient[f, x, 0], y, 0], z, 0]
Out[63]= c000


Or you could write your own code. Below is a simple procedural way,
taking derivatives and setting variables to zero.

In[64]:= myCoefficient[ee_, vars__] := Module[
  {len, vlist={vars}, res=ee},
  Do[
    res = D[res, vlist[[j]]] /. vlist[[j,1]]->0,
    {j,Length[vlist]}];
  res
  ]

In[66]:= myCoefficient[f, {x,0}, {y,0}, {z,0}]
Out[66]= c000

A functional programming approach might use Fold.

In[72]:= myCoefficient2[ee_, vars__] := Fold[(D[#1,#2] /. #2[[1]]->0)&,
f, {vars}]

In[73]:= myCoefficient2[f, {x,0}, {y,0}, {z,0}]
Out[73]= c000


Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: How can I make the output value of Interpolation[] preciser?
  • Next by Date: Re: Fourier Transform and convolution.
  • Previous by thread: Re: Expansion Coefficients in Multivariate Series Expansions?
  • Next by thread: RE: Expansion Coefficients in Multivariate Series Expansions?