1
$\begingroup$

I have used below code to plot the solution of an integral, but the code doesn't return anything. Could somebody please help me in this regard?

a=0.1;     
Assuming[
      t \[Element] Reals, 
     Plot[Integrate[-Sin[tp] Exp[-((
          16 a  Cos[tp - 2 t + 3 Pi/2] Cos[
            2 tp])/((1 - a^2) \[Pi]))], {tp, 0, 2 Pi}], {t, 0, 2 Pi}]]
$\endgroup$
4
  • $\begingroup$ did you check before plotting if the integrate actually works and it produces solution? it might be that Mathematica could not integrate it. $\endgroup$
    – Nasser
    Dec 6, 2019 at 21:16
  • $\begingroup$ It doesn't work! @Nasser $\endgroup$
    – Marco
    Dec 6, 2019 at 21:17
  • $\begingroup$ Then this explains why the plot did not work. $\endgroup$
    – Nasser
    Dec 6, 2019 at 21:18
  • $\begingroup$ But there might be a way to make it work @Nasser $\endgroup$
    – Marco
    Dec 6, 2019 at 21:19

1 Answer 1

2
$\begingroup$

Integrate does not seem to be able to do it. Try NIntegate

ClearAll[t, tp, a];
a = 0.1;
tick = {Range[0, 2 Pi, Pi/2], Automatic};
foo[t_?NumericQ] := NIntegrate[-Sin[tp] Exp[-((16 a Cos[tp - 2 t + 3 Pi/2] 
      Cos[2 tp])/((1 - a^2) Pi))], {tp, 0, 2 Pi}]

Plot[foo[t], {t, 0, 2 Pi}, Ticks -> tick, GridLines -> tick, 
 GridLinesStyle -> LightGray, PlotStyle -> Red]

Mathematica graphics

$\endgroup$
7
  • $\begingroup$ what is foo[t_?NumericQ]? $\endgroup$
    – Marco
    Dec 6, 2019 at 21:26
  • $\begingroup$ @Marco just function name. change it to something else you prefer. $\endgroup$
    – Nasser
    Dec 6, 2019 at 21:27
  • $\begingroup$ Is it possible to plot a density plot with variables $a$ and $t$? $\endgroup$
    – Marco
    Dec 6, 2019 at 21:36
  • $\begingroup$ @Marco it is probably possible. Please post separate question and and make it clear what is it you are asking for, someone should be able to help. $\endgroup$
    – Nasser
    Dec 6, 2019 at 21:38
  • $\begingroup$ why is the argument of the function like this? t_?NumericQ $\endgroup$
    – Marco
    Dec 6, 2019 at 21:40

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.