We consider a 3-D box of dimensions L. Inside the
box the potential is zero. Outside the box the potential is infinity.
Use the results of the example, The 1-D Infinite Square Well
With A Non-Zero Bottom and the lab An Infinite Square Well
With A Non-Zero Bottoms.
(You may need to FTP or move this useful.ma file to the Mathematica main directory first.)
Clear[L];
RealOnly[L];
RealOnly[x];
RealOnly[y];
RealOnly[z];
RealOnly[nx];
RealOnly[ny];
RealOnly[nz];
Clear[xmean];
RealOnly[xmean];
xmean[nx_,ny_,nz_,As_] : = Simplify[1/As^2 Integrate[
HC[psi[x,y,z,nx,ny,nz]] x psi[x,y,z,nx,ny,nz],{x,0,L},{y,0,L},{z,0,L}]]
Note that the "x" in the above line is 'not times' its 'multiply by x'. Why are we insisting that the expectation value of x be only real?
Save your work!
Please note: nx
= (1,2,...); nx = 0 is not state.
Analytically, on a slip of paper (preferably the
back of an envelope), agree upon the state function for a 3-D
box centered about x = L/2, y = L/2, and z = L/2. Remember
the 'separation of dimensions in DEs' discussion we participated
in.
Save your work!
norm = Simplify[Integrate[
HC[psi[x,y,z, 1,1,1]] psi[x,y, z, 1, 1, 1]
,{x,0,L},{y,0,L},{z,0,L}]]
Note that it is done explicitly for the state nx
= 1, ny = 1, nz = 1. This is for computational speed. If you
left the state as a general (without specifying the n's) Mathematica
would eventually compute it, but why wait? (If this doesn't not
give the right results, then define a function for As, which will
have input parameters of L and nx, ny, nz. )
Save your work!
Clear[psi2]
RealOnly[psi2];
As = 1/norm;
psi2[x_,y_,z_,nx_,ny_,nz_, norm_] : = As ...
Note that I put the variable norm = 1/(As) as computed
in a previous step.
Save your work!
Simplify[Integrate[ psi2[x,y,z,2,1,1,As],{x,0,L},{y,0,L},{z,0,L}]]
Also try it for one to two other states to be
certain that our normalization factor As isn't state-dependent.
DO THIS SECTION ONLY IF TIME ALLOWS ------------------------------------------------------------
Save your work!
END OF DO THIS SECTION ONLY IF TIME ALLOWS ---------------------------------------------------------
Save your work!
L = 10;
Plot[ { psi2[x,L/2,L/2,1,1,1,As],
psi2[x,L/2,L/2,2,1,1,As],
psi2[x,L/2,L/2,3,1,1,As]},{x,0,L}]
Clear[L];
RealOnly[L];
L = 10;
PL1 = Plot3D[ psi2[x,y,L/2, 2,1,1,As], {x,0,L},{y,0,L}]
Clear[L];
RealOnly[L];
to plot the probability of finding the particle
at an x and y position from 0 to L (and z at L/2), with L = 10
for state(2,1,1). Note that the plot's directives are saved in
variable "PL1".
Show[PL1,ViewPoint->{5.657,0.000,1.250}]
will redraw the plot (saved as "PL1") in step 20 at a different orientation. Try it.
Show[PL1,ViewPoint->{5.657,0.000,1.250}]
Show[PL1,ViewPoint->{5.137,2.368,1.250}]
Show[PL1,ViewPoint->{2.686,4.978,1.250}]
Show[PL1,ViewPoint->{0.133,5.655,1.250}]
Show[PL1,ViewPoint->{-2.528,5.060,1.250}]
Show[PL1,ViewPoint->{-5.209,2.206,1.250}]
Show[PL1,ViewPoint->{-5.337,-1.874,1.250}]
Show[PL1,ViewPoint->{-4.273,-3.708,1.250}]
Show[PL1,ViewPoint->{-2.608,-5.020,1.250}]
Show[PL1,ViewPoint->{-0.222,-5.652,1.250}]
Show[PL1,ViewPoint->{2.206,-5.209,1.250}]
Show[PL1,ViewPoint->{4.214,-3.774,1.250}]
To save space, you might want to remove the cell you executed in step 0. Before proceeding, save your notebook! Execute the cell above. When its complete, you should have a dozen plots. Highlight all the cells (from the blue cell bar at the right) containing these plots. Press the animate button! It was worth the effort. If you think this is cool, just wait!
The next several steps are an attempt to create a scatter plot of the probability versus 3D space. The plot will indicate high probability of the particle's location with a high density of dots and a low probability with a low density of dots. We will use this code again, slightly modified, in studying the electron probability clouds for a hydrogen atom. The plot requires a module called 'SctrPlot.ma' and some preparation.
Clear[ psi]
psi2[x_,y_, z_, nx_, ny_, nz_]:=
N[ ...your old code for psi goes here... ]
Before you continue, call me over and show me that
a cell like the one below returns a numerical value:
psi2[ .3 L, .3 L, .3 L, 1, 1, 1]
Save your work!
<<Sctrplot.ma
From the documentation for SctrPlot:
ScatterPlot -- a module which takes a function psi2[x,y,x,nx,ny,nz,A]
and creates an array of points with the highest density of points
where psi2 is large in a space [x,y,z]. psi2 is suppose to represent
a wavefunction^.
Syntax: ScatterPlot[nx, ny, nz, MinL, MaxL, maxintervals,
maxloops, maxinlastrange]
nx,ny,nz are for the quantum
numbers
minL and maxL are
the expected boundaries of the plot. L could is the effective
dimensions of the box, or just the min and max values for the
plot.
maxintervals is used only
for finding the maximum value of the psi2 function. Choose it
to be the smallest you can, but it the derivative is big it stops,
you may need to make larger. Suggested range: 100 to 1000.
maxloops = the max number
of loops try 5K for fast & dirty, but you may need more depending
on your setting for
maxinlastrange which the
factor that determines the accuracy. If maxloops is too
small, you may get a message the maxinlastrange to too
small. Essentially this parameter puts this number of points
where they have a probability from 0.9 to 1.0. Speed is slow
id you have a large number for this parameter, but if it is too
small, much detail in the picture will be lost.
stcplt = ScatterPlot[1,1,1,0,L,2,10000,100];
Once you have been able to successfully execute the
above cell, try for a more accurate computation by editing the
cell so it looks like this:
stcplt = ScatterPlot[1,1,1,0,L,2,10000,1000];
Save your work!
I haven't tried increasing maxinlastrange
larger than 1000. Maybe you should try 5000
and increase maxloops accordingly.
Finally, we should look at all the plots and try to understand what they are tell us. Be certain you write a paragraph concerning our discussion in you report.