Re: Transforming a polynomial into a trigonometric format tia sal2
- To: mathgroup at smc.vnet.net
- Subject: [mg88245] Re: Transforming a polynomial into a trigonometric format tia sal2
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 29 Apr 2008 06:50:50 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <fv42j9$5ui$1@smc.vnet.net>
ratullochjk2 at gmail.com wrote: > 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 Well, as stated, I do not understand what you are trying to do. Fourier Series expansion? But your function must be periodic... Anyway, you should have a look at the "FourierSeries`" package, it might help clarifying what your goal is. Non linear approximation? You need to specify an interval... Perhaps FindFit is what you are looking for (you may have to try different models and intervals, though). For instance, poly = 0.00154991 - 4.01371 x + 1.81197 x^2 + 8.00183 x^3 - 9.3462 x^4; data = Table[{x, poly}, {x, -1, 1, .1}]; model = a Sin[b + c x] + d Cos[e + f x] + g; params = {a, b, c, d, e, f, g}; vars = x; sol = FindFit[data, model, params, vars] ft = model /. sol Plot[{poly, ft}, {x, -1, 1}] -740.092 + 1176.29 Cos[0.11808- 0.581571 x] - 436.92 Sin[1.36856+ 0.965664 x] Regards, -- Jean-Marc