Ask Your Question
1

Factoring out complex exponentials

asked 2017-02-09 04:42:46 +0200

NahsiN gravatar image

updated 2017-02-09 04:43:48 +0200

Hi, If I have an expression as follows $\frac{3}{8} {{E}_y^-}^{2} \overline{{E_y^+}} e^{\left(i \omega t + 3 i k x\right)} + \frac{3}{8} \, {{E}_y^-}^{2} \overline{{{E}_y^-}} e^{\left(i \omega t + i k x\right)} + \frac{3}{4} \, {{E}_y^-} {E_y^+} \overline{{E_y^+}} e^{\left(i \, \omega t + i \, k x\right)} + \frac{3}{4} \, {{E}_y^-} {E_y^+} \overline{{{E}_y^-}} e^{\left(i \omega t - i k x\right)} + \frac{3}{8} \, {E_y^+}^{2} \overline{{E_y^+}} e^{\left(i \, \omega t - i \, k x\right)} + \frac{3}{8} \, {E_y^+}^{2} \overline{{{E}_y^-}} e^{\left(i \omega t - 3 i k x\right)}$

How do I factor out a complex exponential $e^{i\omega t - ikx}$ from the expression above using a command?

edit retag flag offensive close merge delete

Comments

Maybe: fc = e^(i*omega*t - i*k*x); f = ((f/fc).expand())*fc; f

mforets gravatar imagemforets ( 2017-02-09 13:41:26 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-11 20:24:19 +0200

mforets gravatar image

updated 2017-02-11 20:26:46 +0200

An example:

Let $$ f = a e^{\left(i \omega t + 3 i k x\right)} + b_{1} e^{\left(i \omega t + i k x\right)} + b_{2} e^{\left(i \omega t + i k x\right)} + c_{1} e^{\left(i \omega t - i k x\right)} + c_{2} e^{\left(i \omega t - i k x\right)} + d e^{\left(i \omega t - 3 i k x\right)}. $$ Then

var('omega t k x a b1 b2 c1 c2 d ')
f = a*exp(I*omega*t+3*I*k*x) + b1*exp(I*omega*t+I*k*x) + b2*exp(I*omega*t+I*k*x) + c1*exp(I*omega*t-I*k*x) + c2*exp(I*omega*t-I*k*x) + d*exp(I*omega*t-3*I*k*x) 
fc = exp(I*omega*t-I*k*x)
g = ((f/fc).expand())*fc

produces $$ g = \left(a e^{\left(4 i k x\right)} + b_{1} e^{\left(2 i k x\right)} + b_{2} e^{\left(2 i k x\right)} + d e^{\left(-2 i k x\right)} + c_{1} + c_{2}\right) e^{\left(i \omega t - i k x\right)}, $$ and we can recover the term inside the parentheses with g.operands()[0].

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-09 04:42:46 +0200

Seen: 444 times

Last updated: Feb 11 '17