Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1669 > unrolled thread
| Started by | Chelly <chelly85086@gmail.com> |
|---|---|
| First post | 2011-04-14 09:00 +0000 |
| Last post | 2011-04-16 11:34 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Trignometric rules Chelly <chelly85086@gmail.com> - 2011-04-14 09:00 +0000
Re: Trignometric rules Peter Pein <petsie@dordos.net> - 2011-04-15 07:56 +0000
Re: Trignometric rules Peter Pein <petsie@dordos.net> - 2011-04-16 11:34 +0000
| From | Chelly <chelly85086@gmail.com> |
|---|---|
| Date | 2011-04-14 09:00 +0000 |
| Subject | Trignometric rules |
| Message-ID | <io6d3h$drj$1@smc.vnet.net> |
I have an expression as hsown below
tt = -4 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[2 d1 + d2 + d3] -
2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] +
2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[
2 d1 + d2 + d3 - \[Phi]b - \[Phi]r] +
2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 Cos[
d1 + d3 + \[Phi]b + \[Phi]r] +
2 k1^2 u^2 \[Epsilon]1^2 Cos[2 d1 + d2 + d3 + \[Phi]b + \[Phi]r] -
2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[
2 d1 + d2 + d3 + \[Phi]b + \[Phi]r];
I'd like to replace any term containing Cos[+/- phib + x_] with 2 Sin [+/-phib] Sin[x]. How do I go about doing it.
Thanks
Chelly
[toc] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2011-04-15 07:56 +0000 |
| Message-ID | <io8tn0$qam$1@smc.vnet.net> |
| In reply to | #1669 |
Am 14.04.2011 11:00, schrieb Chelly: > I have an expression as hsown below > > tt = -4 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[2 d1 + d2 + d3] - > 2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] + > 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ > 2 d1 + d2 + d3 - \[Phi]b - \[Phi]r] + > 2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 Cos[ > d1 + d3 + \[Phi]b + \[Phi]r] + > 2 k1^2 u^2 \[Epsilon]1^2 Cos[2 d1 + d2 + d3 + \[Phi]b + \[Phi]r] - > 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ > 2 d1 + d2 + d3 + \[Phi]b + \[Phi]r]; > > I'd like to replace any term containing Cos[+/- phib + x_] with 2 Sin [+/-phib] Sin[x]. How do I go about doing it. > > Thanks > Chelly > Hi Chelly, use pattern matching: tt /. Cos[pb:(s_. \[Phi]b /; Abs[s] == 1) + x_.] :> 2 Sin[pb] Sin[x] Peter
[toc] | [prev] | [next] | [standalone]
| From | Peter Pein <petsie@dordos.net> |
|---|---|
| Date | 2011-04-16 11:34 +0000 |
| Message-ID | <iobut1$bci$1@smc.vnet.net> |
| In reply to | #1698 |
Am 15.04.2011 09:56, schrieb Peter Pein: > Am 14.04.2011 11:00, schrieb Chelly: >> I have an expression as hsown below >> >> tt = -4 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[2 d1 + d2 + d3] - >> 2 k1 k2 u^2 \[Epsilon]1 Cos[d1 + d2 - \[Phi]b - \[Phi]r] + >> 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ >> 2 d1 + d2 + d3 - \[Phi]b - \[Phi]r] + >> 2 k1^3 k2 v^2 \[Epsilon]1^3 \[Epsilon]c^2 Cos[ >> d1 + d3 + \[Phi]b + \[Phi]r] + >> 2 k1^2 u^2 \[Epsilon]1^2 Cos[2 d1 + d2 + d3 + \[Phi]b + \[Phi]r] - >> 2 k1^2 v^2 \[Epsilon]1^2 \[Epsilon]c^2 Cos[ >> 2 d1 + d2 + d3 + \[Phi]b + \[Phi]r]; >> >> I'd like to replace any term containing Cos[+/- phib + x_] with 2 Sin [+/-phib] Sin[x]. How do I go about doing it. >> >> Thanks >> Chelly >> > > Hi Chelly, > > use pattern matching: > > tt /. Cos[pb:(s_. \[Phi]b /; Abs[s] == 1) + x_.] :> 2 Sin[pb] Sin[x] > > Peter > Oops! Of course: tt /. Cos[pb:(s_. \[Phi]b /; Abs[s] == 1) + x_.] :> 2 Sin[s pb] Sin[x] sorry, Peter
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web