[Numpy-discussion] Optimizing recursive loop - updated example

Robert Elsner mlist at re-factory.de
Mon Jul 25 12:24:52 EDT 2011


I didn't look into that but it definitely sounds interesting. Especially
as the coefficient manipulation is mildly unstable for higher
derivatives. Need to work out the math first though ;). Thanks for the hint.

On 25.07.2011 15:59, Charles R Harris wrote:
> On Sun, Jul 24, 2011 at 5:10 PM, Robert Elsner <mlist at re-factory.de> wrote:
> 
>> Boiled it down a bit more to only include code that actually takes time.
>> First time around I found the other variant more instructive because it
>> shows the discrepancy between the DCT and the loop but might be
>> confusing. Thus here the bare minimum that correctly calculates the
>> coefficients of the first derivative from the coefficients of the
>> Chebyshev polynomials.
>>
>>
> Have you tried using an (inverse) discrete sine transform to get the
> derivative? dT_n/dx = n*U_{n-1}, where U_n is the Chebyshev polynomial of
> the second kind, sin((n+1)\theta)/sin(theta) where cos(\theta) = x. I don't
> believe the discrete sine transform is part of scipy, but you can just use
> the inverse fft instead.
> 
> <snip>
> 
> Chuck
> 
> 
> 
> 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list