       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:=  f = c000 + c100 x + c010 y + c001 z + c110 x y + c211 x^2 y z
;

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

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

Another possibility is to iterate Coefficient.

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

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

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

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

A functional programming approach might use Fold.

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

In:= myCoefficient2[f, {x,0}, {y,0}, {z,0}]
Out= 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?