Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9702

Re: Extract coefficients of a trig polynomial

From Barrie Stokes <Barrie.Stokes@newcastle.edu.au>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Extract coefficients of a trig polynomial
Date 2012-04-20 11:46 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jmrian$lbm$1@smc.vnet.net> (permalink)
References <201204190754.DAA04272@smc.vnet.net>

Show all headers | View raw


Hi Sam

When I copy your code expression below from your email into Mathematica, there are errors:

"Syntax::sntxf: "BesselJ[1," cannot be followed by "[Rho]]".

Syntax::tsntxi: "[Rho]" is incomplete; more input is needed.

Syntax::sntxi: Incomplete expression; more input is needed ."

It's a good idea to re-paste back into Mathematica the code as it appears in the email you send to check that it's OK for everyone who tries to help.

Cheers

Barrie

>>> On 19/04/2012 at 5:54 pm, in message <201204190754.DAA04272@smc.vnet.net>, Sam
Takoy <sam.takoy@yahoo.com> wrote:
> Hi,
> 
> Suppose I have an expression that is a trigonometric polynomial in
> theta. Is there a way to neatly pick out the coefficients of the
> polynomial. I find that FourierCoefficient takes quite a bit of time,
> probably because it does a lot of integrations. My coefficients are
> very complicated expressions but do not depend on theta.
> 
> Many thanks in advance,
> 
> Sam
> 
> PS: expr = (1/1536)(1536 BesselJ[0,\[Rho]]-72 \[Epsilon]^2 \[Rho]^2
> BesselJ[0,\[Rho]]-80 \[Epsilon]^3 \[Rho]^2 BesselJ[0,\[Rho]]-384 \
> [Epsilon] \[Rho] BesselJ[1,\[Rho]]-144 \[Epsilon]^2 \[Rho] BesselJ[1,\
> [Rho]]-80 \[Epsilon]^3 \[Rho] BesselJ[1,\[Rho]]+10 \[Epsilon]^3 \
> [Rho]^3 BesselJ[1,\[Rho]]-96 \[Epsilon]^2 \[Rho]^2 BesselJ[0,\[Rho]]
> Cos[2 \[Theta]]-120 \[Epsilon]^3 \[Rho]^2 BesselJ[0,\[Rho]] Cos[2 \
> [Theta]]-384 \[Epsilon] \[Rho] BesselJ[1,\[Rho]] Cos[2 \[Theta]]-192 \
> [Epsilon]^2 \[Rho] BesselJ[1,\[Rho]] Cos[2 \[Theta]]-120 \[Epsilon]^3 \
> [Rho] BesselJ[1,\[Rho]] Cos[2 \[Theta]]+15 \[Epsilon]^3 \[Rho]^3
> BesselJ[1,\[Rho]] Cos[2 \[Theta]]-24 \[Epsilon]^2 \[Rho]^2 BesselJ[0,\
> [Rho]] Cos[4 \[Theta]]-48 \[Epsilon]^3 \[Rho]^2 BesselJ[0,\[Rho]]
> Cos[4 \[Theta]]-48 \[Epsilon]^2 \[Rho] BesselJ[1,\[Rho]] Cos[4 \
> [Theta]]-48 \[Epsilon]^3 \[Rho] BesselJ[1,\[Rho]] Cos[4 \[Theta]]+6 \
> [Epsilon]^3 \[Rho]^3 BesselJ[1,\[Rho]] Cos[4 \[Theta]]-8 \[Epsilon]^3 \
> [Rho]^2 BesselJ[0,\[Rho]] Cos[6 \[Theta]]-8 \[Epsilon]^3 \[Rho]
> BesselJ[1,\[Rho]] Cos[6 \[Theta]]+\[Epsilon]^3 \[Rho]^3 BesselJ[1,\
> [Rho]] Cos[6 \[Theta]])

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Extract coefficients of a trig polynomial Barrie Stokes <Barrie.Stokes@newcastle.edu.au> - 2012-04-20 11:46 +0000

csiph-web