I have a problem while generating particle in the box from this equation

Plot[Sqrt[2/L] Sin[n Pi x/L], {x, -L/2, L/2}]

because Mathematica might confuse about my parameter, how can I notice that L is a function of x?

I want my graph have two y axis as a boundary of the box.


closed as unclear what you're asking by m_goldberg, Mr.Wizard Jun 16 '16 at 12:47

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Try L = 1; psi[n_, x_] := Sqrt[2/L] Sin[n Pi x/L]; Plot[Evaluate[Table[psi[n, x]^2, {n, 1, 3}]], {x, 0, L}, Frame -> True, PlotLegends -> True] $\endgroup$ – Sumit Jun 16 '16 at 13:14

Arbitrary values for L and n

L = 100;
n = 0.2;

Define the function and plot (I assumed you wanted a Frame based on the "two y axis" comment).

f[x_] = Sqrt[2/L] Sin[n Pi x/L];
Plot[f[x], {x, -L/2, L/2}, Frame -> True, AxesStyle -> Directive[LightGray, Dashed]]

enter image description here


Not the answer you're looking for? Browse other questions tagged or ask your own question.