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


Groups > comp.soft-sys.math.mathematica > #1555 > unrolled thread

Re: Coefficents of terms in an expression containing the matching string

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-04-09 11:12 +0000
Last post2011-04-09 11:12 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Coefficents of terms in an expression containing the matching string DrMajorBob <btreat1@austin.rr.com> - 2011-04-09 11:12 +0000

#1555 — Re: Coefficents of terms in an expression containing the matching string

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-04-09 11:12 +0000
SubjectRe: Coefficents of terms in an expression containing the matching string
Message-ID<inpevb$8ve$1@smc.vnet.net>
"Id 3" probably should be "I d3", as well.

Bobby

On Fri, 08 Apr 2011 03:15:06 -0500, Bob Hanlon <hanlonr@cox.net> wrote:

>
> Use proper Mathematica syntax when writing to the group.
>
> y = 0.5*u*Exp[-2 I d1 - d2 - I d4 - phi] -
>    0.5*k2*k3*u*Exp[-I d2 - I d4 - phi] -
>    0.5*k2*k4*u*Exp[-I d2 - Id 3 - I phi];
>
> List @@ y /. Exp[_] -> 1
>
> {0.5 u, -0.5 k2 k3 u, -0.5 k2 k4 u}
>
> If you really want to lose the signs then
>
> List @@ y /. {Exp[_] -> 1, x_?Negative -> -x}
>
> {0.5 u, 0.5 k2 k3 u, 0.5 k2 k4 u}
>
> y = 0.5*u*Exp[-2 I d1 - d2 - I d4 - phi] -
>    0.5*k2^2*k3*u*Exp[-I d2 - I d4 - phi] -
>    0.5*k2*k4*u*Exp[-I d2 - Id 3 - I phi] -
>    0.5*k2^2*k5*v*Exp[-I d2 - Id 3 - I phi];
>
> Select[y, ! FreeQ[#, k2^2] &]
>
> -0.5*E^((-I)*d2 - I*d4 - phi)*k2^2*k3*u -
>  0.5*E^((-I)*d2 - 3*Id - I*phi)*k2^2*k5*v
>
>
> Bob Hanlon
>
> ---- Chelly <chelly85086@gmail.com> wrote:
>
> =============
> I have two questions. The solutions may be very simple, but since I am a  
> Mathematica novice, need some guidance.
> 1) I have an expression:
> y = 0.5*u*exp(-2 I d1 - d2 - I d4 - phi) -
>      0.5*k2*k3*u*exp(-I d2 - I d4 - phi) -
>      0.5*k2*k4*u*exp(-I d2 - Id 3 - I phi) ;
> What command should I use to get just the amplitude of each term, i.e  
> excluding the exponential - exp(). In this case, the results needs to be
> {0.5*u, 0.5*k2*k3*u, 0.5*k2*k4*u)
> 2) The second question is along similar lines. I have an expression and  
> I need to find out the terms that have k2^2 in the amplitude
> y = 0.5*u*exp(-2 I d1 - d2 - I d4 - phi) -
>      0.5*k2^2*k3*u*exp(-I d2 - I d4 - phi) -
>      0.5*k2*k4*u*exp(-I d2 - Id 3 - I phi)  -
>      0.5*k2^2*k5*v*exp(-I d2 - Id 3 - I phi) ;
> In this case, the answer is the second and last term:
> 0.5*k2^2*k3*u*exp(-I d2 - I d4 - phi) -
>   0.5*k2^2*k5*v*exp(-I d2 - Id 3 - I phi)
>
>
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web