es[e1_, w2_, δx_, δy_, x_, y_] = e1*Exp[-((x - δx)^2 + (y - δy)^2)/w2^2];

el1[e2_, wl2_, x_, y_, t_] =  e2*Exp[-(x^2 + y^2)/wl2^2]*Exp[I*SawtoothWave[t]];

sum1[e1_Real, w2_Real, δx_Real, δy_Real, e2_Real, wl2_Real, t_Real] :=  NIntegrate[
  (Abs[es[e1, w2, δx, δy, x, y]  + el1[e2, wl2, x, y, t]])^2
, {x, 0, wl2}
, {y, -(wl2^2 - x^2)^0.5, (wl2^2 - x^2)^0.5}

    Plot[sum1[100, 0.00001, δx, 0, 100, 0.00001, t] 
      , {t, 0, 10}
  , {δx, 0, 1}

When I execute this code, the result of Manipulate[] is first shown as "Aborted". Sometime later a plot does show up, but it does not respond to changes in the parameter value, and the program runs really slow. What is wrong?


  • 3
    $\begingroup$ It just takes a lot of time to create such plot and DynamicEvaluationTimeout is by default 5 sec. Take a look at ControlActive and use it for MaxRecursion and PlotPoints of Plot. Additionally take a look at SynchronousUpdating -> False. $\endgroup$ – Kuba Jul 11 '17 at 18:03

Your Answer

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

Browse other questions tagged or ask your own question.