Unsure why Plot3D is empty? [closed]
Clash Royale CLAN TAG#URR8PPP
$begingroup$
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.
plotting
$endgroup$
closed as off-topic by Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg Feb 12 at 17:42
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg
add a comment |
$begingroup$
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.
plotting
$endgroup$
closed as off-topic by Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg Feb 12 at 17:42
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg
2
$begingroup$
What are the values forwdth
andhght
?
$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
Minor comment: parentheses around your functions are not wrong, but they are not necessary. That is, you can writeQn[n_] :=Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];
rather thanQn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];)
, for example.
$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39
add a comment |
$begingroup$
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.
plotting
$endgroup$
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.
plotting
plotting
asked Feb 12 at 14:20
Nathan MayesNathan Mayes
141
141
closed as off-topic by Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg Feb 12 at 17:42
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg
closed as off-topic by Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg Feb 12 at 17:42
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, zhk, Bob Hanlon, MarcoB, m_goldberg
2
$begingroup$
What are the values forwdth
andhght
?
$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
Minor comment: parentheses around your functions are not wrong, but they are not necessary. That is, you can writeQn[n_] :=Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];
rather thanQn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];)
, for example.
$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39
add a comment |
2
$begingroup$
What are the values forwdth
andhght
?
$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
Minor comment: parentheses around your functions are not wrong, but they are not necessary. That is, you can writeQn[n_] :=Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];
rather thanQn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];)
, for example.
$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39
2
2
$begingroup$
What are the values for
wdth
and hght
?$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
What are the values for
wdth
and hght
?$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
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.$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39
$begingroup$
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.$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
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]
- Use
Cos
notCos()
- Use
Exp
notExp()
- Do not use
)
after the semicolon use it before. - 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]
$endgroup$
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
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]
- Use
Cos
notCos()
- Use
Exp
notExp()
- Do not use
)
after the semicolon use it before. - 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]
$endgroup$
add a comment |
$begingroup$
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]
- Use
Cos
notCos()
- Use
Exp
notExp()
- Do not use
)
after the semicolon use it before. - 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]
$endgroup$
add a comment |
$begingroup$
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]
- Use
Cos
notCos()
- Use
Exp
notExp()
- Do not use
)
after the semicolon use it before. - 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]
$endgroup$
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]
- Use
Cos
notCos()
- Use
Exp
notExp()
- Do not use
)
after the semicolon use it before. - 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]
answered Feb 12 at 14:28
zhkzhk
9,69911433
9,69911433
add a comment |
add a comment |
2
$begingroup$
What are the values for
wdth
andhght
?$endgroup$
– zhk
Feb 12 at 14:22
$begingroup$
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 thanQn[n_] := (Sqrt[(b/lambda)^2 + (2*pi*n*b)^2];)
, for example.$endgroup$
– Alexei Boulbitch
Feb 12 at 14:39