Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Re: Transforming a polynomial into a trigonometric format tia sal2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88336] Re: [mg88299] Re: Transforming a polynomial into a trigonometric format tia sal2
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Fri, 2 May 2008 03:42:44 -0400 (EDT)
  • References: <fv42j9$5ui$1@smc.vnet.net> <200805010719.DAA26032@smc.vnet.net> <E3479FDF-B47F-4F2E-BB1B-98BEF7B973F6@mimuw.edu.pl>

It is slightly better to localize the symbol a:

Chebyshev[f_, x_] :=
  Module[{a, n = Exponent[f, x]},
   Sum[a[i]*Cos[i ArcCos[x]], {i, 0, n}] /.
    SolveAlways[f == Sum[a[i]*ChebyshevT[i, x], {i, 0, n}], x][[1]]]

Andrzej Kozlowski

On 1 May 2008, at 22:19, Andrzej Kozlowski wrote:

> I think what you want is this function:
>
>
> Chebyshev[f_, x_] :=
> With[{n = Exponent[f, x]},
>  Sum[a[i]*Cos[i ArcCos[x]], {i, 0, n}] /.
>   SolveAlways[f == Sum[a[i]*ChebyshevT[i, x], {i, 0, n}], x][[1]]]
>
> So now, for example:
>
> Chebyshev[21 - 10*x + x^2, x]
> -10*x + (1/2)*Cos[2*ArcCos[x]] + 43/2
>
> TrigExpand[%]
> x^2 - 10*x + 21
>
> Chebyshev[21 - 10*x + x^2 + 3*x^3, x]
> -((31*x)/4) + (1/2)*Cos[2*ArcCos[x]] + (3/4)*Cos[3*ArcCos[x]] + 43/2
>
>
> and so on.
>
> Andrzej Kozlowski
>
>
> On 1 May 2008, at 16:19, ratullochjk2 at gmail.com wrote:
>
>> I'm sorry if I didn't explain myself better I hope this clarifies it
>> better
>>
>> when I test for x =3 x= 7 for equation:
>> 21 - 10 x + x^2 I get zero for both answers
>>
>> I used another math program using the ChebyshevT command and I
>> got this
>> 1/2 Cos[2 ArcCos[x]] + 43/2 - 10 x I tested with x=3 and x=7 and I
>> also got zero for both
>>
>> but when I do a TrigReduce
>>
>> In[148] := 21 - 10 x + x^2 /. x -> Cos[y] // TrigReduce
>>
>> I get
>>
>> Out[149]:= 1/2 (43 - 20 Cos[x] + Cos[2 x])
>> x=3 gives me 31.88
>> x=7 gives me 14.0293
>>
>> I would like to use the ChebyshevT in mathematica 6 because I prefer
>> that software but I'm not sure
>> how to get the 1/2 Cos[2 ArcCos[x]] + 43/2 - 10 x answer in
>> mathematica 6
>>
>> Am I doing something wrong with the TrigReduce function or leaving a
>> part out why are the answers not even close?
>>
>> tia sal2
>>
>> On Apr 27, 10:41 pm, ratulloch... at gmail.com wrote:
>>> Transforming a polynomial into a trigonometric format tiasal2
>>>
>>> Greetings All
>>>
>>> I'm using mathematica 6 and I have a polynomial and would like to
>>> convert it into
>>> a Trigonometric format.  Is this possible?
>>>
>>> Example:
>>> I have a polynomial
>>> 0.00154991- 4.01371 x + 1.81197 x^2 + 8.00183 x^3 - 9.3462 x^4
>>>
>>> How can I transform this into a trigonometric format
>>> Example:
>>> 0.00596679 Cos[6.98132 x] + 0.00358397 Cos[7.21403 x] +
>>> 2.25013 Sin[0.232711 x] - 4.51511 Sin[0.465421 x]
>>>
>>> Note: these aren't correct answers I just wanted to include and
>>> example
>>>
>>> tiasa
>>
>



  • Prev by Date: Re: Re: Transforming a polynomial into a trigonometric format tia sal2
  • Next by Date: Re: Re: Transforming a polynomial into a trigonometric format tia sal2
  • Previous by thread: Re: Re: Transforming a polynomial into a trigonometric format tia sal2
  • Next by thread: Re: Re: Transforming a polynomial into a trigonometric format tia sal2