Re: Collecting like terms after TrigReduce

*To*: mathgroup at smc.vnet.net*Subject*: [mg108938] Re: Collecting like terms after TrigReduce*From*: dh <dh at metrohm.com>*Date*: Wed, 7 Apr 2010 07:26:36 -0400 (EDT)*References*: <hphbm2$lhn$1@smc.vnet.net>

On 07.04.2010 09:19, Geico Caveman wrote: > I have a large expression that is expressed (after TrigReduce) as a > series of the form: > > c1*cos(wt) + s1*sin(2wt) + a1+c2*cos(2 wt) + c3* cos(wt) + s2*sin(wt) + > c4*cos(wt) + a2+c4*cos(2wt) + s3 sin(2wt) > > (This is just an illustrative example. The precise number of terms is > larger and the number of each kind, impossible to know ahead of the > calculation.) > > Is there any way (for compactness reasons alone) to force Mathematica > to put this in a standard form: > > (a1+a2) + (c1+c3) cos(wt) + (c2 + c4)cos (2wt) + s2 sin(wt) + (s1+s3) > sin(2wt) ? > > Using Simplify is not an option since that gets rid of the higher > harmonic terms (which I want). > Hi Geico, what do you mean by: "Simplify is not an option since that gets rid of the higher harmonic terms"? Simplify does NOT eliminate terms. Simplify applied to the given expression yields: a1 + a2 + (c1 + c3 + c4) Cos[wt] + (c2 + c4) Cos[2 wt] + s1 Sin[wt] + s2 Sin[wt] + s3 Sin[2 wt] Daniel -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh at metrohm.com> Internet:<http://www.metrohm.com>