# Unsure why Plot3D is empty? [closed]

I don't understand why my 3D Plot is empty so was looking for some advice. I have several functions defined, one of which is used in Plot3D, as seen below.

b = Sqrt[0.75];
L = b;
lambda = 1.11;
pi = 3.141592653589793;

Qn[n_] := (
Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];
)

V0[y_] := (
(Exp (b/lambda)/(Exp[b/lambda] - 1))*(Exp[-y/lambda] +
Exp[-(L - y)/lambda] + Exp[-(y + b/2)/lambda] +
Exp[-(L - y + b/2)/lambda]);
)

V[x_, y_] := (
b*pi*(V0[y] + Sum[Cos[2*pi*i*x]*((Exp[-L*Qn[i]/(2*b)]*
Cosh ((y - L/2)*(Qn[i]/b))/(Qn[i]*
Sinh[Qn[i]/2]))*(1 + (-1)^(i)*Exp[-Qn[i]/2])), {i, 3}]);
)

Plot3D[V[x, y], {x, 0, wdth}, {y, -hght, hght}]


and Mathematica just outputs an empty plot. Thanks in advance for any help, hopefully I have just missed something simple.

• What are the values for wdth and hght? – zhk Feb 12 '19 at 14:22
• Minor comment: parentheses around your functions are not wrong, but they are not necessary. That is, you can write Qn[n_] :=Sqrt[(b/lambda)^2 + (2*pi*n*b)^2]; rather than Qn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];), for example. – Alexei Boulbitch Feb 12 '19 at 14:39

wdth = 1;

hght = 1;

b = Sqrt[0.75];
L = b;
lambda = 1.11;
pi = 3.141592653589793;

Qn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2]);

V0[y_] := ((Exp [b/lambda]/(Exp[b/lambda] - 1))*(Exp[-y/lambda] +
Exp[-(L - y)/lambda] + Exp[-(y + b/2)/lambda] +
Exp[-(L - y + b/2)/lambda]));

V[x_, y_] := (b*
pi*(V0[y] +
Sum[Cos[2*pi*i*
x]*((Exp[-L*Qn[i]/(2*b)]*
Cosh [(y - L/2)*(Qn[i]/b)]/(Qn[i]*
Sinh[Qn[i]/2]))*(1 + (-1)^(i)*Exp[-Qn[i]/2])), {i,
3}]));

Plot3D[V[x, y], {x, 0, wdth}, {y, -hght, hght}]


1. Use Cos[] not Cos()
2. Use Exp[] not Exp()
3. Do not use ) after the semicolon use it before.
4. The best way to debunk your code is to try give a numerical value to your functions, i.e., Qn[1], V0[1], V[1,1]