CH02.2

In[1]:=
H*WE FIRST NORMALIZE Y@x,0D=f@xD=A*x*Hx-aL.*L
In[2]:=
f@x_, A_, a_D := A * x * Hx - aL
In[3]:=
Integrate@Abs@f@x, A, aDD ^ 2, 8x, 0, a<, Assumptions Ø 8A > 0, a > 0<D
a5 A 2
Out[3]=
In[4]:=
30
H*Without loss of generality we assume a and A to be real positive numbers
using Assumptions. This constant must be "1" so that means, solving for A.*L
In[5]:=
In[6]:=
Out[6]=
Solve@Ha ^ 5 A ^ 2L ê 30 ã 1, AD
::A Ø -
30
a5ê2
>, :A Ø
30
a5ê2
>>
In[7]:=
H*We choose the + root.*L
In[8]:=
A=
30
5ê2
a
30
Out[8]=
a
In[9]:=
5ê2
H*The normalized initial wavefunction is then Y@x,0D=f@xD=
30
a5ê2
*x*Hx-aL. Let's check.*L
In[10]:=
Integrate@Abs@f@x, A, aDD ^ 2, 8x, 0, a<, Assumptions Ø 8A > 0, a > 0<D
Out[10]=
1
In[11]:=
H*The integral now uses our definition of A and so we are normalized.*L
In[12]:=
H*We now must compute the coefficients cn = <yn HxL Y@x,0D>:=<yn HxL f@xDD> as follows:*L
In[13]:=
f@x_, a_D :=
30
5ê2
* x * Hx - aL
a
In[14]:=
y@x_, n_, a_D := Sqrt@2 ê aD * Sin@n * Pi * x ê aD
In[15]:=
H*The expression <yn HxL f@xDD> becomes the integral Ÿ yn* HxL•fHxL„x.*L
In[16]:=
Integrate@Conjugate@y@x, n, aDD * f@x, aD, 8x, 0, a<, Assumptions Ø 8n > 0, a > 0<D
2
Out[16]=
In[17]:=
15 H- 2 + 2 Cos@n pD + n p Sin@n pDL
n 3 p3
H*The AssumptionsØ8n>0,a>0< tells it to treat n and a as positive REAL numbers
so that the Conjugate works out. Otherwise it assumes n and a are possibly
complex and will give no answer. We can simplify this further by specifying
that n is a positive INTEGER. See "assumptions" in the mathematica help.*L
2
EX02.2.nb
In[18]:=
FullSimplifyB
15 H- 2 + 2 Cos@n pD + n p Sin@n pDL
2
n3 p 3
, Assumptions Ø 8n œ Integers && n > 0<F
15 H- 1 + H- 1Ln L
4
Out[18]=
n3 p3
In[19]:=
H*This is the expression in the book for cn and in notes if we
realize that H-1+H-1Ln L is zero when n is even and 2 when n is odd.*L
In[20]:=
H*We now will plot the probability density r@x,tD:=
Y* @x,tD•Y@x,tD as a function of time t. To do this we cannot take the sums to
infinity so we truncate them. Using the rescaled formula in the notes with a=
1 and En =n2 p2 we may write our formulat for Y@x,tD in the notes as:*L
In[21]:=
Y@x_, t_, lmax_D := 8 * Sqrt@30D ê Pi ^ 3 *
Sum@Sin@H2 l + 1L * Pi * xD * Exp@- I * H2 l + 1L ^ 2 * Pi ^ 2 * tD ê H2 * l + 1L ^ 3, 8l, 0, lmax<D
In[22]:=
H*Let's look at first three terms:*L
In[23]:=
Y@x, t, 3D
1
Out[23]=
p3
8
30
‰-Â p
2
t
1
Sin@p xD +
27
‰-9 Â p
2
t
1
Sin@3 p xD +
125
‰-25 Â p
2
t
1
Sin@5 p xD +
343
‰-49 Â p
2
t
Sin@7 p xD
In[24]:=
H*Similarly changin i Ø -i we get:*L
In[25]:=
Y* @x_, t_, mmax_D := 8 * Sqrt@30D ê Pi ^ 3 *
Sum@Sin@H2 m + 1L * Pi * xD * Exp@+ I * H2 m + 1L ^ 2 * Pi ^ 2 * tD ê H2 * m + 1L ^ 3, 8m, 0, mmax<D
In[26]:=
In[27]:=
H*It is important to use different dummy variables l and m in the
two sums when multiplying them together to get the correct answer.*L
Y* @x, t, 3D
1
Out[27]=
p
3
8
30
‰Â p
2
t
1
Sin@p xD +
27
‰9 Â p
2
t
Sin@3 p xD +
1
125
‰25 Â p
2
t
Sin@5 p xD +
In[28]:=
H*The probability density is:*L
In[29]:=
FullSimplify@Y* @x, t, 3D * Y@x, t, 3D, Assumptions Ø 8x > 0, t > 0<D
1
Out[29]=
p
6
1920 ‰-Â p
‰Â p
In[30]:=
2
t
2
t
Sin@p xD +
Sin@p xD +
1
27
1
27
‰9 Â p
2
t
‰-9 Â p
2
t
Sin@3 p xD +
Sin@3 p xD +
1
125
1
125
‰25 Â p
2
t
‰-25 Â p
2
t
Sin@5 p xD +
Sin@5 p xD +
1
343
1
343
1
343
‰49 Â p
2
t
‰49 Â p
2
t
Sin@7 p xD
2
t
‰-49 Â p
Sin@7 p xD
Sin@7 p xD
H*This expression is real. To see that we use ComplexExpand to kill off the i's*L
EX02.2.nb
In[31]:=
ComplexExpand@FullSimplify@Y* @x, t, 3D * Y@x, t, 3D, Assumptions Ø 8x > 0, t > 0<DD
2
2
1920 CosAp2 tE Sin@p xD2
Out[31]=
1920 SinAp2 tE Sin@p xD2
+
p6
p6
2
640 SinA9 p2 tE Sin@3 p xD2
2
+
243 p6
768 CosAp2 tE CosA25 p2 tE Sin@p xD Sin@5 p xD
+
256 CosA9 p2 tE CosA25 p2 tE Sin@3 p xD Sin@5 p xD
+
25 p6
2
384 CosA25 p2 tE Sin@5 p xD2
+
225 p6
2
384 SinA25 p2 tE Sin@5 p xD2
+
225 p6
256 SinA9 p2 tE SinA25 p2 tE Sin@3 p xD Sin@5 p xD
+
3125 p6
3840 CosAp2 tE CosA49 p2 tE Sin@p xD Sin@7 p xD
+
3125 p6
+
25 p6
768 SinAp2 tE SinA25 p2 tE Sin@p xD Sin@5 p xD
+
343 p6
3840 SinAp2 tE SinA49 p2 tE Sin@p xD Sin@7 p xD
1280 CosA9 p2 tE CosA49 p2 tE Sin@3 p xD Sin@7 p xD
+
343 p6
3087 p6
1280 SinA9 p2 tE SinA49 p2 tE Sin@3 p xD Sin@7 p xD
+
3087 p6
768 CosA25 p2 tE CosA49 p2 tE Sin@5 p xD Sin@7 p xD
+
8575 p6
768 SinA25 p2 tE SinA49 p2 tE Sin@5 p xD Sin@7 p xD
+
8575 p6
2
2
1920 CosA49 p2 tE Sin@7 p xD2
117 649 p6
+
9 p6
640 CosA9 p2 tE Sin@3 p xD2
+
9 p6
243 p6
1280 CosAp2 tE CosA9 p2 tE Sin@p xD Sin@3 p xD
+
1280 SinAp2 tE SinA9 p2 tE Sin@p xD Sin@3 p xD
In[32]:=
3
1920 SinA49 p2 tE Sin@7 p xD2
+
117 649 p6
H*This is a mess but at least it is real -- all the i's are gone. It
is better to just plot this. Let's define the probability density:*L
In[33]:=
r@x_, t_, lmax_, mmax_D := Y* @x, t, mmaxD * Y@x, t, lmaxD
In[34]:=
H*Let us check at t=0 where we know the answer:*L
+
4
EX02.2.nb
In[35]:=
Plot@r@x, 0, 3, 3D, 8x, 0, 1<, AxesLabel Ø 8x, r<D
r
1.5
Out[35]= 1.0
0.5
0.2
In[36]:=
In[37]:=
0.4
0.6
0.8
1.0
x
H*This is approximately the plot of Y@x,0D 2
in figure 2.3. In figure 2.3 the plot Y@x,0D which goes to zero at x=
0 and x=a=1 and peaks at Aa2 ë4. For a = 1 that is...*L
A * a2 ë 4 ê. a Ø 1
15
2
Out[37]=
In[38]:=
2
H*The ê.aØ1 evaluates the expression at a=1. The numerical value is:*L
15
2
F
In[39]:=
NB
Out[39]=
1.36931
In[40]:=
H*Our curve should peak at the square of this:*L
In[41]:=
H1.3693063937629153L ^ 2
Out[41]=
1.875
In[42]:=
H*That is where the peak of our curve is:*L
2
EX02.2.nb
In[43]:=
Plot@8r@x, 0, 3, 3D, 1.875<, 8x, 0, 1<, AxesLabel Ø 8x, r<D
r
1.5
Out[43]= 1.0
0.5
0.2
0.4
0.6
0.8
1.0
x
In[44]:=
H*This plots the function r@x,0,3,3D and g@xD=
1.875 on the same curve. This is only an approximation to the actual function since
we take mmax = lmax = 3 << Infinity! Let us check normalization anyway...*L
In[45]:=
NIntegrate@r@x, 0, 3, 3D, 8x, 0, 1<D
Out[45]=
0.999997
In[46]:=
H*NIntegrate performs a numerical integration instead of an exact
integration. This should be 1.0000 -- Pretty good! Now let us put in
the time dependence with an animation using the Manipulate command...*L
In[47]:=
Manipulate@Plot@8r@x, t, 3, 3D, 1.875<, 8x, 0, 1<D, 8t, 0, 1<D
t
1.5
Out[47]=
1.0
0.5
0.2
In[48]:=
0.4
0.6
0.8
1.0
H*Grab the blue dot and slide it to see how the probability changes in time. All
the way to the left is t=0 and to the right is t=1. We can even animate it.L
5
6
EX02.2.nb
In[48]:=
Animate@Plot@8r@x, t, 10, 10D, 1.875<, 8x, 0, 1<, AxesLabel Ø 8x, r<D, 8t, 0, 1<D
t
r
2.0
Out[48]=
1.5
1.0
0.5
0.2
In[49]:=
0.4
0.6
0.8
1.0
x
H*To keep the vertical axis from shifting up and down like that use PlotRange*L
EX02.2.nb
In[50]:=
Animate@Plot@8r@x, t, 10, 10D, 1.875<,
8x, 0, 1<, PlotRange Ø 80, 2.2<, AxesLabel Ø 8x, r<D, 8t, 0, 1<D
t
r
2.0
Out[50]=
1.5
1.0
0.5
0.0
0.2
0.4
0.6
0.8
1.0
x
7
8
EX02.2.nb
H*This is the probability of finding the particle inside the box
as a function of x and t. The particle spends most of its time near the
middle of the box but is never found at the walls where x=0 and x=1.
If it never touches the walls ... how the
heck does it even know it is inside the box to begin with???
Note that the peak goes above 1.875 but the wings go down
to compensate so the area under the curve remains a constant "1".*L
In[1]:=
H*From Ex.2.2 the normalized wavefunction at time t=0 is Y@x,0D=f@xD=
In[2]:=
f@x_, a_D :=
In[3]:=
H*Check for typos:*L
In[4]:=
f@x, aD
30
a5ê2
30
a5ê2
*x*Ha-xL.*L
* x * Ha - xL
30 Ha - xL x
Out[4]=
In[5]:=
a5ê2
H*The general time dependent solution is, from Ex.2.2,
-iEn tê—
Y@x,tD=⁄¶
. Let's construct this piece by piece.*L
n=1 cn •yn HxL•e
In[6]:=
c@{_D := 8 * Sqrt@15D ê HPi * H2 * { + 1LL ^ 3
In[7]:=
c@{D
8
Out[7]=
In[8]:=
In[9]:=
In[10]:=
Out[10]=
In[11]:=
15
p3 H1 + 2 {L3
H*We have changed n=2{+1 to account for the fact that
only the odd n are nonzero. This automatically does this as 2{+1 = 1,
3, 5, ... as { = 0,1, 2, etc. From equation 2.27 in book:*L
erg@{_D := H2 * { + 1L ^ 2 * Pi ^ 2 * h ^ 2 ê H2 * m * a ^ 2L
erg@{D
p2 h2 H1 + 2 {L2
2 a2 m
H*I use erg@{D instead of E@{D since E is reserved as the exponential function and gives an
error. Avoid capital letters in defined functions to avoid such conflicts with defined
Mathematica symbols which always begin with an capital letters. Note I only have
to define { as the variable as all the other symbols are constants. From Eq.2.28:*L
In[12]:=
y@x_, {_D := Sqrt@2 ê aD * Sin@Pi * H2 { + 1L * x ê aD
In[13]:=
y@x, {D
Out[13]=
2
1
a
SinB
p x H1 + 2 {L
a
F
In[14]:=
H*Now we are ready to work out the example 2.3. The
probablity that Y@x,0D is in the state y1 HxL with energy E1 or in:*L
In[15]:=
y@x, 0D
Out[15]=
In[16]:=
2
1
a
SinB
px
a
F
H*...with energy ...*L
2
EX02.3.nb
In[17]:=
Out[17]=
erg@0D
p2 h2
2 a2 m
In[18]:=
H*Note I have to use {=0 to get n=1. This probablity is
In[19]:=
Abs@c@0DD ^ 2
c1
2
or:*L
960
Out[19]=
p6
In[20]:=
H*My lucky number! To get a numerial result use the N function:*L
In[21]:=
NB
Out[21]=
0.998555
In[22]:=
960
p6
F
H*The answer in the book. We now check normalization of the c's...that is ⁄¶
n=1
cn 2 =1? Again n=1,3,5, becomes {=0,1,2,... M
In[22]:=
Sum@Abs@c@{DD ^ 2, 8{, 0, Infinity<D
Out[22]=
1
In[23]:=
H*We can check the funny infinite sum directly to agree with Schaum's Outline:*L
In[24]:=
Sum@1 ê H2 { + 1L ^ 6, 8{, 0, Infinity<D
p6
Out[24]=
960
In[25]:=
H*Now lets find the probability the state is not in n=
1. That means it is in state 3 or 5 or ... this is ⁄¶
n=2
cn 2 where the sum starts at 2 but all the evens are zero.*L
In[26]:=
Sum@Abs@c@{DD ^ 2, 8{, 1, Infinity<D
- 960 + p6
Out[26]=
p6
- 960 + p6
F
In[27]:=
NB
Out[27]=
0.00144499
In[28]:=
H*This agrees with what I got by hand. Now since the probablity that Y@x,0D
is in the state y1 HxL with energy E1 is nearly 100% the two functions should
look almost the same. Let us check. First I will define y1 HxL from above as:*L
In[29]:=
y1 @x_, a_D :=
p6
2
1
a
SinB
px
a
F
EX02.3.nb
In[30]:=
Out[30]=
y1 @x, aD
2
1
a
SinB
px
a
F
In[31]:=
H*Recall we named Y@x,0D=f@xD for short. Taking a=1 for the plot:*L
In[32]:=
Plot@8f@x, 1D, y1 @x, 1D<, 8x, 0, 1<D
1.4
1.2
1.0
0.8
Out[32]=
0.6
0.4
0.2
0.2
0.4
0.6
0.8
1.0
In[33]:=
H*There is about 99% overlap! Now we compute the average energy of Y@x,0D or expectation
2
of H using Eq.2.39: <H>=⁄¶
En . Again we must use n=2{+1 and sum from {=
n=1 cn
0 to {=¶ to pick up just the odd terms as all the even terms are zero.*L
In[34]:=
Sum@Abs@c@{DD ^ 2 * erg@{D, 8{, 0, Infinity<D
Out[34]=
5 h2
a2 m
In[35]:=
H*Answer in book and done by hand in notes.* Now we compute <H2 >=⁄¶
n=1 cn
In[36]:=
Sum@Abs@c@{DD ^ 2 * erg@{D ^ 2, 8{, 0, Infinity<D
Out[36]=
30 h4
a4 m 2
In[37]:=
H*This agrees with the notes. We get sE2 =<H2 >-<H>2 as:*L
In[38]:=
sigmaeesquared =
Out[38]=
In[39]:=
Out[39]=
In[40]:=
30 h4
a4 m 2
-
5 h2
a2 m
^2
5 h4
a4 m 2
sigmaee = SqrtB
5
5 h4
a4 m 2
F
h4
a4 m 2
H*Mathematica does not know what to do with
the constants until we say they are real and positive.*L
2 2
En .*L
3
4
EX02.3.nb
In[41]:=
Out[41]=
In[42]:=
SimplifyB
5
h4
a4 m 2
, Assumptions Ø 8h > 0, a > 0, m > 0<F
5 h2
a2 m
H*This is the answer in the notes. Unlike a stationary
state the energy spread in Y@x,0D is not zero anymore.*L