0
$\begingroup$

I'm trying to Plot something relatively simple:

Manipulate[
 Plot[Ωm*E^(I*(J - Ωm)*t), {t, 0, 100}, 
  ImageSize -> Large], {J, 1, 100}, {Ωm, 10, 100}]

But Mathematica just returns a blank plot of the first quadrant. I figure that it might be because I'm using a complex exponential (although it's never been a problem before), but I just wanted to make sure

$\endgroup$
  • 3
    $\begingroup$ use Re[\[CapitalOmega]m*E^(I*(J - \[CapitalOmega]m)*t)] or Im[\[CapitalOmega]m*E^(I*(J - \[CapitalOmega]m)*t)] as the first argument in Plot? $\endgroup$ – kglr Jul 26 '18 at 17:25
  • $\begingroup$ Possible duplicate: mathematica.stackexchange.com/questions/3458/… $\endgroup$ – Michael E2 Jul 27 '18 at 18:08
4
$\begingroup$

Because you are trying to plot a complex number. You can separate Real and Imaginary parts with ReIm

Manipulate[
 Plot[
  Evaluate@ReIm[
    Ωm*E^(I*(J - Ωm)*t)
    ]
  , {t, 0, 100}
  , ImageSize -> Large
  , PlotRange -> {-102, 102}
  , PlotStyle -> Opacity[0.7]
  , PlotPoints -> 100
  , MaxRecursion -> 10
  , PlotLegends -> {Re, Im}
 ]
 , {{J, 49}, 1, 100, 1, Appearance -> "Labeled"}
 , {{Ωm, 50}, 10, 100, 1, Appearance -> "Labeled"}
 ]

enter image description here

$\endgroup$
  • $\begingroup$ @rhermans Many thanks $\endgroup$ – Brandon Jul 26 '18 at 18:11

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.