0
$\begingroup$

I have a function defined as follows:

g[θ_] := 1/k (Exp[-I δ0] Sin[δ0] + 3 Exp[I δ1] Sin[δ1 Cos[θ] + 
            5/2 Exp[I δ2 (3 (Cos[θ])^2 - 1))

and I compute the product of g with its complex conjugate as follows:

f[θ] Conjugate[f[θ]]

which gives me:

4.18986*10^-30 ((0.453154 - 0.288691 I) + (0.443562 - 0.0670825 I) Conjugate[Cos[θ]] + 
 (2.49994 - 0.0174532 I) (-1 + 3 Conjugate[Cos[θ]]^2)) ((0.453154 + 0.288691 I) + 
  (0.443562 + 0.0670825 I) Cos[θ] + (2.49994 + 0.0174532 I) (-1 + 3 Cos[θ]^2))

However I want theta to be real so that Conjugate[Cos[θ]] is just Cos[θ] and likewise for Conjugate[Cos[θ]]^2.

How can I do this?

EDIT

I should say my end goal is to plot and integrate the product of g with its product. I've tried what Rashid Zia suggested like so:

Plot[
 Simplify[g[θ] Conjugate[g[θ]], θ ∈ Reals], {θ, 0, 2 Pi}, 
 AxesLabel -> {rad, m^2/sr}
]

but the plot doesn't look like what I'm told it should, and the integral:

Integrate[2 Pi Simplify[g[θ] Conjugate[g[θ]], θ ∈ Reals], {θ, 0, Pi}]

doesn't seem to return the expected value.

Is there something I am missing here?

$\endgroup$
  • $\begingroup$ The parentheses and brackets are not balanced in the definition of g[θ]. Please correct the definition. Also, f[θ] Conjugate[f[θ]] should read g[θ] Conjugate[g[θ]] $\endgroup$ – Bob Hanlon Apr 21 '16 at 4:08
  • $\begingroup$ If all the parameters are real, just use ComplexExpand. $\endgroup$ – murray Apr 21 '16 at 14:59
2
$\begingroup$

You can use Simplify with the assumption that θ is an element of the Reals.

f = Conjugate[Cos[θ]]
Simplify[f, θ ∈ Reals]
$\endgroup$
  • 1
    $\begingroup$ Note that using things like Simplify may perform manipulations you do not want, like replacing x^2 + 2 x y + y^2 with (x+y)^2. The minimal method is to use Refine as so: Refine[Conjugate[a+I b], θ ∈ Reals]. Also, in place of the assumption θ ∈ Reals you can use the assumption _Symbol ∈ Reals to assume that all explicit variables are real. This allows you to encapsulate this in a function without having to manually pass a list of arguments. For an exhaustive discussion, see here. $\endgroup$ – Jess Riedel Sep 27 '17 at 19:01
  • $\begingroup$ Thanks @JessRiedel. I appreciate the suggestions and great linked discussion. $\endgroup$ – Rashid Oct 3 '17 at 17:52
1
$\begingroup$

If your aim is numerical and graphical I would not "worry" about the cosmetics of the form. In the following I have made k=1 (no values for $\delta$'s given). to avoid numerical problems just due to extreme scales (v precision). I have tried to "correct" the unbalanced parentheses referred to by Bob Hanlon. I may have made an error. If so, I apologize:

fun[δ0_Real, δ1_Real, δ2_Real, θ_,k_Real] := 
  ExpToTrig[
   1/k (Exp[-I δ0] Sin[δ0] + 
      3 Exp[I δ1] Sin[δ1 ] Cos[θ] + 
      5/2 Exp[I δ2 ] (3 (Cos[θ])^2 - 1))];
g[r_, s_, t_, u_, v_] := 
 Chop[fun[r, s, t, u, v] Conjugate[fun[r, s, t, u, v]]]

enter image description here

I hope this be a kick start to the desired result. Apologies for any misunderstanding on my part.

$\endgroup$
0
$\begingroup$

You could also use

gc=Conjugate[g[θ]]/.Conjugate[cos_Cos]->cos

and h=g*gc and use h as the integrand or plotted function. One should avoid calling Simplify inside Plot or Integrate because this will be much slower than necessary.

Also, your integrand contains a factor 10^-30. So it is practically zero and nothing is plotted and the integral is zero.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.