Particle in a box

L = 1.; n =3.;
Plot [(2/L) (Sin [n Pi x / L])^2 , {x, 0, L},
Frame->True]

[Graphics:../HTMLFiles/MATH5_TUT1_603.gif]

-Graphics -

Integrate [(2/L) (Sin [2 Pi x / L])^2 , {x, 0, L/4}]

∫_0^L/42/L (Sin[(2 π x)/L])^2x

A 2-d box

DensityPlot[ (2/L) (Sin [2 Pi x / L])^2 (2/L) (Sin [2 Pi y / L])^2, {x, -2, 2}, {y, -2, 2}]

This is not a very helpful plot.  We may have to change two options: Plot Points and Mesh

figPB1 = DensityPlot[(2 Sin[(2 π x)/L]^2 2 Sin[(2 π y)/L]^2)/(L L), {x, -2, 2}, {y, -2, 2}, PlotPoints→500, Mesh→False]

You can modify the figure using the Show command

Show[figPB1,ColorFunction->(Hue[.5(1-#)]&)]

Show[figPB1,ColorFunction->(RGBColor[#,0,1-#]&)]

Another helpful plot is ContourPlot

figCP1 = ContourPlot[ Sin[x y], {x, - π,  π}, {y, - π,  π},PlotPoints->50]

You can modify the figure using the  Show command

Show[figCP1,ColorFunction->(RGBColor[1-#,#,#]&)]


Created by Mathematica  (September 7, 2006) Valid XHTML 1.1!