Re: Re: Time-consuming series coefficients
- To: mathgroup at smc.vnet.net
- Subject: [mg40281] Re: [mg40253] Re: Time-consuming series coefficients
- From: Dr Bob <majort at cox-internet.com>
- Date: Sat, 29 Mar 2003 05:19:58 -0500 (EST)
- References: <200303280929.EAA28015@smc.vnet.net>
- Reply-to: majort at cox-internet.com
- Sender: owner-wri-mathgroup at wolfram.com
It's much faster if you can settle for Real coefficients: Timing[r1 = t[50, 0.5, 0.5];] Timing[r2 = t[50, 1/2, 1/2];] {26.359*Second, Null} {117.094*Second, Null} Here's the 50th term: r1[[50]] r2[[50]] 1.537289031168204647417604240534`15.1095*^-384*u^50 u^50/650495762166524942620327\ 52046025534616345389045416905\ 03324445219002255037295850186\ 25764965108270261552651350872\ 14256298696147289052021655675\ 87441628548325476827580943368\ 26271610823959353848971904559\ 96378423061320073085482172177\ 99291851563365273912682332718\ 05331947551783651036564265975\ 29163905199318242511544176388\ 76962825641686522180458098768\ 04878179358511681294670044409\ 731448045568 Bobby On Fri, 28 Mar 2003 04:29:56 -0500 (EST), Rolf Mertig <rolf at mertig.com> wrote: > Is this what you want? > > (timings on a 1GHz Linux box): > > Mathematica 4.2 for Linux > Copyright 1988-2002 Wolfram Research, Inc. > -- Motif graphics initialized -- > > In[1]:= !!tay > t[n_,p_,q_] := Block[{f, res = 1}, > f[i_] = (E^(z*p*(q)^(i - 1)) - 1)*u + 1 + O[z]^(n + 1); > Do[res = Expand[Normal[res*f[j]]] + O[z]^(n + 1), {j, 1, n}]; > SeriesCoefficient[res, n]]; > > Table[Print["n = ",j, " time = ", > ti[j]=First[Timing[r[j]=t[j,1/2,1/2]]]];ti[j]/Second,{j,10,50,10}] > > In[1]:= <<tay > n = 10 time = 0.35 Second > n = 20 time = 2.82 Second > n = 30 time = 16.83 Second > n = 40 time = 74.97 Second > n = 50 time = 262.01 Second > > Out[1]= {0.35, 2.82, 16.83, 74.97, 262.01} > > > Rolf Mertig > Mertig Consulting > http://www.mertig.com > http://www.mathxls.com > > > "marchibald" <marchibald at maths.wits.ac.za> wrote in message > news:<b5uoel$lfe$1 at smc.vnet.net>... >> Hi, >> >> I have the following function from which I would like to extract the >> coefficient of z^{50}, and then expand the result as a series in u: >> >> f[z_,u_] := Product[1 + u (Exp(zpq^{i - 1}) - 1), {i,50}] >> >> where p=q=1/2. >> >> The product from i=1 to 10 can be done in a reasonable amount of time, >> but anything larger takes far too long. >> >> Does anyone have an idea of how to expand f[z,u] as a series quickly, or > even >> to extract the coefficient of z^{50} some other way? >> >> Thanks, >> >> M. Archibald >> University of the Witwatersrand > > > > -- majort at cox-internet.com Bobby R. Treat
- References:
- Re: Time-consuming series coefficients
- From: Rolf Mertig <rolf@mertig.com>
- Re: Time-consuming series coefficients