Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12774

Re: TrigReduce: controlling the scope

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: TrigReduce: controlling the scope
Date 2012-12-12 00:54 +0000
Message-ID <ka8kk3$m08$1@smc.vnet.net> (permalink)
References <20121211072505.3729568A2@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


In[35]:= expr2 = (expr1 =
      Sin[alpha] Cos[omega tau1] Cos[omega tau2] Cos[beta] +
       Cos[alpha] Cos[omega tau1] Cos[omega tau2] Sin[beta] +
       Sin[alpha] Cos[omega tau1] Cos[omega tau2] Sin[beta] +
       Cos[alpha] Cos[omega tau1] Cos[omega tau2] Cos[beta]) /.
    f_[alpha] g_[beta] r_ :> f[alpha] g[beta] TrigReduce[r] //
   Map[Simplify, #, {3}] & // Factor

Out[35]= 1/2 (Cos[omega (tau1 - tau2)] +
   Cos[omega (tau1 + tau2)]) (Cos[alpha] + Sin[alpha]) (Cos[beta] +
   Sin[beta])

In[36]:= expr1 == expr2 // Simplify

Out[36]= True


Bob Hanlon


On Tue, Dec 11, 2012 at 2:25 AM, alan <alansbarnett@verizon.net> wrote:
> I have an expression that is a sum of products of trignometric functions. Each term is something like this:
> Sin[alpha] Cos[omega tau1] Cos[omega tau2] Cos[beta].                  (1)
> I want to apply trig identities to the terms that contain omega to transform them into trig functions of sums and differences, but I don't want the same transformation applied to the terms involving alpha and beta.  For example, I want to express (1) as
> (1/2) Sin[alpha] Cos[beta](Cos[omega(tau1 - tau2)]+Cos[omega(tau1 + tau2)])
>
> If I apply TrigReduce to (1), I get terms like
> Cos[omega tau1 - omega tau2 + alpha - beta].
> How do I restrict the action of TrigReduce to terms containing omega?
> (I can do a hybrid calculation by cutting and pasting the terms I want, but I'd rather not have to cut and paste by hand).
>
> Thanks.
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: TrigReduce: controlling the scope Bob Hanlon <hanlonr357@gmail.com> - 2012-12-12 00:54 +0000

csiph-web