# No plot showing [closed]

When I execute the following code, Mathematica returns a blank plot. What is the problem?

es[e1_, w2_, δx_, δy_, x_, y_] =
e1*Exp[-((x - δx)^2 + (y - δy)^2)/w2^2]*Exp[I*ω*t];
el1[e2_, wl2_, x_, y_, t_, β_, Ω_] =
e2*Exp[-(x^2 + y^2)/wl2^2]*Exp[I*β*Sin[Ω*t]]*Exp[I*ω*t];

sum[e1_Real, w2_Real, δx_Real, δy_Real, e2_Real,
wl2_Real, t_Real, r_real, β_Real, Ω_Real] :=
NIntegrate[(Abs[es[e1, w2, δx, δy, x, y] +
el1[e2, wl2, x, y, t, β, Ω]])^2, {x, 0, r}, {y, -(r^2 - x^2)^0.5, (r^2 - x^2)^0.5}];
Plot[sum[3, 0.00015, 0, 0, 100, 0.00015, t, 0.005, 0, 0], {t, 0, 1}]

• There is a mistake in one of the arguments of sum, it should be r_Real. Also, in the plot you call sum with Integer arguments. Make it real by adding a . next to the integer. There is an undefined variable $\omega$ in the definitions of es and es11. – Anjan Kumar Jul 14 '17 at 7:38
• I recommend that you use the form e1_?NumericQ NumericQ encompasses Reals, Integers, Rationals, Complexes, and numeric constants (e.g., E, Pi). – Bob Hanlon Jul 16 '17 at 5:14

There are a fearful number of syntax errors in your code. Here is your code corrected for those errors.

Clear[es, el1]
es[e1_, w2_, δx_, δy_, x_, y_, t_, Ω_] :=
e1*Exp[-((x - δx)^2 + (y - δy)^2)/w2^2]*Exp[I*Ω*t]
el1[e2_, wl2_, x_, y_, t_, β_, Ω_] :=
e2*Exp[-(x^2 + y^2)/wl2^2]*Exp[I*β*Sin[Ω*t]]*Exp[I*Ω*t]
Clear[sum]
sum[e1_Real, w2_Real, δx_Real, δy_Real, e2_Real,
wl2_Real, t_Real, r_Real, β_Real, Ω_Real] :=
NIntegrate[
(Abs[es[e1, w2, δx, δy, x, y, t, Ω] + el1[e2, wl2, x, y, t, β, Ω]])^2,
{x, 0, r}, {y, -(r^2 - x^2)^0.5, (r^2 - x^2)^0.5}]

Plot[sum[3, 0.00015, 0., 0., 100., 0.00015, t, 0.005, 0., 0.], {t, 0., 1.}]