Re: General--Trigonometric functions manipulations in Mathematica

• To: mathgroup at smc.vnet.net
• Subject: [mg71512] Re: General--Trigonometric functions manipulations in Mathematica
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Tue, 21 Nov 2006 07:05:09 -0500 (EST)
• References: <ejtdp7\$j4f\$1@smc.vnet.net>

```Hello.

It's not clear to me all the content of your post, so I concentrate

But first two things to notice.

Don't use special characters like greek capital omega in your posts.
You see how nasty they were appeared?
I was able to see the variables names after I read MathGroup mailing
list!

Also avoid to mix exact and inexact numbers; e.g. don't mix 2 with 0.5.

{Integer, Real}

InexactNumberQ /@ {2., N[Pi], Pi, E, N[E], 2 - 6.*I, 5/4, Gamma}
{True, True, False, False, True, True, False, False}

For the identities like Sin[a + b] = Sin[a] Cos[b] + Cos[a] Sin[b] you
use TrigExpand

TrigExpand /@ {Sin[a+ b], Sin[a - b], Cos[a + b], Cos[a-
b]}//ColumnForm

FrontEndExecute[{HelpBrowserLookup["MainBook", "3.3.7"]}]

For the identities 2Cos[a] =1/2+ 1/2Cos[2a] and Sin[a]= 1/2 -
1/2Cos[2a] you can define your own rules as follows:

trigrule1 = 2*Cos[x_] :> 1/2 + (1/2)*Cos[2*x];
trigrule2 = 2*Sin[x_] :> 1/2 - (1/2)*Cos[2*x];

Then

2*Cos[a] /. trigrule1
2*Sin[a] /. trigrule2
1/2 + (1/2)*Cos[2*a]
1/2 - (1/2)*Cos[2*a]

Regards
Dimitris

ali.abuelmaatti at elec.gla.ac.uk wrote:
> Hi all,
>
> I am trying to perform  the following operation:
>
> Let us assume I have a two-tone input to my system in the form
>
> x = A Sin[&#937;1] + A Sin[&#937;2]
>
> and our system is nonlinear so it looks like this
>
> y = x + x2 + x3
>
> Now to substitute x (the input) into y (the system) I use the expand function as follows
>
> Expand [y]
>
> Out[1]= ASin[&#937;1] + A2Sin[&#937;1] 2 + A3 Sin[&#937;1]3 + A Sin[&#937;2] + 2A2 Sin[&#937;1] Sin[&#937;2] +  3A3 Sin[&#937;1]2 Sin[&#937;2] + A2 Sin[&#937;2]2 + 3A3 Sin[&#937;1] Sin[&#937;2]2 +  A3 Sin[&#937;2]3
>
> Now that is good as it is substituted properly but this is just direct substitution and it is not what I am looking for, I want to break all the high power terms on the Sin functions so I try using simplify as follows:
>
> Simplify[Out[1]]
>
> Out[2]= A (Sin[&#937;1] + Sin[&#937;2]) (1 + A2 Sin[&#937;1]2 + A Sin[&#937;2] + A2 Sin[&#937;2]2 + A Sin[&#937;1] (1 + 2A Sin[&#937;2]))
>
> Now it looks better but unfortunately it doesnÂ?t get a lot further than that.
>
> The question is, how can I persuade Mathematica to use some of the well known trigonometric functions for example:
>
> Sin[&#937;1+ &#937;2]=Sin[&#937;1] Cos[&#937;2] + Cos[&#937;1] Sin[&#937;2],
>
> Sin[&#937;1- &#937;2]=Sin[&#937;1] Cos[&#937;2] - Cos[&#937;1] Sin[&#937;2],
>
> Cos[&#937;1+ &#937;2]= Cos[&#937;1] Cos[&#937;2] - Sin[&#937;1] Sin[&#937;2],
>
> Cos[&#937;1- &#937;2]= Cos[&#937;1] Cos[&#937;2] + Sin[&#937;1] Sin[&#937;2],
>
> Cos[&#937;1]2=.5 + .5 Cos[2&#937;1]
>
> And
>
> Cos[&#937;1]2=.5 - .5 Cos[2&#937;1]
>
> To produce the terms that has [&#937;1+ &#937;2], [&#937;1+ &#937;2], [2&#937;1] or [2&#937;2]. These are the terms that I am most interested it which do come out of that non linear system when fed with a two-tone input.
>
> Which functions can I use to give me that, give me these Sin or Cos [&#937;1+ &#937;2], [&#937;1+ &#937;2], [2&#937;1] or [2&#937;2] terms?
>
>
> Ali
>
>
> Link to the forum page for this post:
> http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Special:Forum_ViewTopic&pid=15508#p15508
> Posted through http://www.mathematica-users.org [[postId=15508]]

```

• Prev by Date: Re: Best practice for naming of options
• Next by Date: Re: Converting an expression to a list of terms?
• Previous by thread: Re: General--Trigonometric functions manipulations in Mathematica
• Next by thread: Method option to Solve