Anda di halaman 1dari 18

Physics/Chem 229& 100 Final Exam 2009

Due Monday, Dec 14 at midnight


Open book, but no discussion with anyone except me. You may use any packages that seem
helpful. Provide clear commentary in text cells so that I can follow your reasoning.
grads do all problems
Undergrads get extra credit for problems marked (grads)
Name: Peter D. Alison

Ÿ 1a). Are the vectors v1={1, -2, 3, 4} , v2= {-2, 0, 3, 6}, v3= {4, -4, 3, 2} linearly independent? Why or why not?

v1 = 81, - 2, 3, 4<; v2 = 8- 2, 0, 3, 6<; v3 = 84, - 4, 3, 2<;

We must make a linear combination of these vectors and see if there is a nontrivial
solution. If there is a nontrivial solution then these vectors are linearly dependent.
Array@Λ, 3D

8Λ@1D, Λ@2D, Λ@3D<

sysofeqs = Table@Λ@1D v1@@iDD + Λ@2D v2@@iDD + Λ@3D v3@@iDD Š 0, 8i, 1, 4<D

8Λ@1D - 2 Λ@2D + 4 Λ@3D Š 0, - 2 Λ@1D - 4 Λ@3D Š 0,


3 Λ@1D + 3 Λ@2D + 3 Λ@3D Š 0, 4 Λ@1D + 6 Λ@2D + 2 Λ@3D Š 0<

Solve@sysofeqs, Array@Λ, 3DD

Solve::svars : Equations may not give solutions for all "solve" variables. ‡
88Λ@1D ® - 2 Λ@3D, Λ@2D ® Λ@3D<<

Since we have a nontrivial solution, where we can vary only Λ[3] (nontrivial solu-
tion) for this system of equations based on our vectors, these vectors are linearly
dependent
8mat, rhs< = EqToMat@sysofeqs, Array@Λ, 3DD

8881, - 2, 4<, 8- 2, 0, - 4<, 83, 3, 3<, 84, 6, 2<<, 80, 0, 0, 0<<

MatrixForm@matD

1 -2 4
-2 0 -4
3 3 3
4 6 2

MatrixForm@RowReduce@matDD

1 0 2
0 1 -1
0 0 0
0 0 0

This is another way to show that the vector are linearly dependent, using a matrix
method instead of solving a system.

Ÿ b) Find a set of vectors that span the hyperplane w - 2.3 x- 2 y- 3.4z == 6

Printed by Mathematica for Students


2 Final09.nb

b) Find a set of vectors that span the hyperplane w - 2.3 x- 2 y- 3.4z == 6

hyperplane = 8- 2.3, 2, 3.4, 1<.8x, y, z, w< Š 6

w - 2.3 x + 2 y + 3.4 z Š 6

NullSpace@8- 2.3, - 2, - 3.4, 1<D

NullSpace::matrix : Argument 8-2.3, -2, -3.4, 1< at position 1 is not a non-empty rectangular matrix. ‡
NullSpace@8- 2.3, - 2, - 3.4, 1<D

Ÿ 2. Find the solution to the equations


2x+3y+2z=10
5x-2y+7z=0

which has minimum length x2 + y2 + z2 .

The plane equations are our constraints and the length function is what we want to
minimize.
planes =
ContourPlot3D@82 x + 3 y + 2 z Š 10, 5 x - 2 y + 7 z Š 0<, 8x, - 10, 10<, 8y, - 10, 10<, 8z, - 10, 10<D
10-10
5
0 -5
-5
0
-10
10
5

10

-5

-10

constraint1 = 2 x + 3 y + 2 z - 10

- 10 + 2 x + 3 y + 2 z

constraint2 = 5 x - 2 y + 7 z

5x-2y+7z
Ÿ

Printed by Mathematica for Students


Final09.nb 3

length = x2 + y2 + z2

x2 + y2 + z2

laux = length - Λ1 Hconstraint1L - Λ2 Hconstraint2L

x2 + y2 + z2 - H- 10 + 2 x + 3 y + 2 zL Λ1 - H5 x - 2 y + 7 zL Λ2

auxconds = Thread@8D@laux, xD, D@laux, yD, D@laux, zD< Š 0D

x y z
: - 2 Λ1 - 5 Λ2 Š 0, - 3 Λ1 + 2 Λ2 Š 0, - 2 Λ1 - 7 Λ2 Š 0>
x 2 + y2 + z 2 x2 + y 2 + z 2 x2 + y2 + z2

mineqs = Join@auxconds, 8constraint1 Š 0, constraint2 Š 0<D

x y
: - 2 Λ1 - 5 Λ2 Š 0, - 3 Λ1 + 2 Λ2 Š 0,
x 2 + y2 + z 2 x2 + y 2 + z 2
z
- 2 Λ1 - 7 Λ2 Š 0, - 10 + 2 x + 3 y + 2 z Š 0, 5 x - 2 y + 7 z Š 0>
x 2 + y2 + z 2

solmin = Solve@mineqs, 8x, y, z, Λ1, Λ2<D  Flatten

13 3 110 450 50
:Λ1 ® , Λ2 ® - ,x® ,y® ,z® >
167 2171 167 167 167

xyz = 8x, y, z< . solmin

110 450 50
: , , >
167 167 167

xyz  N

80.658683, 2.69461, 0.299401<

Printed by Mathematica for Students


4 Final09.nb

Show@planes, Graphics3D@8Red, Sphere@xyz, 0.5D<DD


10

-5

-10

10

0
-10
-5
-5 0
5
-10 10

This plot shows the geometric interpretation of the problem we just solved. The inter-
section of these two planes is a line, and we found the point of that line that is
closest to the origin. We can see the red sphere of the intersection line.

Ÿ 3. Find all solutions to z 7 + 2 z 5 - 3 z 2 + 5 z + 1 Š 0 Make a plot which shows the location of the roots in the
complex plane.

We can use NSolve to find all seven roots of this polynomial.

zsol = NSolveAz7 + 2 z5 - 3 z2 + 5 z + 1 Š 0, zE

88z ® - 0.976459 - 0.860662 ä<, 8z ® - 0.976459 + 0.860662 ä<,


8z ® - 0.180397<, 8z ® 0.141399 - 1.6738 ä<, 8z ® 0.141399 + 1.6738 ä<,
8z ® 0.925258 - 0.550911 ä<, 8z ® 0.925258 + 0.550911 ä<<

Length@zsolD

Here are our roots to the polynomial and we can see that there are seven of them. In
fact, the computer has counted seven as well.
zs = z . zsol

8- 0.976459 - 0.860662 ä, - 0.976459 + 0.860662 ä, - 0.180397,


0.141399 - 1.6738 ä, 0.141399 + 1.6738 ä, 0.925258 - 0.550911 ä, 0.925258 + 0.550911 ä<

Here are all the solutions in the form of a list.

Printed by Mathematica for Students


Final09.nb 5

Transpose@8Re@zsD, Im@zsD<D

88- 0.976459, - 0.860662<, 8- 0.976459, 0.860662<, 8- 0.180397, 0<,


80.141399, - 1.6738<, 80.141399, 1.6738<, 80.925258, - 0.550911<, 80.925258, 0.550911<<

Here are our solutions as coordinates on the complex plane.

ListPlot@Transpose@8Re@zsD, Im@zsD<D,
PlotStyle ® PointSize@0.025D, AxesLabel ® 8"Re", "Im"<D
Im

1.5

1.0

0.5

Re
-1.0 -0.5 0.5
-0.5

-1.0

-1.5

Here are our root plotted on the complex plane.

2Π Sin@ ΘD2
Ÿ 4. Calculate the value of the integral Int = Ù0 â Θ using residues (use of Residues[...] is OK).
5+3 Cos@ ΘD
Specify the contour you are using by drawing a sketch. Explain your reasoning.

We start with trig form and convert the integrand to z form.

Sin@ΘD2
f =
5 + 3 Cos@ΘD

Sin@ΘD2
5 + 3 Cos@ΘD

fΘ = TrigToExp@fD

2
Iã-ä Θ - ãä Θ M
-
3
4 I5 + Iã-ä Θ + ãä Θ MM
2

fz = fΘ . 9ãä Θ ® z, ã-ä Θ ® 1  z=

1 2
I - zM
z
-
3 1
4 I5 + I + zMM
2 z

intz = Simplify@fz  Hä zLD

2
ä I- 1 + z2 M

2 z2 I3 + 10 z + 3 z2 M

We are looking for the instances where the denominator of intz is equal to zero.

Printed by Mathematica for Students


6 Final09.nb

solz = Solve@1  intz Š 0, zD

1
:8z ® - 3<, :z ® - >, 8z ® 0<, 8z ® 0<>
3

Here are the locations of the poles.

8pole1, pole2, pole3, pole4< = z . solz

1
:- 3, - , 0, 0>
3

1
We want the residues inside the unit circle. That will - and zero.
3
res2 = Residue@intz, 8z, pole2<D


9

res3 = Residue@intz, 8z, pole3<D


-
9

The sum of residues inside the unit circle.

sumres = res2 + res3

ä
-
9

Using our residue theorem where the integral is equal to the sum of the residues
inside the unit circle multiplied by 2 Π.
2 Π ä sumres


9

Sin@ΘD2
IntegrateB , 8Θ, 0, 2 Π<, PrincipalValue ® TrueF
5 + 3 Cos@ΘD

9

We use the principal value method to verify the sum of residues method, and we get
the same answer.

Printed by Mathematica for Students


Final09.nb 7

Ÿ 5. Two identical masses are attached to three springs between two fixed walls, as shown in the figure
below.

k1 k2 k1
m m

Ÿ a) Construct the Lagrangian , and set up the equations of motion for this system

<< VariationalMethods`

Clear@tD

The potential energy has three terms, one for each spring.

1 1 1
potentialEnergy = k1 x1@tD2 + k2 H x1@tD - x2@tDL2 + k1 x2@tD2
2 2 2
1 1 1
k1 x1@tD2 + k2 Hx1@tD - x2@tDL2 + k1 x2@tD2
2 2 2

We are assuming one - dimensional motion.

1 1
kineticEnergy = m x1 '@tD2 + m x2 '@tD 2
2 2
1 1
m x1¢ @tD2 + m x2¢ @tD2
2 2
Lagrangian = kineticEnergy - potentialEnergy

1 1 1 1 1
- k1 x1@tD2 - k2 Hx1@tD - x2@tDL2 - k1 x2@tD2 + m x1¢ @tD2 + m x2¢ @tD2
2 2 2 2 2
euleqs = EulerEquations@Lagrangian, 8x1@tD, x2@tD<, tD

8- Hk1 + k2L x1@tD + k2 x2@tD - m x1¢¢ @tD Š 0, k2 x1@tD - Hk1 + k2L x2@tD - m x2¢¢ @tD Š 0<

Here are the equations of motion for each of the masses.

Ÿ b) Calculate the normal mode frequencies for the vibrations of this system.

scndrv = Solve@euleqs, 8x1 ''@tD, x2 ''@tD<D  FullSimplify  Apart  Flatten

Hk1 + k2L x1@tD k2 x2@tD k2 x1@tD Hk1 + k2L x2@tD


:x1¢¢ @tD ® - + , x2¢¢ @tD ® - >
m m m m

Then we construct the matrix out of the coefficients of equations of motion. Then
eigenvalues of the matrix are the Ω2 , the normal frequencies squared.

Printed by Mathematica for Students


8 Final09.nb

Then we construct the matrix out of the coefficients of equations of motion. Then
eigenvalues of the matrix are the Ω2 , the normal frequencies squared.
Hk1+k2L k2
-
m m
modesmat = k2 Hk1+k2L
-
m m

k1 + k2 k2 k2 k1 + k2
:: ,- >, :- , >>
m m m m
normalmodes = Eigenvalues@modesmatD

k1 k1 + 2 k2
: , >
m m
Sqrt@normalmodesD

k1 k1 + 2 k2
: , >
m m

Here are the normal mode frequencies for the vibrations of this system.

Ÿ 6. Consider the differential equation y'' [x]/5 - x 2 y ' @xD- y[x]=0


a) Find a power series approximation to the initial value problem y[0]=3 , y'[0]=1/2 .

We can easily find the power series approximation, with the handy powerss function
provided in the handbook.

ode = y ''@xD  5 - x2 y '@xD - y@xD

y¢¢ @xD
- y@xD - x2 y¢ @xD +
5

pss = powerss@ode, y, x, 12, 0, FalseD

5 x2 25 x4 5 x5 25 x6 325 x7 4625 x8 2125 x9 13 675 x10 85 375 x11 323 375 x12
1+ + + + + + + + + + a@0D +
2 24 4 144 504 8064 18 144 48 384 399 168 6 386 688
5 x3 5 x4 5 x5 35 x6 25 x7 275 x8 5275 x9 3425 x10 4525 x11 106 625 x12
x+ + + + + + + + + + a@1D
6 12 24 72 112 2016 24 192 36 288 76 032 1 368 576

Printed by Mathematica for Students


Final09.nb 9

powerss@de_, yv_, xv_, deg_, pt_, verbose_D :=


BlockB8ps, subps, eqs, params, vars, ss, sv, order, dexp<,
dexp = de . xx_ Š yy_ ® xx - yy;
order = Max@Cases@8dexp<, q_. Derivative@n_D@x_D@y_D ® n, InfinityDD;
H* the order of de *L
deg
ps = â a@iD Hxv - ptLi ; H* the trial solution *L
i=0

vars = Table@a@iD, 8i, order, deg<D; H* a@0D, a@1D,.. a@order-1D are parameters *L
params = Table@a@iD, 8i, 0, order - 1<D;
subps = dexp . yv ® Function@xv, Evaluate@psDD; H* plug it into the de *L
subps = Normal@Series@subps, 8xv, pt, deg<DD;
eqs = Table@Coefficient@subps, Hxv - ptL, iD == 0, 8i, 0, deg - order<D;
H* set each coefficientŠ0 *L
If@verbose, Print@"DE = ", de, " order = ", order,
"\nTrial solution= ", ps, "\nplug in power series:\n",
subps, "\neqs for coefficients= ", TableForm@eqsDD;
Print@"\nparams= ", params, "\nvariables= ", varsDD;
ss = ps . First@Solve@eqs, varsDD;
sv = Table@Map@Factor, Hss . a@iD ® 1L . Thread@params ® 0DD, 8i, 0, order - 1<D;
sv.paramsF

1
iniconds = :Hpss . x ® 0L Š 3, HD@pss, xD . x ® 0L Š >
2
1
:a@0D Š 3, a@1D Š >
2
asol = Solve@iniconds, 8a@0D, a@1D<D  Flatten

1
:a@0D ® 3, a@1D ® >
2

Apparently the initial conditions solve themselves for the parameters a[0] and a[1].

pss . asol

5 x2 25 x4 5 x5 25 x6 325 x7 4625 x8 2125 x9 13 675 x10 85 375 x11 323 375 x12
3 1+ + + + + + + + + + +
2 24 4 144 504 8064 18 144 48 384 399 168 6 386 688
1 5 x3 5 x4 5 x5 35 x6 25 x7 275 x8 5275 x9 3425 x10 4525 x11 106 625 x12
x+ + + + + + + + + +
2 6 12 24 72 112 2016 24 192 36 288 76 032 1 368 576

Ÿ b) Construct a plot of the solution to the boundary value problem y[0]=1, y[2]=1 (Although you could use a
shooting method, there is an easier way.)
odesol = NDSolve@8ode Š 0, y@0D Š 1, y@2D Š 1<, y@xD, 8x, 0, 2<D  Flatten

8y@xD ® InterpolatingFunction@880., 2.<<, <>D@xD<

Printed by Mathematica for Students


10 Final09.nb

Plot@y@xD . odesol, 8x, 0, 2<, PlotStyle ® 8Thick, Red<, AxesLabel ® 8"x", "yHxL"<D

yHxL
1.0

0.8

0.6

0.4

x
0.5 1.0 1.5 2.0

Ÿ c) what are the possible types of asymptotic behavior as x -> ¥ for solutions of this equation?

Needs@"MMHTools`DETools`"D

asymptotic code was executed in the handbook.

yz = ChangeVariable@ode, x ® 1  z, y, y, x, zD

2 1
- y@zD + y¢ @zD + z3 y¢ @zD + z4 y¢¢ @zD
5 5

ClassifyODE@yz, y, z, 0, FalseD

irregular singular point

asymptotic@ode, y, x, 3, FalseD

1
Power::infy : Infinite expression encountered. ‡
0
this de does not have an
irregular singular point at Infinity; use frobenius
5 x3

ã 3 7 1 1 1 1 1
:: , 1+ + - >, :1, 1 + + + >>
2 3 2 x 3 2 x
x 30 x 2x 6x 2x

Ÿ 7. Gravitational stability of 3 masses. Consider three objects of unit mass which are constrained to move
1
in a plane and interact via an attractive inverse square force law with a potential V(r)= - , where r is the
r
distance between the masses. The initial condition is that all the masses are stationary, and mass #1 is at
{0, 0} , mass#2 is at {0,-1} and mass#3 is at {3,0} .
a) write the Lagrangian for this system.
<< VectorAnalysis`

Clear@VD

1
V@r1_, Θ1_, r2_, Θ2_D := -
r12 + r22 - 2 r1 r2 Cos@Θ1 - Θ2D

Printed by Mathematica for Students


Final09.nb 11

xypos = 880, 0<, 80, - 1<, 83, 0<<

880, 0<, 80, - 1<, 83, 0<<

rΘpos = xypos . 8x_, y_ < ® : x2 + y2 , If@x Š 0 && y Š 0, 0, ArcTan@Evaluate@x, yDDD>

Π
:80, 0<, :1, - >, 83, 0<>
2
potEn = V@r1@tD, Θ1@tD, r2@tD, Θ2@tDD +
V@r2@tD, Θ2@tD, r3@tD, Θ3@tDD + V@r3@tD, Θ3@tD, r1@tD, Θ1@tDD
1
- -
2 2
r1@tD - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD
1
-
r1@tD2 - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD2
1

r2@tD2 - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD2

The potential depends on the distance and in this case using the polar coordinates
distance formula
1 1 1 1 1 1
kinEn = r1 '@tD2 + Θ1 '@tD2 + r2 '@tD2 + Θ2 '@tD2 + r3 '@tD2 + Θ3 '@tD2
2 2 2 2 2 2
1 1 1 1 1 1
r1¢ @tD2 + r2¢ @tD2 + r3¢ @tD2 + Θ1¢ @tD2 + Θ2¢ @tD2 + Θ3¢ @tD2
2 2 2 2 2 2

The kinetic energy for each mass has two terms, one for r coordinate and one for the
Θ coordinate.
lagrange = kinEn - potEn

1
+
2 2
r1@tD - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD
1
+
r1@tD2 - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD2
1 1
+ r1¢ @tD2 +
2
r2@tD2 - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD2
1 1 1 1 1
r2¢ @tD2 + r3¢ @tD2 + Θ1¢ @tD2 + Θ2¢ @tD2 + Θ3¢ @tD2
2 2 2 2 2

Printed by Mathematica for Students


12 Final09.nb

Ÿ b) Write the equations of motion. What is the total energy of the system?

eqsofmotion =
EulerEquations@lagrange, 8r1@tD, r2@tD, r3@tD, Θ1@tD, Θ2@tD, Θ3@tD<, tD  FullSimplify
- r1@tD + Cos@Θ1@tD - Θ2@tDD r2@tD
: +
32
Ir1@tD - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD2 M
2

- r1@tD + Cos@Θ1@tD - Θ3@tDD r3@tD


Š r1¢¢ @tD,
2 2 32
Ir1@tD - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD M
Cos@Θ1@tD - Θ2@tDD r1@tD - r2@tD
+
32
Ir1@tD2 - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD2 M
- r2@tD + Cos@Θ2@tD - Θ3@tDD r3@tD
Š r2¢¢ @tD,
2 2 32
Ir2@tD - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD M
Cos@Θ1@tD - Θ3@tDD r1@tD - r3@tD
+
32
Ir1@tD - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD2 M
2

Cos@Θ2@tD - Θ3@tDD r2@tD - r3@tD


Š r3¢¢ @tD,
32
Ir2@tD2 - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD2 M

r2@tD Sin@Θ1@tD - Θ2@tDD


r1@tD - -
32
Ir1@tD2 - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD2 M

r3@tD Sin@Θ1@tD - Θ3@tDD


Š Θ1¢¢ @tD,
2 2 32
Ir1@tD - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD M
r1@tD r2@tD Sin@Θ1@tD - Θ2@tDD
Š
32
Ir1@tD - 2 Cos@Θ1@tD - Θ2@tDD r1@tD r2@tD + r2@tD2 M
2

r2@tD r3@tD Sin@Θ2@tD - Θ3@tDD


+ Θ2¢¢ @tD,
32
Ir2@tD - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD2 M
2

r1@tD Sin@Θ1@tD - Θ3@tDD


r3@tD +
32
Ir1@tD2 - 2 Cos@Θ1@tD - Θ3@tDD r1@tD r3@tD + r3@tD2 M

r2@tD Sin@Θ2@tD - Θ3@tDD


Š Θ3¢¢ @tD>
2 2 32
Ir2@tD - 2 Cos@Θ2@tD - Θ3@tDD r2@tD r3@tD + r3@tD M

The total energy of the system is initially potential. Initial kinetic energy is
zero, so we can find the initial potential energy as the total energy of the system.
potEn0 = V@rΘpos@@1, 1DD, rΘpos@@1, 2DD, rΘpos@@2, 1DD, rΘpos@@2, 2DDD +
V@rΘpos@@2, 1DD, rΘpos@@2, 2DD, rΘpos@@3, 1DD, rΘpos@@3, 2DDD +
V@rΘpos@@3, 1DD, rΘpos@@3, 2DD, rΘpos@@1, 1DD, rΘpos@@1, 2DDD
4 1
- -
3 10

Ÿ c) Solve the equations for the given initial conditions and make an animation of the motion. (Watch out for
extra curly brackets.) Use different colored dots to represent the objects. Play the animation at 20
frames/second. An interesting question that you are invited to speculate on is : will the particles ever
become separated by an infinite distance?
Printed by Mathematica for Students
Final09.nb 13

c) Solve the equations for the given initial conditions and make an animation of the motion. (Watch out for
extra curly brackets.) Use different colored dots to represent the objects. Play the animation at 20
frames/second. An interesting question that you are invited to speculate on is : will the particles ever
become separated by an infinite distance?

Our initial conditions are the given inital points and zero velocities.

initialconditions = 8r1@0D Š rΘpos@@1, 1DD, Θ1@0D Š rΘpos@@1, 2DD,


r1 '@0D Š 0, Θ1 '@0D Š 0, r2@0D Š rΘpos@@2, 1DD, Θ2@0D Š rΘpos@@2, 2DD, r2 '@0D Š 0,
Θ2 '@0D Š 0, r3@0D Š rΘpos@@3, 1DD, Θ3@0D Š rΘpos@@3, 2DD, r3 '@0D Š 0, Θ3 '@0D Š 0<
Π
:r1@0D Š 0, Θ1@0D Š 0, r1¢ @0D Š 0, Θ1¢ @0D Š 0, r2@0D Š 1, Θ2@0D Š - ,
2
r2¢ @0D Š 0, Θ2¢ @0D Š 0, r3@0D Š 3, Θ3@0D Š 0, r3¢ @0D Š 0, Θ3¢ @0D Š 0>

numsol = NDSolve@8eqsofmotion, initialconditions<,


8r1@tD, Θ1@tD, r2@tD, Θ2@tD, r3@tD, Θ3@tD<, 8t, 0, 10<, MaxSteps ® 50 000D  Flatten

NDSolve::mxst : Maximum number of 50000 steps reached at the point t == 6.6627057255523585`. ‡


8r1@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD,
Θ1@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD,
r2@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD,
Θ2@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD,
r3@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD,
Θ3@tD ® InterpolatingFunction@880., 6.66271<<, <>D@tD<

rΘtoxy = 8r_, Θ_< ® 8r Cos@ΘD, r Sin@ΘD<

8r_, Θ_< ® 8r Cos@ΘD, r Sin@ΘD<

traj = Table@
Graphics@88Green, Disk@H8Hr1@tD . numsol@@1DDL, HΘ1@tD . numsol@@2DDL< . rΘtoxyL, 0.2D<,
8Purple, Disk@H8Hr2@tD . numsol@@3DDL, HΘ2@tD . numsol@@4DDL< . rΘtoxyL, 0.2D<,
8Black, Disk@H8Hr3@tD . numsol@@5DDL, HΘ3@tD . numsol@@6DDL< . rΘtoxyL, 0.2D<<,
PlotRange ® 88- 1, 10<, 8- 3, 3<<D, 8t, 0, 6.6, 0.01<D;

ListAnimate@traj, 20D

Seeing how the black dot leaves the screen at the end of the animation, the particle
might be able to be separated by an infinite distance.
Ÿ

Ÿ 8. (grads) An electron is confined to a spherical cavity of radius R. ( This is actually a realistic model for
Printed by Mathematica for Students Ñ2
electrons in some liquids). The equation for its stationary energy states is - 2 m Ñ2 Ψ Š E Ψ. The wave
function must vanish at the boundary and be finite at the origin.
a) Using dimensional reasoning , predict the dependence of the ground state energy on the radius of the
cavity.
14 Final09.nb

8. (grads) An electron is confined to a spherical cavity of radius R. ( This is actually a realistic model for
Ñ2
electrons in some liquids). The equation for its stationary energy states is - 2 m Ñ2 Ψ Š E Ψ. The wave
function must vanish at the boundary and be finite at the origin.
a) Using dimensional reasoning , predict the dependence of the ground state energy on the radius of the
cavity.
Needs@"Units`"D
Needs@"PhysicalConstants`"D
Needs@"MMHTools`DimTools`"D
The symbols 8c, kB, Ñ, g, G, me, amu, Me, Ms, Na, Ε0, Μ0, e, Σ, Rgas<
have been assigned SI unit specifiers

basisunits = 8Meter, Kilogram, Second, Kelvin, Coulomb<

8Meter, Kilogram, Second, Kelvin, Coulomb<

electronparameters = 8R Meter, p Kilogram Meter  Second, Ñ<  ToSymbolsUnits  ReduceUnits

Kilogram Meter Kilogram Meter2 Ñ


:Meter R, p , >
Second Second

Kilogram Meter2 Ñ
:Meter R, m Kilogram, >
Second
Kilogram Meter2 Ñ
:Meter R, Kilogram m, >
Second

dimanal@electronparameters, basisunits, Joule  ReduceUnitsD

First::normal : Nonatomic expression expected at position 1 in First@1D. ‡


Ñ
:First@1D, : >>
R

Ÿ b) For the case of no angular dependence, find the lowest 3 energy levels and the corresponding radial
wave functions. Normalize the wave functions and plot them ( let R->1). Do this problem analytically, not
numerically.
<< VectorAnalysis`

SetCoordinates@Spherical@r, Θ, ΦDD

Spherical@r, Θ, ΦD

Laplacian@Ψ@rDD

Csc@ΘD I2 r Sin@ΘD Ψ¢ @rD + r2 Sin@ΘD Ψ¢¢ @rDM

r2

Ÿ
Printed by Mathematica for Students
Final09.nb 15

Ψsol = AssumingBÑ > 0 && m > 0 && En Î Reals,

- Ñ2 2
DSolveB Ψ '@rD + Ψ ''@rD Š En Ψ@rD, Ψ@rD, rFF  FullSimplify  Flatten
2m r

En m
- 2 r - 2 2 -En m r
Ñ2
ã 4 - En m C@1D + 2 ã Ñ Ñ C@2D
:Ψ@rD ® >
4 - En m r

Our boundary condition and normalization condition can determine our constants.

Ψ = HΨ@rD . ΨsolL

En m
- 2 r - 2 2 -En m r
Ñ2
ã 4 - En m C@1D + 2 ã Ñ Ñ C@2D

4 - En m r

SolveAAssumingAEn < 0 && Ñ > 0 && m > 0, IntegrateAΨ2 , 8r, 0, 1<E E Š 1, C@2DE

Integrate::idiv :
2 2 -En m r 2 2 -En m r
-
ã Ñ C@1D2 -En m Ñ C@1D C@2D ã Ñ Ñ2 C@2D2
Integral of - - does not converge on 80, 1<. ‡
r2 2 En m r 2 8 En m r2

Integrate::idiv :
En m 2 †2‡ r 2
-2 2 r -
Ñ2
ã 4 -En m C@1D + 2 ã Ñ Ñ C@2D
Integral of does not converge on 80, 1<. ‡
r2
Solve::tdep :
The equations appear to involve the variables to be solved for in an essentially non-algebraic way. ‡
Integrate::idiv :
En m 2 †2‡ r 2
-2 2 r -
Ñ2
ã 4 -En m C@1D + 2 ã Ñ Ñ C@2D
Integral of does not converge on 80, 1<. ‡
r2
General::stop : Further output of Integrate::idiv will be suppressed during this calculation. ‡

Solve::tdep :
The equations appear to involve the variables to be solved for in an essentially non-algebraic way. ‡

En m 2
-2 2 r - 2 2 -En m r
Ñ2
ã 4 - En m C@1D + 2 ã Ñ Ñ C@2D
1
SolveBà - â r Š 1, C@2DF
0 16 En m r2

Printed by Mathematica for Students


16 Final09.nb

Ÿ 9. A potential is zero for Abs[x]>1 and for Abs[x]<1, it has a triangular form as shown in the figure.

Ÿ The Schrö dinger equation in reduced units for this potential is -Ψ''[x]+V[x] Ψ[x] = e Ψ[x] . For bound states,
¥
Ψ must be normalizable : Ù-¥ Ψ* Ψ â x = 1.
a) for the case V0=5, estimate the ground state energy.
Clear@ΨD

Clear@VD

V@x_D := Piecewise@88- V0 Hx + 1L, - 1 £ x £ 0<, 8V0 Hx - 1L, 0 < x £ 1<<, 0D

Plot@V@xD . V0 ® 5, 8x, - 2, 2<, PlotStyle ® 8Purple, Thick<, AxesLabel ® 8"x", "VHxL"<D

VHxL
x
-2 -1 1 2

-1

-2

-3

-4

-5

schroeq = - Ψ ''@xD + HV@xD . V0 ® 5L Ψ@xD Š e Ψ@xD  FullSimplify

- 5 H1 + xL - 1 £ x £ 0
5 H- 1 + xL 0 < x £ 1 Ψ@xD Š e Ψ@xD + Ψ¢¢ @xD
0 True

Πx
To estimate the ground state energy let us use estimated wavefunction Ψ HxL = A CosB F
a
Integrate@

Printed by Mathematica for Students


Final09.nb 17

Ÿ b) estimate the value of V0 which leads to exactly 2 bound states.

Ÿ 10.Buffon needle problem. Consider a sheet of lined paper with parallel lines one unit apart. Drop a stick
one unit in length at random where random means random orientation angle and random position. Do this
many times. What is the probability that the stick does not intersect a line? Answer this question with a
simulation. Write a function called Buffon[ntry_,maxgraph_] which will generate ntry sticks Graph
whose center position is a random number between 0 and 1, and whose orientation angle is a random
number between 0 and 2 Π. Display a picture of two red parallel lines one unit apart, and the first
maxgraph black line segments (the sticks); plotting them all leads to a messy black porcupine, so keep
maxgraph around 50 or 70. Keep track of the number of line segments which cross either of the parallel
lines. Run the simulation with ntry=5000 or so times and estimate the probabilities of intersection and non-
intersection.
Clear@"Global`*"D

Buffon@ntry_, maxgraph_D :=
Block@8hΘs, points, boundaries, numcross, ys, yscross, probcross, probnocross<,
hΘs = Table@8RandomReal@D, RandomReal@2 ΠD<, 8ntry<D;
points = hΘs . 8h_, Θ_< ® 88- 1  2 Cos@ΘD, h - 1  2 Sin@ΘD<, 81  2 Cos@ΘD, h + 1  2 Sin@ΘD<<;
ys = points . 88x1_, y1_<, 8x2_, y2_<< ® 8y1, y2<  Flatten; yscross = 8<;
Do@If@ys@@iDD ³ 1 ÈÈ ys@@iDD £ 0, AppendTo@yscross, ys@@iDDDD, 8i, Length@ysD<D;
numcross = Length@yscrossD; probcross = numcross  ntry;
probnocross = 1 - probcross; Print@probcrossD; Print@probnocrossD; boundaries =
Graphics@88Thick, Red, Line@88- 3, 1<, 83, 1<<D<, 8Thick, Red, Line@88- 3, 0<, 83, 0<<D<<D;
Show@boundaries, Graphics@Table@Line@8points@@iDD<D, 8i, maxgraph<DDD D

Buffon@10 000, 50D

1583
2500
917
2500

Our output is the probability of crossing the lines, the probability of not cross the
lines, and a picture of the first fifty trials.
Buffon2@ntry_D :=
Block@8hΘs, points, boundaries, numcross, ys, yscross, probcross, probnocross<,
hΘs = Table@8RandomReal@D, RandomReal@2 ΠD<, 8ntry<D;
points = hΘs . 8h_, Θ_< ® 88- 1  2 Cos@ΘD, h - 1  2 Sin@ΘD<, 81  2 Cos@ΘD, h + 1  2 Sin@ΘD<<;
ys = points . 88x1_, y1_<, 8x2_, y2_<< ® 8y1, y2<  Flatten; yscross = 8<;
Do@If@ys@@iDD ³ 1 ÈÈ ys@@iDD £ 0, AppendTo@yscross, ys@@iDDDD, 8i, Length@ysD<D;
numcross = Length@yscrossD; probcross = numcross  ntry;
probnocross = 1 - probcross; Return@probcrossDD

Adjusting the Buffon program to return only the probability of crossing the lines, I
can take the mean of a large number of 10000 trials sets.

Printed by Mathematica for Students


18 Final09.nb

Mean@Table@Buffon2@10 000D, 810 000<DD

509 321
800 000

159 173
 N
250 000
0.636692

509 321
 N
800 000
0.636651

And I can conclude that the probability of crossing the lines is 0.636651 or 63.6651
%
100 - 63.6651

36.3349

Printed by Mathematica for Students

Anda mungkin juga menyukai