More Physics With MATLAB
More Physics With MATLAB
“Computers are like Old Testament gods; lots of rules and no mercy.”
— Joseph Campbell
“Part of the inhumanity of the computer is that, once it is competently programmed and
working smoothly, it is completely honest.”
— Isaac Asimov
There are only a very few analytically solvable problems in physics. They are
extremely useful because the equations for the solutions can be plotted and
the parameters defining the solutions can be varied in order to explore the
dependence of the solutions on the variables of the problem, although that
exercise may become tedious. In that way the student can build up an
intuition about the Kepler problem, for example.
However, this can only be done in a few cases and even then the effort
needed is large. For the others, numerical methods are needed and the
computation becomes somewhat cumbersome. As a result, it is more difficult
to vary the parameters of the problem numerically rather than symbolically
and develop an intuition about the dependence of the solution on those
parameters. In particular the time development of the system is often obscure
and “movies” can be a welcome tool in improving physical intuition.
Because of these issues, the advent of powerful personal computing has
considerably reduced the difficulties. Indeed, the aim of this book is to use the
ensemble of symbolic and numeric tools available in the MATLAB suite of
programs to illustrate representative numerical solutions to more than one
hundred problems spanning several physics topics. The student typically
works through the demonstration and alters the inputs through a menu driven
script. In that way the user driven menu allows for parametric variation. The
more advanced student can edit the script or, indeed, write a new script
covering a wholly new problem. It is crucial that the student read the script
which is supplied with the text. There are many “comment” lines in the script
which more fully explain what the procedures are in each specific case.
MATLAB is a good vehicle for the computational tasks. It has a compiler,
editor and debugger which are very useful and user friendly. The HELP utility
is very extensive. The MATLAB language is similar to a modern C++
language and it is a vector/matrix language which makes coding simpler than
older languages such as FORTRAN.
MATLAB contains many special functions. Matrices and linear algebra are
covered well. Curve fitting, polynomials and fast Fourier transforms are
supplied. Numerical integration packages are available. Differential
equations, symbolic, ordinary and partial, as well as numerical solutions are
available for both initial value and boundary value versions.
As an additional package, MATLAB has symbolic mathematics. Within
that package, calculus, linear algebra, algebraic equations and differential
equations are covered. It is easy to combine a symbolic treatment of a
problem with a numerical display of the solution when that is desirable. In
this way converting from symbols to numbers is easily achieved.
Finally, and very importantly, MATLAB has an extensive suite of display
packages. One can make bar, pie, histogram and simple data plots. There are
several contour and surface plots which are possible. There are two- and
three-dimensional plots of all types available. The time evolution of solutions
can be made into “movies” that illustrate the changes in speed during an
evolving process. These extensive visualization tools are crucial in that the
student can plot and then vary and re-plot.
There are many topics which are explored in the text. But, it is not what
topic is specifically explored that is important but how it is examined. A
useful methodology that one can apply to any specific problem is, in outline:
1. First look at the dimensions of an equation to see if they are correct.
For example, the Schrödinger equation has units of energy
[−h2 (∂2/∂x2 )/2m + V = ih∂/∂t]ψ.
Since the Planck constant has dimensions of position times momentum or
energy times time, it is clear that all the terms in the equation have the
dimensions of energy.
2. Then see what are the characteristic lengths and times implied by the
equation.
For the previous equation there is characteristic length times energy,
For electrons, that length is 8 eV * A. The second term
has dimensions eV. The third term has a time scale of 0.66 eV × 10−15
sec. Therefore for problems with scales of V of a few eV, it is expected
that distances for electrons will be a few Angstroms and times will be a
few 0.001 psec.
3. See if there are physically reasonable limits implicit in the equation.
For example, if the section on “Rocket Drag” the equation of motion
is:
In the limit where k and g are zero, the simple rocket equation is
recovered as a known limit. This can be checked by choosing the
parameters of the problem appropriately.
4. Try to solve the equation symbolically, if not use numerical techniques.
5. For either type of solution look for limits which simplify the results and
are physically reasonable.
For example, the analytic solution of the Kepler problem for an orbit
with eccentricity e is:
r = rc(1 + e)/(1 + e cos θ)
Clearly, a circular orbit has a constant radius, so that such an orbit must
have e of zero. At the other limit, if the radius is to diverge, then the
cosine of the angle must be 1/e.
Therefore unbound orbits must have e > 1 and the cosine of the angle
of the orbit at large r, the asymptote, is 1/e.
6. Finally, vary parameters of the problem in order to establish an
“intuition” about the dependencies of the result on the parameters.
For example, the “Spring Pendulum” is governed by the equations:
d2r/dt2 = g cos θ + (k/m)(Lo − r) + r(dθ/dt)2
d2θ/dt2 = −g sin θ/r − 2(dr/dt)(dθ/dt)/r
These are solved numerically. Possible checks are to set g to zero when a
simple spring should result. Another limit would be to set k to zero, when
a simple pendulum should result. Both limits can be checked by choosing
the parameters, including the initial condition, of the problem.
The aim of using these tools is to create intuition, not to solve a specific
problem or to complete a specific number crunching exercise. Indeed, the aim
of the text is not to teach the basic physics but to give the user a sense of how
the solutions of a given physics problem depend on the parameters of that
problem. If the reader has questions, a dip into Wikipedia and/or Google
should be very helpful. Details are also available in the “comments” lines
within the specific script.
The script for these demonstrations is made available on storage media and
examples for classical mechanics appear in the Appendix. The student is
strongly advised to read the script before executing the script. In that way the
script is not a “black box” but is part of the learning process. Using that
material the student can write her own additions and explorations with the
scripts supplied used as jumping off points. In this way, a path is made
available to extend well beyond the specific demonstrations provided in the
book itself, making the search for further possible insights open ended.
Contents
Preface
1. Mathematics
1.1 Chaos
1.2 Malthus
1.3 Missile Tracking
1.4 Monte Carlo Analytic
1.5 Monte Carlo Numeric
1.6 Monte Carlo Muon Beam
1.7 Fourier and Laplace Transforms
2. Classical Mechanics
2.1 Angular Momentum
2.2 Classical Scattering
2.3 Impact Parameter and DCA
2.4 Foucault Pendulum
2.5 Spring Pendulum
2.6 Spherical Pendulum
2.7 Driven Pendulum
2.8 Random Walk
2.9 Rotating Hoop
2.10 Tides
2.11 Action
2.12 Rocket Drag
2.13 Two Stage Rocket
2.14 Table Top
2.15 Kepler Eccentric
2.16 Non-Central Force
2.17 Euler Angles
2.18 Forceless Top
2.19 Top Motion
3. Electromagnetism
3.1 Electron e/m
3.2 Potential and Fields
3.3 Electrostatics — Plates
3.4 Electrostatics — Angled Plates
3.5 Electrostatic Helmholtz
3.6 Electric Quadrupoles
3.7 Cylinder Boundaries
3.8 Laplace Fourier
3.9 Rotating Charged Sphere
3.10 Dielectric Image Charge
3.11 Dielectrics
3.12 Dielectric Sphere
3.13 Induction
3.14 Magnetic Bottle
3.15 A Fusion Reactor
3.16 Dipole Radiation
3.17 Two Antennas
3.18 Dispersion
3.19 Waveguide
3.20 Skin Depth
4. Gases and Fluids
4.1 Leaky Box
4.2 Rectangular Flow
4.3 Debye Temperature
4.4 Times Arrow
4.5 Compressibility
4.6 Viscosity
4.7 Water Waves
4.8 Semiconductor
4.9 Semiconductor Junction
4.10 n-p Diode
4.11 Freezing Pipes
4.12 Cooling Earth − Interior
4.13 Cooling Earth − Exterior
4.14 Heat and pde
4.15 Heat Diffusion
4.16 Heat — Initial
5. Waves
5.1 Longitudinal Slinky
5.2 Transverse Slinky
5.3 SR — Doppler
5.4 Step Response
5.5 Pulsating Sphere
5.6 Rectangular Drum
5.7 Piano
5.8 Aperture Diffraction Off Axis
5.9 Antenna
5.10 Antenna Array
5.11 Lissajous
5.12 Plane Waves — 2d
5.13 Damped, Driven Oscillator
6. Quantum Mechanics
6.1 Box
6.2 Simple Harmonic Oscillator
6.3 Bound States — 3d Well
6.4 Identical Particles
6.5 Stark Effect
6.6 Square Well Scattering — 3d
6.7 Photoelectric Effect — Continuum
6.8 Line Width
6.9 Barriers
6.10 General Eigenvalues
6.11 Koenig–Penny
6.12 Decay Chain
6.13 Casimir Effect
7. Astrophysics
7.1 Transfer Orbit
7.2 Flyby
7.3 Lagrange Points
7.4 Binary Orbits
7.5 Three Body Orbits
7.6 Polytropic Star
7.7 Pulsating Stars
7.8 White Dwarf
7.9 Boltzmann and the Sun
8. General Relativity
8.1 Light Deflection
8.2 Circular Geodesic
8.3 General Geodesic
8.4 Kerr Photons
8.5 Kerr General
8.6 Gravity Wave Radiation
8.7 Stellar Pressure
8.8 Light Propagation in the Universe
Appendix: Scripts for the Chapter on Classical Mechanics
Graphical User Interface (GUI)
References
Index
Chapter 1
Mathematics
“The scientist does not study nature because it is useful; he studies it because he delights in it,
and he delights in it because it is beautiful. If nature were not beautiful, it would not be worth
knowing, and if nature were not worth knowing, life would not be worth living.”
— Jules-Henri Poincaré
“The chief forms of beauty are order and symmetry and definiteness, which the mathematical
sciences demonstrate in a special degree.”
— Aristotle
1.1. Chaos
The world is a complex place and the relationship for complex systems
between cause and effect is difficult to untangle. A famous statement about a
fluttering butterfly wing “causing” a weather storm is an example of this
perception. Complex systems have “chaotic” solutions. Predictions for
macroscopic systems with 1023 particles or so by tracking each particle are
clearly impossible. Even simple systems with few particles are not simply
predictable if the initial conditions are changed very slightly.
A very simple system, consisting of a particle starting from a position and
angle and bouncing around a totally rigid circular container is explored in the
script “Chaos_Butterfly”. Indeed, small changes in the initial conditions lead
to large changes in the tracked trajectory after only twenty bounces. Plots for
an initial position of y equal to zero and x equal to −0.5 (circular container of
radius one) and initial angles of 20 and 21 degrees are shown in Figures 1.1
and 1.2 respectively. The patterns are quite different with a small change in
the initial conditions. The user can “play” with different initial conditions and
watch the subsequent behavior of the system in order to see how little the
starting conditions need to be changed to make a large change in the
trajectory after only a few bounces off the container walls.
Figure 1.1: Trajectory for 20 bounces with an initial angle of 20 degrees. The starting point is the red
circle, while the center of the circle is the black star.
Figure 1.2: Trajectory for 20 bounces with an initial angle of 21 degrees. The starting point is the red
circle, while the center of the circle is the black star.
1.2. Malthus
Malthus long ago predicted that, with a fixed maximum food supply possible
and with a growing population, famine would be unavoidable. However, so
far, using fertilizers and crop improvements, this fate has been avoided by
increasing the food supply. In the long run that approach has limitations
which need to be considered and the predictions of Malthus will not be
evaded forever.
The simplified equations explored in the script “Malthus” are:
Figure 1.6: Last frame of a movie for the target, red line on the y axis, and the missile, blue line,
intercept at y of 6.67.
Figure 1.7: Plot of the y intercept in L units as a function of the speed ratio. The intercept diverges as
the speed ratio approaches one, as expected.
The Brite-Wigner resonance line shape can also be solved analytically and is
shown in Equation (1.5). The central value is xo and the width, full width at
half maximum is Γ.
A Gaussian distribution can be achieved by using two random numbers and
the fact that the joint probability of two uncorrelated variables is the product
of the probabilities. In Equation (1.6) the standard deviation of the Gaussian
is σ. The joint probability can have a “radius” chosen from an exponential and
an azimuthal angle chosen randomly from zero to 2π. The means of the
Gaussian can simply be added to the resulting x and y values.
The script, “MC_Analytic” gives the user a choice of these distributions and
the parameters which specify the distributions, such as the desired power
where the menu presented by the script appears in Figure 1.8. An example
printout for a resonance shape appears in Figure 1.9 and the output is a
histogram of the distribution, displayed in Figure 1.10.
In this script the MATLAB utility “hist” is used to create histograms of the
numerical results. The options available can easily be seen in the Command
Window by typing in “help hist”.
Figure 1.10: Example of the output plot for the choice of a resonance distribution with 1000 generated
entries.
An example from the script “MC_Numeric” appears in Figure 1.11. In this
case the angular distribution for Compton scattering with user defined initial
photon energy is produced. The user can vary the energy and see how the
distribution varies, as desired. This distribution is complex and cannot be
found analytically.
Figure 1.11: Angular distribution in Compton scattering for a specific, user defined, photon energy.
The Euler angles define a slightly more general transformation and they will
be defined and used in the next chapter of this text. They relate the frame
attached to a solid body to a frame related, in general, by three angles
defining the orientation of an extended body.
The script “Mult_Scatt” uses “Euler” and “Gauss”.
A muon is a charged particle with a rest mass of 106 MeV. It traverses a
length of material and suffers a scattering angle ϑ by an amount chosen from a
Gaussian distribution with a defined mean of zero and a standard deviation
fixed by the length of material being travelled and by the muon momentum.
Because the angles of scattering are not small at low energies or for thick
material and the energies may change substantially, the block of material to be
traversed is divided into segments, the number of which is chosen by the user.
The segments should be such that a substantial fraction of the muon energy is
not lost in any single segment nor should the scattering angles be large. A
specific dialogue is shown in Figure 1.12.
The beam starts at normal incidence to the block of iron. Assuming a path
strictly normal the beam would lose 8 MeV in energy and scatter by 38
degrees after traversing the full 50 cm of iron. However, the path is more
complex than that, which is what necessitates the more detailed Monte Carlo
modelling.
Figure 1.12: Specific choice of the muon beam of 200 MeV mean momentum.
The 200 MeV mean momentum beam loses about 15 MeV on average and
about 14 MeV in energy on average. In addition, the multiple scattering may
lead to long distances in the iron block, so that “End of Range” or the loss of
all kinetic energy of a given muon must be protected against. The energy loss
is highly dependent on the muon velocity, going as the inverse square, so that
behavior should be modelled properly.
The starting energy distribution is shown in Figure 1.13, while the exiting
distribution appears in Figure 1.14. Note the long, low energy tail due to the
traversal of many cm of iron. As before, the utility “hist” is used to make the
plots.
There is a long, low energy tail which arises from multiple scattering in the
block, whose transverse size is assumed to be very large. The actual path
length for the muon with large scattering angles then becomes very long. The
initial energy was confined to the region (205,250) MeV as seen in Figure
1.13.
Figure 1.13: Distribution in initial energy for a 200 MeV momentum mean muon beam with a 3%
momentum spread.
The x and y locations of beam particles for the initial beam and final beam
are shown in Figure 1.15. Note the scale change in the two plots by a factor of
20. These two plots underscore the need to do correct modelling. In particular,
note that a lower energy muon has more multiple scattering for a given
thickness of material.
Figure 1.16: Example of the Laplace transform for sin(x). The user must input the correct limit in
order to invoke plots of f(x) and F(y).
Figure 1.17: Laplace transform, F(y) of f(x) = sin(x).
Classical Mechanics
“The most exciting phrase to hear in science, the one that heralds new discoveries, is not
‘Eureka!’ but ‘That’s funny’ …”
— Isaac Asimov
“Measure what can be measured, and make measureable what cannot be measured.”
— Galileo Galilei
Figure 2.2: Time development of the (x, y) trajectory and the angular momentum. Note that Lz is not a
constant on the trajectory.
A plot of the three scattering angles with energy E equal to twice the
magnitude of the potential, where appropriate, as a function of impact
parameter is made in the script “Classical_Scatt” and shown in Figure 2.3. It
appears that they are rather different. However, since the differential cross
section goes as bdb, the total cross section contributions are very heavily
weighted toward large b, and the small b scattering contributes little to the
total cross section. The conclusion of the plot is that one must measure the
differential cross section in order to make a more incisive determination of the
force law which is active in the scattering.
Other power laws are possible and the user can try them. Plots of the ratio
of a/b for the case of an inverse cubic power law force as a function of the
incident velocity are shown in Figures 2.5 and 2.6 for repulsive and attractive
forces respectively. In the case of a repulsive force the ratio a/b is always
greater than one and only approaches one at high incident velocity. The
opposite behavior is seen for attractive force. At low velocity the projectile is
pulled to the force center and small a/b values are seen. Only at large velocity
does the point of closest approach reach the limit of the impact parameter.
Figure 2.5: Ratio of a/b as a function of incident velocity (arb. units) for a repulsive force. At low
velocity the particle is repelled to large values of a/b, while at high velocity the power 3 repulsive force
is relatively weaker and a > b.
These equations are solved symbolically using the “dsolve” MATLAB utility
in the script “Foucault_exact”. The approximate solution for the case where
ω, the pendulum harmonic frequency, is much less than Ω is also shown for
comparison. The script is quite slow because at least an entire day is mapped
out; be patient. The exact x and y positions in the Earth frame are shown in
Figure 2.7 for the case where the pendulum period is 0.05 days and it sits at
thirty degrees north latitude. The approximate solution is also plotted by the
script as a movie and illustrates that the motion is not re-entrant on a daily
basis in this case because of the approximations made.
Figure 2.7: Plot of x and y locations of a Foucault pendulum as a function of time in days. These
trajectories are re-entrant in time with period of 1 day.
The plot in Figure 2.8 shows the exact solution in the pendulum frame in blue
and a view in the “absolute” frame where the pendulum exhibits simple
harmonic motion. The movie of the two motions is plotted and Figure 2.8 is
the last frame of that movie.
A plot of the (x, y) motion of the pendulum (exact) is shown in Figure 2.9
for the case where the pendulum period is 0.1 days at 30°N latitude. The
motion is clearly nicely re-entrant after one day of motion.
Figure 2.8: Plot of the pendulum position, in the exact case, on Earth (blue) and in absolute space (red
stars) as the last frame of a movie of the Foucault motion.
where r is along the spring with coefficient k and un-stretched length Lo and
the angle θ is the angle with respect to the vertical axis. The results of a user
dialogue with the script “Spring_Pendulum” which uses the MATLAB script
“ode45” are shown in Figure 2.10. The spring elongates and compresses and
the mass point follows while simultaneously being pulled toward the vertical
by gravity. The resulting radius as a function of time with respect to the un-
stretched spring at Lo is displayed in Figure 2.10. A movie is provided by the
script and the last frame of the movie is shown in Figure 2.11.
Figure 2.9: Plot of the pendulum position, in the exact case, on Earth, as it evolves in time. The
pendulum period is 0.1 days. The trajectory is plotted for 2 days by which time the pendulum has
returned to the initial configuration.
Figure 2.10: Dialogue for “Spring_Pendulum” defining the spring and the pendulum aspects of the
problem.
The user can check the solutions by going to the limiting cases of g equal
to zero, the spring alone, and the case where k is equal to zero, the simple
pendulum. In general the motion is not simple harmonic. For example, the
plot in Figure 2.11 displays a fairly complex pattern where the maximum
amplitude in each oscillation period changes as does the frequency itself. The
trajectory is illustrated in the last frame of a movie for the (x, y) motion of the
mass point for a slightly different set of parameters in Figure 2.12. The initial
velocities are assumed to be zero in this script.
Figure 2.11: Plot of the radius as a function of time. The unstretched length is 10 in this example,
where the parameters chosen appear in Figure 2.10, where the initial r is 12. Changes in r indicate
stretching or compression of the spring which supports the mass point.
As can be seen in Eq. (2.7) the polar angle θ has acceleration terms due to the
centrifugal force, the L2 term, and due to gravity, the g term, pulling the mass
term toward the vertical. The azimuthal angle term simply expresses the
conservation of the angular momentum L, and is included to easily evaluate
the results for that angle.
The script asks for L and the initial angle and initial angular velocity.
After defining the initial conditions a movie of the subsequent motion is
provided and plots for a specific case are shown in Figures 2.13 and 2.14.
Figure 2.13: Plot of the polar angle as a function of time for the specific case where g/ro = 1, L = 0.01,
θ = 50° and dθ(0)/dt = 4 degrees/sec.
The user is encouraged to try a full range of possible initial conditions and
a range of parameters defining the spherical pendulum. For example, another
set of parameters and initial conditions are the input to the plot of Figure 2.15.
The pendulum moves in one dimension only. The damping factor is Γ, the
amplitude of the driving force is Fo and the driving frequency is ωd while the
natural frequency ωo is taken to be one in the script.
Figure 2.14: Plot of the (x, y) pendulum trajectory for the specific case where g/r0 = 1,L = 0.01, θ =
50° and dθ(0)/dt = 4 degrees/sec.
Note that the radius is not zero, but does display the square root
dependence which is expected. For one hundred steps a mean radius of ten
might be expected and is approximately observed. Another example of
stochastic behavior is that exhibited in multiple Coulomb scattering where the
mean overall scattered angle goes as the square root of the distance travelled
by the charged particle. This was assumed in the muon beam exercise
previously considered as coded explicitly in the script “Mult_Scatt” where the
mean multiple scattering angle goes as the square root of the material distance
travelled in radiation length units.
The equations of motion follow from the Lagrangian formed from the
potential, V, and two contributions to the kinetic energy, T. The first term in
the expression for T is due to the mass point velocity. The second term in T is
due to the rotation of the hoop due to the centrifugal effect.
Figure 2.18: The path of a random walk in x and y with 100 steps of length one taken.
Figure 2.20: Printout of the script “Rotating_Hoop2” for a user supplied input of the hoop rotation
frequency. In this case the stable angle is 0.91 radians.
2.10. Tides
Newton first explained the tides. As was understood much later, it is the tidal
forces that are important in General Relativity because any overall
acceleration can be removed by going to a free falling frame as stated by the
Equivalence Principle. The tidal forces are defined locally at a mass point.
They both stretch and compress an extended body.
Figure 2.21: Frame of a movie of the rotating hoop. The hoop is drawn in green, the mass point in red,
and the equilibrium angle is a blue o. The hoop rotates in the movie in order to show the relationship of
the hoop rotation to the mass point oscillation.
Due to the attraction of the moon there are tidal forces which are in
directions and of magnitude such as to elongate the oceans in a line with the
moon. For the moon-earth distance of r0, the forces Fz and Fx at a location
specified at a point (x, z) near radius r0 with z along the moon-earth direction
and x transverse to z are:
2.11. Action
There have been two fundamental descriptions of dynamics in physics, the
equations of motion approach and the minimum action approach. They are
equivalent, although the equations of motion, for example those of Newton,
are rather more familiar. They yield second order differential equations which
are typically solved by specifying initial positions and velocities. Several
examples in classical mechanics appear in this chapter in fact.
The other approach is the “action principle”. Simply stated the action, S,
along the true path is an extremal, minimum, and the end points of the path
are fixed. Alternative paths have an action larger than the path “chosen” by
the system.
Figure 2.22: A frame from the movie provided by “Tides”. The earth is red, the oceans are dashed
blue and the Moon is a blue O.
In the script the starting values at the twenty sample points are randomly
chosen around the points of the exact solution. Then the MATLAB utility
“fminsearch”, is used to minimize the action. Therefore, each use of the script
will yield a slightly different solution and the minimization, which is
numerical, may not converge to strict limits. Typical results for both simple
harmonic motion and for motion in a uniform gravity field appear in Figures
2.23 and 2.24 respectively. The minimization search is somewhat unstable, so
that initial positions and velocities, number of sample points, and time span
are defined by the script itself. The user may vary the parameters, but only by
modifying the script. Aside from these caveats, the minimization of the action
is made plausible by using this script. Using an enhanced number of points
would presumably also smooth out the behavior, but at a cost of rather longer
execution time for the search.
Figure 2.23: Exact and least action solution for simple harmonic motion. Twenty points in time are
selected and the action is minimized with respect to them using “fminsearch”.
2.12. Rocket Drag
The simple rocket, as modeled, has no external forces acting on it. That model
can be improved by taking the gravity field at the launch site into account. For
a uniform field with acceleration g, an analytic solution exists. An additional
force arises from the drag due to the viscosity of the air through which the
rocket passes. The height above the earth is y and vo is the exhaust velocity.
The acceleration drag depends on the rocket velocity, v, squared and the
density of the local atmosphere, which falls off with altitude.
Figure 2.24: Exact and least action solution for motion in a uniform gravity field. Twenty points in
time are selected and the action is minimized with respect to them using “fminsearch”.
The rocket mass is M and the mass burn rate, dM/dt, is assumed to be a
constant. The gravitational acceleration is g and the air density is ρ, which
falls off with altitude on an approximate scale β = 1/9140m. The drag
constant, k, in MKS units is about 5000. This equation is solved numerically
in the script “cm_rocket_drag” using the MATLAB utility “ode45”. The
advanced user could replace g by the more correct gravitational force, g →
g/(1 + y/R)2, where R is the radius of the earth and study the resultant changes
in the rocket trajectory.
Figure 2.25: Velocity of a rocket which is free, in a constant gravity field, and subject to gravity and
drag. The black horizontal lines are the escape velocity for the earth (solid) and sun (dashed).
The velocity of the rocket as a function of time is shown in Figure 2.25 for
a particular case chosen by the user, near to the parameters of a Saturn V but
with only a 1000 kg payload. In this example the payload attains escape
velocity from the Earth. The free case goes fastest as expected. In the case
with an added gravity field, the initial acceleration must become positive,
leading to a delay in gaining altitude. Adding drag does nothing until the
speed builds up as expected from the dependence on velocity squared.
However, at later times when the velocity increases the air density falls off
and the drag force drops.
The position of the rocket in the three cases is displayed in Figure 2.26.
The free rocket is always highest at a given time. The effect of viscosity is not
negligible and needs to be taken into account in any real application.
Figure 2.26: Height of a rocket which is free, in a constant gravity field, and subject to gravity and
drag. The effect of viscosity drag is non-negligible.
The basic rocket equation for exhaust velocity v0 and initial and final masses
of the rocket of mi and mf is found from applying momentum conservation to
the system of the rocket itself and the ejected mass:
Gravity and drag are now ignored in the comparison of two and one stage
rockets.
For a single stage rocket with initial mass m0, payload mass mp and ratio of
plumbing mass to fuel mass rat the final mass is the payload plus the
plumbing, so that the final velocity, with zero initial velocity is:
A two stage rocket can improve on the magnitude the final velocity by
jettisoning the first stage dead weight of plumbing. Assuming the two stages
have the same rat value, the same launch weight m0 and payload mass mp, the
final velocity for a two stage rocket can be derived by repeated application of
the basic rocket equation. It is:
For the one stage the initial mass is m0 and the final mass is the payload mass
plus the plumbing for the total fuel load. The two stage case allows some of
the plumbing to be shed with the first stage, which is assumed to be all dead
weight plumbing when it is cast away. The plumbing masses are mr1 and mr2
for the two stages. The total second stage mass of payload plus plumbing plus
fuel is m2. The final two stage velocity is the velocity gain from the first stage
plus the gain from the second stage.
The comparison is made in the script “Two_Stage”. Dialogue from that
script appears in Figure 2.27. The velocity comparison for the parameters
given in Figure 2.28 and is plotted in Figure 2.29. A clear gain in final
velocity is seen, which is why most space missions use multi-stage launch
vehicles. The time unit T is the total fuel burning time assuming no plumbing,
so that the actual times are less since dead weight is now explicitly assumed.
The specific assumption is that the plumbing weight is 30% of the fuel
weight.
There is an optimization that can be done for each particular set of
parameters. For a 30% ratio of plumbing to fuel the results are shown in
Figure 2.29. There is a weak optimal second stage weight to total launch
weight for these specific parameters which occurs at a second stage fractional
weight of approximately 10%.
Figure 2.27: Typical input parameters to compare a two stage and a one stage rocket.
Figure 2.28: Comparison of the final velocities attained by a one and a two stage rocket.
Figure 2.29: Final velocity as a function of the fractional mass taken by the complete second stage.
A plot of the motion of the two mass points is supplied as a movie and also as
a three-dimensional plot using “plot3”. As seen in Figure 2.30, the blue lines
indicate the positions of the two mass points.
Figure 2.30: Plot of the positions of the two mass points. The upper mass point moves in the plane at z
= 0, while the lower mass point moves up and down along the vertical axis z.
The orbits for several values of e are shown in Figure 2.31. The orbit at e = 0
is a circle, which evolves with increasing e into an ellipse and then a
hyperbola. The script used is called “eccentric_Kepler”. The printout of the
script for a case where e is greater than one appears in Figure 2.32 which
gives the asymptotic angle.
The boundary between bound and unbound orbits occurs at e = 1 when the
degenerate ellipse opens up into a parabola. Note that, looking at Eq. (2.19),
the radius r becomes large when cos θ = 1/e, which has a real angle as
solution only if e is greater than one. The angles in question are the
asymptotes. The velocities in the bound case are vy = vc(1 + e cos θ) and vx =
vce sin θ both scaled to the circular velocity
The solutions for a specific non-central force are explored in the script
“Non_Central_force”. There is an additional harmonic force with amplitude b
and harmonic frequency ω which is shown in Eq. (2.20).
Figure 2.31: Orbits with eccentricity 0, 0.3, 0.6, 0.9 and 1.01, taking rc = 1.
Figure 2.32: Printout from the script “eccentric_Kepler” for an unbound trajectory with e = 1.2.
The gravitational force appears with unit strength. In the script, a symbolic
solution is first tried but it is not successful. Then a numerical solution using
“ode45” is adopted. The user dialogue allows for a choice of the strength of
the added force and the angular frequency. The major axis of a Keplerian
orbit and the angular velocity are then chosen, which defines an elliptical
orbit in the absence of the additional force.
The perturbing force distorts the ellipse, elongates it and causes it to be
non-reentrant. The angular momentum is no longer conserved, Eq. (2.20), so
that the problem is intrinsically two-dimensional. For small amplitudes the
effect is small. For high frequencies with respect to the main orbital motion
the effect is also washed out since the averaged force approaches zero.
Typically, for a high enough frequency and a small enough amplitude, the
force only causes the ellipse to not close on itself, as illustrated in Figure 2.33.
At larger amplitudes the effect of the added force becomes more pathological,
as the user can easily explore.
Figure 2.33: Movie of the orbit for a strength of 0.3 and a frequency of 1. A major axis of 4 is
assumed for the Keplerian ellipse.
Figure 2.34: Movie of the orbit for a strength of 0.6 and a frequency of 1. A major axis of 4 is
assumed as the starting point of a force free ellipse. The actual orbit is nearly unbound due to the
additional force.
A stronger force with a low frequency will distort the orbit even more. A
low frequency means that the sign of the force does not change rapidly during
the orbit and thus the force pushes the orbit to large radii. The strength is then
sufficient to make the bound orbit into a free orbit. A movie for this situation
is shown in Figure 2.34.
The Euler angles will be illustrated by the study of top motion. However,
they are perfectly general and can be applied to any situation describing rigid
body motion.
Figure 2.36: Precession of a top not acted on by any forces. The axis of rotation is indicated by the red
lines as a function of time in the movie provided. The top has a shape with Iz = 1.5 and I1 = 1 and the
inclination angle is 30 degrees.
The rotation axis is z with moment of inertia in the body frame defined to be
Iz, while the other axis is defined to be, as before, I1. In general the top
rotational axis precesses, as in the forceless case, although the precession rate
is now not a constant. It also nutates, with a complex path swept out in the
polar angle variable. This motion has the top initially dropping under gravity
and then rising in a periodic fashion. In fact, with extreme values of the user
supplied parameter, the top will “tumble” and then right itself later.
The equations to be solved in the space frame are:
Since the top is not translating there are three variables specifying the top; the
polar and azimuthal angles of the top axis in the space frame and the angle ψ
defined by the spin of the top itself about its axis of rotation.
This set of equations is solved numerically in the script “Top_Euler” using
the MATLAB utility “ode45”. The initial azimuthal angle φ is zero, while the
initial polar angle θ, which defines the inclination of the top, is defined by the
user. The initial value of the time rate of change of the azimuthal angle sets
the behavior of the nutation, and it is also a user supplied input. The spin is
defined by the angle ψ. In general there are five functions to determine. The
dialogue is shown in Figure 2.37.
Figure 2.37: User definition of the motion of a top. The top mass and shape are user defined as are the
top spin and angle of inclination from the vertical.
Figure 2.38: Precession of a top with gravitational torque acting on it. The structure in time is no
longer simple as it was in the forceless case.
A typical result for the precession in azimuth is shown in Figure 2.38. The
rate is not constant, as in the forceless case, but is modulated by the nutational
motion in polar angle.
In Figures 2.39 and 2.40 the nutational pattern for the polar angle is shown
for two values of the initial time rate of change of the azimuthal angle. In
Figure 2.41 the last frame of a movie of the motion of the top axis is shown,
illustrating the precession and nutation.
If the time rate change of initial azimuthal angle is set to zero, the top
merely drops initially in polar angle until if rises and executes simple
harmonic motions. There is another special case, where the top is initially
vertical, the “sleeping top”, where the top then simply spins about the z axis
as in the forceless case because the torque is then zero. The user has several
parameters to explore in this exercise. The motion is complex and the user is
highly encouraged to vary the top defining parameters and see what the
subsequent motion is. The top may “sleep”, or simply precess, or fall below z
= 0.
Figure 2.39: Nutation in the case of a small positive value for the time rate change of the azimuthal
angle.
Figure 2.40: Nutation in the case of a larger positive value for the time rate change of the azimuthal
angle.
Figure 2.41: Motion of the axis of the top for the case of a 30-degree initial angle and initial azimuthal
time rate of change as in Figure 2.39.
Chapter 3
Electromagnetism
In Eq. (3.1) all quantities are measured on the right-hand side of the
expression for e/m. In this fashion J. J. Thomson was able to determine the
charge to mass ratio of the electron.
Figure 3.4: Potential for the case where d/a = 0.8 for a series with 20 terms.
The solution for r greater than ro inverts the power to be (ro/r). This
ensures that the potential vanishes at the origin and falls off at large r values,
as is physically reasonable. The potential is displayed as a function of x and y
after the user defined values of α and β and the number of terms of the series
are given. The result for ro = 1 with a thirty degree angle of the plates and a
ten degree angle for the charge are shown in Figure 3.6.
The contours indicate that the plates are equipotentials which therefore
satisfy the boundary conditions. There is a general falloff with distance from
the point charge. Another example is shown in Figure 3.7. In this case α is
sixty degrees and β is forty degrees. The change in the equal potential
contours is very evident with respect to the previous example. The vertical
field near the lower plate, Ey(x, 0), is shown in Figure 3.8. It was derived
using the potential and the MATLAB utility “gradient”. The x electric field at
the lower plate is small, zero within the numerical accuracy as is required by
the boundary conditions. The user is encouraged to try several values of the
two angles.
Figure 3.6: Potential contours for the case where α = 30 degrees and β = 10 degrees. The plates are
located at y = 0 and the second plate is indicated by the red dashed line.
Figure 3.9: Printout of the script “Electric_Helmholtz”. The first and second derivatives of the field
are prints by the script but are not shown here. The MATLAB symbolic utility “diff” is used to derive
the fields and derivatives so as to explore the uniformity of the field.
Figure 3.10: Plots of the field and its derivatives for the special case of a uniform field, where
where a is =1 in this plot.
Figure 3.12: Loglog plot of the potential and radial field for a simple quadrupole layout. The x axis is
(1, 3) in units of a. The line with 1/r3 dependence is to compare to the potential r dependence. The
power law behavior sets in quite rapidly, with r/a less than 2.
Figure 3.13: The solid shape derived for the spatial dependence of the radial field of a quadrupole
with a moment possessing only a z, z component.
Both the region interior and exterior to the cylinder is solved using a series
method. The small radius solution vanishes at the origin, while the large
radius solution falls off rapidly with radius. The potential, in Vo units, with
indices that are odd is:
The script assumes that the radius, a, is one as is the potential magnitude at
that radius. The user chooses the number of terms in the series, which allows
a visual inspection of the convergence of the series. The electric fields are
derived numerically using the MATLAB “gradient” tool. The potential for a
series with twenty odd terms is shown in in Figure 3.14, while the y
component of the electric field appears in Figure 3.15. With twenty terms the
representation on the radial boundaries appears to be quite good in that the
constancy of the potential is manifest.
Figure 3.14: Potential both interior and exterior to a cylinder of radius one and potential one. The rise
in V at interior r and the falloff at large r are evident.
Figure 3.15: The field derived from the series from the potential of Figure 3.14. The behavior is
complex at the boundary along y = 0.
The script “Laplace_Series” covers this situation. The user supplies the
parameters, a, b and the left and right voltages. In addition the number of
terms in the series is asked for so that the user can see how rapidly the
convergence of the series is. A mesh plot for the case of a equal to two, b
equal to one, left voltage of 10 and right voltage of 5 with twenty terms in the
series is shown in Figure 3.16. The left and right constant voltages on the
boundaries are clearly seen, as well as the voltage fall from left to right.
Figure 3.16: Voltage inside the box with sides at y = 0, 1 grounded and sides at x = 0, 2 held at 10
volts and 5 volts, respectively.
The electric field in the x direction for this specific case is shown in Figure
3.17. It is large in the four corners of the box where the potential changes
rapidly as expected.
The current depends on the charge, Q, and the rotational frequency ω. The
coordinates r and θ are spherical polar, and the problem is azimuthally
symmetric. The magnetic field is shown in Figure 3.18. The field has a dipole
like angular and radial dependence for radii greater than a, taken to be equal
to one in the mesh plots. The interior field at the origin is cosθ(5/2a), while it
falls to cosθ/a at the surface of the sphere, matching the exterior solution for
the field.
Figure 3.18: Mesh plot for the interior and exterior radial magnetic field of a rotating charged sphere.
The field in the polar angle direction is defined in Eq. (3.7) and is shown in
Figure 3.19.
The angular field peaks at ninety degrees to the axis of rotation which is
typical of a dipole field. At larger radii the field falls as 1/r3. The interior field
is largely negative and rises as r2, matching the exterior solution at radius of
a.
The fields Ex and Ey are evaluated after being derived symbolically from
the potential. Both fields on the z axis at x equal to zero are shown in Figure
3.22. Clearly the tangential field is continuous, while the normal field is
discontinuous, though the potential itself is continuous. The net result is to
decrease the fields in the dielectric.
The user is encouraged to try some limiting cases and see if intuition is
verified. For K equal to 1, there should be no boundary. For finite K, Ez will
be discontinuous at the boundary while Ex is continuous. For a very large K, a
conductor is approached as a limit, so that Ex (0) approaches zero in the upper
half plane.
Figure 3.21: Potential as a function of x and z for a charge at z = 1 above a half plane with dielectric
constant of 4.
3.11. Dielectrics
The electric fields derived from the potentials are plotted in Figure 3.24,
which used the MATLAB plotting utility “quiver”. The fields are not
perpendicular to the outer, green boundary. They also have a large angular
dependence. Inside the conductor the fields are zero to the level of numerical
accuracy.
The electric fields of Figure 3.26 are again derived from the potential using
the numerical MATLAB utility “quiver”. The interior fields are horizontal,
and the vertical field is essentially zero. The induced surface charge goes as
the cosine of the angle as does the external electric field.
3.13. Induction
An electromotive force, EMF, is induced in a circuit when magnetic flux lines
are time dependent, an effect first shown by Faraday. Consider the simple
case of a moving charge, q, which creates both electric, E, and magnetic, B,
fields
Figure 3.26: Electric fields for a dielectric sphere with constant K equal to five immersed in a uniform
electric field along the z axis. The field inside the sphere is non-zero and largely along the z axis.
The EMF is proportional to the magnetic field (flux lines) and the particle
velocity (rate of change of flux lines), which makes it proportional to the
square of the particle velocity. A simplified model is provided by the script
“EM_Induction”. A charged particle crosses the centerline of a rectangular
loop of conductor at a user supplied height and velocity. Non relativistic
motion is assumed and low velocity forms for the fields are used. Plots of the
EMF induced by the moving charge appear in Figures 3.27 and 3.28 for a
velocity of two and heights of 0.2 and 0.5 above the loop, where the loop has
area one, respectively. Note the reduced value of the EMF and the wider time
structure for the case of a height of 0.5 compared to a height of 0.2. The EMF
appears as a movie tracking the motion of the charge.
Figure 3.27: Induced EMF for a charged particle crossing the center of a conducting loop with
velocity 2 and at a height 0.2 above the loop.
The user can establish the velocity dependence of the induced EMF
through the user supplied velocity in the dialogue and by viewing the
resulting plots which are movies with equal time difference between the
frames shown as blue o.
The sun is a fusion reactor, where the plasma is contained by gravity. The
required temperatures are very high for high fusion rates because the thermal
energies must overcome the Coulomb repulsion of the charged reaction
products. Therefore, confinement on earth must be accomplished by non-
material means, such as magnetic fields. We simply assume that a plasma is
confined in a magnetic bottle and the temperature is raised by external electric
fields. The script appears in “Fustion_ITER” where ITER refers to an
experimental fusion reactor being built in France.
Figure 3:30: Trajectory for a specific example of a particle in a “magnetic bottle”.
Figure 3.31: Velocities in the magnetic bottle for initial positions, [0.5, 0, 0] and velocities [0, −0.4, 3].
Figure 3.32: The printout made by the script “Fusion_ITER” showing the exothermic reactions. The
user chooses the temperature and density of the deuterium plasma.
The reaction rate per unit volume is computed by using the MATLAB
facility “quad” to integrate over the spectral reaction rate which is formed
from the Maxwell–Boltzmann energy distribution convoluted with the d + d
(d denotes deuterium) cross section energy dpenendence. The d + d reaction
cross section is roughly constant at about 0.001 barns for energies above
about 20 keV. The reaction rate as a function of deuterium energy is shown in
Figure 3.33. Also shown, red *, is the mean energy at the user defined
temperature, 〈E〉 = 3kT/2. It is clear that the maximum of the reaction rate
occurs at a higher temperature due to the sharp rise in the d-d cross section
with energy.
The reaction rate for d-d fusion as a function of both temperature, which
sets the thermal energy distribution, and energy, which reflects the reaction
cross section, appears in Figure 3.34. Clearly the fusion rate increases very
rapidly with energy, which puts a premium on achieving the highest contained
plasma temperature possible. For example, a 100 million degree plasma with
a density of 1022 deuterons per cubic meter would generate thirteen
megawatts in a cubic meter of fuel. A factor of two more temperature raises
that to about one hundred watts per cubic meter. That is a truly impressive
power density.
Figure 3.33: Reaction rate density as a function of d-d C.M. energy. The peak is at about 50 keV,
substantially above the mean energy at the chosen temperature, shown as a red *.
Figure 3.34: Reaction rate density as a function of d-d C.M. energy. At high temperatures, the rate
increases very rapidly.
Figure 3.35: Radiated angular pattern for a dipole when r and 1/k are greater than the size of the
dipole itself.
Figure 3.36: Radiated angular pattern for a dipole when r and 1/k are greater than the size of the
dipole itself. The wave crests move out with the velocity of light and reflect the dipole oscillation
frequency, seen here in red.
The relative phase of two antennas and the distance between them allow the
designer to set up the enhanced directionality of the overall power with
respect to the angular distribution of a single dipole antenna. This ability can
be useful when it is desired to “beam” a signal to a specific direction. The
electric field, expressed in Eq. (3.13), has a phase set by the wave vector, k,
the distance between the two quarter wave antennas, d, located at ±d/2 on the
x axis and the relative phase of the driving function for the two antennas, δ.
The resultant is a radiative solution, so that the electric field times radius, r,
has no r dependence
A contour of the field is shown in Figure 3.37 for the case when the script
“Two_Dipoles” is run with kd = 5 and zero relative phase. The shape is shown
in the surface plot in Figure 3.38.
A surface plot with a choice of kd = 5 and 3 radians of relative phase is
shown in Figure 3.39. The direction of the resultant radiation is indeed
changed very significantly, thus illustrating how one can beam a signal by
controlling the phase between the driving power of the two antennas.
Figure 3.37: Contour plot of the resultant electric field for two antennas with spacing, kd = 5, and no
relative phase. The pattern is distinctly not a simple dipole pattern.
Figure 3.38: Surface plot of the resultant electric field for two antennas with spacing, kd = 5, and no
relative phase.
Figure 3.39: Surface plot of the resultant electric field for two antennas with spacing, kd = 5, and a
relative phase of 3 radians.
3.18. Dispersion
Figure 3.40: Superimposed movie frames, first red, last blue of the travelling wave in the case of δ = 1
and ω = 0.1, showing minor attenuation.
The travelling waves are shown just to illustrate the attenuation and the
velocity changes that occur with a change of the parameter δ. The wave is
monochromatic. For a wave packet made up of waves of different
frequencies, the differing attenuation and velocity of the different frequency
components would distort the initial packet with time.
3.19. Waveguide
Waveguides are metallic structures in which radio frequency electromagnetic
radiation propagates. For rectangular hollow conductors of transverse size an
in x and b in y with waves traveling along z the electric and magnetic fields in
z are:
Figure 3.41: Superimposed movie frames, first red, last blue of the travelling wave in the case of δ = 1
and ω = 1. The velocity is the same as Figure 3.40, but the attenuation is increased.
Here it is assumed that the fields are on the inner surface and inside the
conductor. There is a cutoff velocity, cut below which no travelling wave can
exist. The modes are defined by the integers (n, m) one of which must be
greater than zero. The transverse electric mode has the lowest cutoff
frequency and it is the most common mode employed in waveguides. For m =
1 and n = 0 the lowest frequency possible is ω > πc/a.
In the lowest transverse electric mode the z and x electric fields are zero as
is the y magnetic field. The spatial dependence of the non-zero fields is:
The transverse electric modes in a rectangular waveguide appear in the
script “Waveguide_TE”. The non-zero fields in this mode appear in Figure
3.42 for the users choice of aspect ratio, a/b, of one.
The lowest possible frequencies in the different modes appear in Figure
3.43. Basically, the waves must satisfy the boundary conditions and a
minimum frequency is needed if the wave is to oscillate from one wall to the
wall on the opposite side. Larger mode numbers mean that more oscillations
are needed which, in turn, means higher cutoff frequencies. In the figure a
specific choice of aspect ratio, a/b of one was made and the case was set by a
waveguide of one cm, which has a TE cutoff of 15 GHz.
Figure 3.42: Plots of the transverse, (x, y) dependence of the non-zero fields in the case of the lowest
(1,0) TE mode for a/b = 1.
Figure 3.43: Cutoff frequencies and contours in the TE mode for a specific, user chose, a/b aspect
ratio of the waveguide, in this case a/b of one. Modes up to (10,10) are plotted.
Previously it had been assumed that the fields inside a “perfect” conductor do
not penetrate the conductor. That is true in the case of static fields for perfect
conductivity. However, an electromagnetic wave exists in a conductor
although it is damped strongly.
The conductivity σ relates the current density, J, and the electric field, E, in
the microscopic form of Ohm’s law. The wave in the conductor has a complex
wave vector, k, which means that there is an exponential penetration of the
wave into the conductor by a characteristic distance d which is proportional to
the inverse of the imaginary component of the wave vector k. The form for k
in Eq. (3.18) is closely related to the previous discussion of dispersion, with σ
playing the role of the parameter δ in Eq. (3.14)
Figure 3.44: Printout for a specific user input specifying the two important parameters, material and
frequency.
Figure 3.45: Skin depth for copper as a function of the frequency of the incident wave.
This effect is called the “skin depth” for the conductor. The script which
looks at this effect is called “Skin_Depth”. The user is invited to choose the
conductor and the frequency of the incident wave. The printout of the script
appears in Figure 3.44.
A plot for copper over a wide range of frequency is also provided as shown
in Figure 3.45. It is clear that high frequency waves populate only the “skin”
of the conductor with typical penetration distances in microns. This is why
waveguides for MHz waves and higher frequencies need not be made of thick
metal. On the other hand, 60 Hz home wiring has fields that penetrate
centimeter distances with resulting implications for the hardware.
Chapter 4
“Big whorls have little whorls, which feed on their velocity, and little whorls have lesser
whorls, and so on to viscosity.”
— Lewis Richardson
“Turbulence is the most important unsolved problem of classical physics.”
— Richard Feynman
Figure 4.1: Printout of a user choice for “Box_Leak”. The reduction in the mean momentum of the
molecules remaining in the box is clear.
Printout from the script “Debye” is shown in Figure 4.5. Both the Einstein
and Debye expressions for specific heat are computed and plotted. The
integral expression in the Debye case is evaluated numerically using the
MATLAB utility “integral” since the expression does not have a closed form
symbolic solution.
Figure 4.5: Printout from the script “Debye” with the user defined temperatures for the Einstein and
Debye specific heats.
Figure 4.6: Einstein and Debye specific heat as a function of the absolute temperature of the sample
expressed in thermal energy units.
The specific heat vs. temperature for the two models is shown in Figure
4.6. Note the rapid falloff of the specific heat in the Einstein case, while the
Debye theory displays the power law behavior of the experimental data in this
log-log plot.
Figure 4.7: Initial distribution of molecules confined to the lower half of a container.
Figure 4.8: Distribution of 100 molecules in a container after 100 time steps.
4.5. Compressibility
The compressibility of materials can be related to the fundamental structure of
the solid. A simple case is that of an ionic crystal where the positive ions have
a regular structure, with a onedimensional separation Ro. Overall ionic
neutrality is assumed and a simplified one-dimensional model is used. The
ionic cores repel strongly with an inverse power of separation with exponent
n. The electron-ion attraction falls off much more slowly, with an energy, E,
which goes as the inverse of the separation. The electromagnetic interaction
involves several ionic cores due to the long range of the interaction.
The Coulomb part has a sumable series, b = 2 ∗ ln(2). The minimum of the
energy, Eo, for a given ion occurs when E is minimized with respect to R:
Figure 4.9: Printout from the script “Compress.” The user chooses an equilibrium radius in Å.
The value of Ro can be obtained by x-ray scattering patterns. The
compressibility can then be predicted for different n values. It is amusing that
a macroscopic measure of K allows for the measure on the microscopic core
repulsion power law n. The energy as a function of R is shown in Figure 4.10.
There is a clear minimum where the core repulsion is balanced by the
Coulomb attraction of the nearest neighbors, diluted by the next to nearest
neighbors.
Figure 4.10: Potential energy for an ionic crystal showing the core repulsion at small R and the
Coulomb attraction at large values of radius.
Figure 4.11: Contour of the modulus in Pa as a function of n and R. The modulus increases with n and
decreases with R.
4.6. Viscosity
Viscosity, η, is a measure of resistance to motion through a medium. In
ballistics, it leads to a terminal velocity when acceleration becomes zero. It
can be measured, for example, by measuring the terminal velocity and also be
several other means. It depends on temperature through the mean velocity of
the medium, 〈v〉, and it depends of the diameter, d, and mass, m, of the
objects which make up the medium. That means knowing the viscosity, the
size, diameter d, of the molecules in a gas can be indirectly measured
Figure 4.12: Printout from the script “Viscosity_Molecule” for two choices of Å made by the user.
Figure 4.13: Change in apparent molecular size with temperature. A slow square root dependence on T
is shown.
4.7. Water Waves
Water waves are explored for waves in deep water, where the relationship of
the frequency of the wave to the wave vector is or in shallow
water where and h is the water depth. The expression for the
incremental wave height z due to an initial disturbance, A(k), as a function of
r and t is:
The water waves are studied in the script “Water_Waves” which employs the
MATLAB functions “besselj” and “int” to perform the necessary integration.
The amplitude, A(k), of the initial wave is a sharply peaked Gaussian in k2,
which gives an approximate delta function in r at t equal to zero as an initial
condition. The dispersion of water waves is taken into account by the
relationship shown in Eq. (4.8), where the frequency approaches the deep
water result without dispersion for long wavelengths, kh much less than one.
Figure 4.15: Wave height of water wave as a function of r for deep water; last frame of a movie. The
velocity is less than that of Figure 4.14 and the radial structure is more oscillatory.
4.8. Semiconductor
The use of semiconductors in the electronics industry is ubiquitous. A very
small introduction to the topic appears in the script “Semiconduct”. By
intrinsic, is meant a perfect crystal of silicon or germanium without crystal
defects and without any impurities. In this case there are, at a temperature of
zero, all valence electrons in a “valence band” of allowed energies and no
electrons in a “conduction band” of allowed energies the lowest energy of
which is at an energy Eg higher than the top valence band energy.
At elevated temperatures, some electrons receive sufficient thermal energy
to exist in the conduction band and to contribute to electrical conductivity. At
zero temperature such electrons are “frozen in” the valence band by the Fermi
exclusion principle since all available states in that band are filled. At low
temperatures the Fermi-Dirac statistical factor is approximately,
while the density of states factor for electrons arises from the statement that
all momentum components are equally probable, so that
is the density in momentum space, while in
energy space the density is proportional to
Figure 4.16: Mesh plot for a water wave in deep water. The frame corresponds to that of the previous
figure, Figure 4.15. There is no dispersion and the wave crests are quite sharp.
The number of holes remaining in the valence band, assuming the same
effective mass for holes in the crystal as for the electrons in the crystal is:
Using the values for the energy gap, Eg, in silicon, 1.1 eV, and germanium,
0.7 eV, at STP a conduction band density of charge carriers is expected to be
about 1.4 × 1016/m3 and 2.5 × 1019/m3 respectively. This density should be
contrasted with Avogadro’s number of about 1023. The product of the hole
and electron densities depends only on the temperature and the gap energy as
can be seen from Eqs. (4.9) and (4.10). This fact will be used later in
discussing a junction between two “doped” semiconductors.
It is clear that the addition of impurity states at the level of greater than
1018/m3, if these states are near the top of the valence band or the bottom of
the conduction band, but still in the gap would completely dominate the
intrinsic conductivity of the crystal. Indeed, this is how the n type and p type
semiconductors are created.
The script “Semiconduct” explores these concepts. Printout from the script
appears in Figure 4.17. The user chooses the gap energy, in this case that of
silicon. The addition of more electrons in the conduction band, due to added
impurity states changes the Fermi level, in this case increasing it, as can be
seen from Eq. (4.9). The equation shows that the Fermi energy depends
logarithmically on the density of charges. The change is small in most cases,
however, and a constant Fermi energy appropriate to T of zero can often be
assumed.
Figure 4.17: Printout from the script “Semiconduct” where the user has chosen a gap energy
appropriate to silicon. STP conditions are assumed.
Figure 4.18: Log of the electron number density as a function of temperature for silicon.
Figure 4.19: Log of the intrinsic number density of electrons for a semiconductor as a function of
temperature and gap energy. STP has a kT of 0.025.
The electron charge is e, the charge density is ρ, ε is kεo, where k is twelve for
silicon, and εo is the vacuum permittivity. The voltage V exists can, in first
approximation be defined purely by the positive ions with density Po. Since
the Fermi energies on the n and p sides of the device differ, Eqs. (4.9) and
(4.10), a diffusion of charge carriers across the n/p boundary defines a dipole
layer of charge at the border which acts to equalize the Fermi energies. Both
the positive p and negative n charge carriers diffuse at the location x of zero,
where the n/p junction occurs and where they have equal densities no.
Starting with the approximation of ignoring the mobile charge carriers, the
field and potential in the case of full depletion, solving the Poisson equation,
when the field extends from the junction throughout the diode, of full width d,
is shown in Eq. (4.12). The coordinate x is zero at the junction. The field
extends throughout the size of the junction at full depletion. Equal doping
densities on both sides of the junction are assumed as are equal lengths of the
n and p sides.
The field is largest at the junction at x of zero and decreases linearly to zero at
the device boundary at +d/2 and −d/2 at full depletion. The potential is
quadratic in x and vanishes at the origin. The printout for the script
“n_p_Junction2” is shown in Figure 4.20 for a specific user set of choices.
The field at x of zero is printed out as is the voltage. The device voltage is
twice that.
The approximate voltage for the junction at depletion, where the mobile
carriers are swept out of the device, is shown in Figure 4.21. The voltage is
quadratic and vanishes at the junction. The fixed ionic charge density is also
shown schematically. The specific parameters chosen are a one hundred
micron device with an ion density of 5 × 1017 ions per cubic meter. The
density of donor and acceptor ions is assumed to be the same.
Taking the mobile charge carriers into account requies a numerical solution
to the full equation, Eq. (4.11). This is accomplished by using the MATLAB
ode45 utility. The user supplies the density of mobile carriers at the junction
boundary as well as the amount by which the maximum electric field is
reduced from the approximate full depletion value. That value defines the
equation and sets the initial conditions for ode45, along with V(0) = 0. The
actual density at the boundary is only estimated by the user.
Figure 4.20: Printout for a specific user chosen set of junction parameters.
Figure 4.21: The approximate voltage at depletion for the 100 micron junction. In this case the device
depletion voltage is about 2 × 1.9 = 3.8 volts. The left side is N type and the right side is P type —
referring to the fixed ions or p type and n type, referring to the mobile carriers.
Results for the electric field appear in Figure 4.22. Note that the field at
small x is linear as before, and an approximate proportionality of the field at x
of zero and the depletion region holds. In the example the depletion of mobile
carriers by the field is not complete but extends only over about half of the
full device. At large distances from the junction the density of mobile carriers
apporaches the donor density. Other sets of parameters can easily be explored.
The field and potential and n and p densities are calculated only for the
positive x or P type region. For negative x, symmetry can be invoked.
Figure 4.22: The electric field found numerically in the case where mobile carriers are taken into
account. The field near x = 0 is linear. The parameters for the example are given in Figure 4.20.
Figure 4.24: Output resulting from a dialogue with the script “n_p_Diode”. The user chooses a
junction thickness and doping density. An applied voltage is also chosen.
Figure 4.25: Fermi energies for the intrinsic case (dotted line) and for n and p type doping (dashed
line) for silicon and doping levels as given in Figure 4.24. The bottom of the valence band (VB) and the
top of the conduction and (CB) are indicated by solid lines.
The script asks for an applied voltage. It can treat forward values, V > 0, and
small values of reverse voltage if it is less than Vbi.
The practical problem of how deep in the ground to lay in water pipes is
explored in the script “Pipe_Freeze”. There is an analytic solution to this
problem. The heat equation is shown in Eq. (4.13) below where T is
temperature, t is time and x is position. The basic parameter is a which has
dimensions length squared over time which is called the diffusion coefficient.
In this case a is about 2.4m2/year or 7.6 × 10−8 for a typical soil. A basic time
scale to transfer temperature by one meter is then 0.24 yr.
The initial condition is a temperature at all depths, by assumption, of To.
The boundary condition on the surface, x of zero, is a seasonal change of
temperature, ΔT from summer to winter, with t in years.
The printout of the initial dialogue for “Pipe_Freeze” is shown in Figure 4.27.
The temperature below ground is tracked for a number of years and the depth
for which the temperature just reaches zero is printed which is about 0.76
meters. The surface temperatures are assumed go from −15°C to 35°C
through the seasonal cycle.
The solution is shown in Eq. (4.15). In this case To is the mean surface
temperature of 10°C and the temperature swing is plus and minus 25°C. The
frequency ω is the seasonal driving frequency.
Figure 4.28: Time dependence of T at a depth where the minimum temperature is just at freezing.
Note the time lag with respect to surface temperatures at this depth.
The cooling of the Earth as heat diffuses into space is considered in the script
“Cooling_Earth_Int”. A series solution to the heat equation is evaluated with
thirty terms in the series shown in Eq. (4.16). The initial condition is that the
Earth’s temperature, TE, is uniform on the surface at r equal to R. The
temperature difference between the Earth and space, Ts, is taken to be three
hundred degrees absolute at time zero. There is a characteristic time, τ, which
depends on the radius of the Earth and the diffusion coefficient. For
reasonable values of the coefficient a the time is one hundred and thirty
billion years, even neglecting internal heating as is done here
The solution is a series in radius and time factors. The radial terms are
spherical Bessel functions, using the MATLAB utility “besselj”, of argument
(nπr/R) as is expected in the spherical geometry. The temporal terms are
exponentials with arguments (n2t/τ), so that the series converges rapidly in
time.
The results for thirty terms in the series are plotted below. In Figure 4.30
the last frame of a movie shows the temperature in the interior. The surface
has cooled to zero absolute but the central interior is still above one hundred
degrees absolute. A mesh plot of the temperature as a function of time and
depth appears in Figure 4.31, showing rapid surface cooling.
Figure 4.30: Temperature distribution, absolute scale, inside the Earth after 200 billion years.
Figure 4.31: Temperature distribution inside the Earth as a function of radius and time. Initially the
Earth is at a uniform temperature. As time goes on, the surface temperature falls rapidly, while the core
temperature is maintained for a long time.
The exterior temperature as the Earth cools is formally very similar to the
previously quoted interior solution. The Earth is taken to be a uniform sphere
and the time scale is the same as before. The initial conditions are that the
temperature at the surface is TE at time zero and that at late times the
temperature at radius R approaches Ts. The solution is again a series of
spherical Bessel function terms spatially, and exponential decaying factors in
time, just as before.
The results for the exterior, with the same parameter values as taken for the
interior solution shown previously appear in Figure 4.32. The mesh plot is for
a series with thirty terms and with radial values greater than R. At radius of R
there is a smooth decrease in temperature as there was in the interior case. At
values of r greater than R, the temperature falls, with structure due to the
Bessel functions. Only the very first few terms are important because the
exponentially decreasing time factors damp out the higher order terms.
Figure 4.32: Surface of exterior temperatures for a cooling earth. The radii are greater than the earth’s
radius R. The characteristic time scale is 130 billion years as before.
Figure 4.33: Menu of initial temperature functions (left). Dialogue for the “Heat_Diffuse_pde” script
for a specific set of user choices (right).
Figure 4.34: Temperature as a function of x and t for an initially uniform distribution.
The script “Heat_Cond2” uses the MATLAB solver for a partial differential
equation much as in the “Heat_Diffuse_pde” script and describing a bar of
conductor of length L. However the initial conditions in this case are that the
bar temperature is zero, while the boundary conditions at x near L is that the
end heats very rapidly to TL, while the temperature at x of zero is held at zero.
The problem approximates the heating of a rod as heat flows into the rod
which has fixed temperatures at both ends of the rod.
The printout for “Heat_Cond2” appears in Figure 4.36, where the user
chooses the length of the copper rod and TL. The TL heating time is small with
respect to the time to relax to equilibrium. The characteristic relaxation time
is 1/a(π/L)2, in this case 250,000 seconds. A movie is provided of the time
development of the temperature. The printout defines the initial conditions,
IC, and boundary conditions, BC.
A mesh plot for the parameter choices made in the dialogue, Figure 4.36 as
a function of x and t is shown below in Figure 4.37. As can be seen the ends
of the rod are fixed at five hundred degrees and zero degrees. As time
increases, the temperature along the rod approaches the equilibrium solution
of a linear temperature distribution.
Figure 4.36: Printout of the dialogue for a set of specific parameter choices for the script
“Heat_Cond2.
Figure 4.37: Mesh plot of the temperature as a function of position along the rod and time since initial
heating of one end of the rod. The temperature along the rod near x = 0 increases until a linear
temperature dependence on x is obtained.
In this script, “Heat_IC”, the heat equation is solved for the case of a
symbolic, user supplied, initial temperature distribution in x from x of zero to
x of L. The solution, T(x, t) is by separation of variables and series solution.
The assumed boundary conditions are that the partial derivative of T as a
function of x for all t are zero at x of zero and L. No temperature flows out of
the defined region. The series has Cartesian Fourier spatial terms and
exponential temporal terms as seen in Eq. (4.17). The characteristic time for
the problem is (L2/απ2). The A coefficients are solved for symbolically using
MATLAB “int”.
Figure 4.38: Printout provided by “Heat_IC”. The initial temperature distribution is symbolic and
provided by the user as a function of x.
Figure 4.39: Mesh plot for temperature as a function of x and t for a user defined initial distribution,
T(x, 0) = |x − 1/2|2. Note that the equilibrium temperature is non-zero since the initial temperature has a
non-zero average value and no heat flows out of the rod.
Chapter 5
Waves
“If you want to find the secrets of the universe, think in terms of energy, frequency and
vibration.”
— Nikola Tesla
“Sit in reverie and watch the changing color of the waves that break upon the idle seashore of
the mind.”
— Henry Wadsworth Longfellow
where m is the point mass, k the spring constant and a is the equilibrium
separation of the mass points. It is amusing to notice that the grid method of
solving partial differential equations uses the spatial part of the second order
partial spatial derivative. In the present case the aim is to go to the continuum
limit, but actual numerical solutions go the other way on a discrete grid.
The longitudinal motion of the mass points is displayed as a “movie”. Only
the fourth mass point is displaced initially and all initial velocities are zero.
The equilibrium separation, a, is defined to be equal to one. The user supplies
the ratio k/m and that defines the characteristic time scale, The
motion of the springs is followed for five such times. The user also supplies
an initial displacement of spring #4. In the example shown it is 0.01. The last
frame of that specific movie is shown in Figure 5.1 where the displacements
are magnified by a factor fifty in order to make them more visible. The movie
makes the outgoing left and right waves very clear.
Figure 5.1: Last frame of a movie with initial displacement of the fourth mass point by 0.01a.
Figure 5.2: Plot of the position of mass point #2. Initially it does not move and then the longitudinal
wave reaches it and it is elongated, then compressed. Note that the displacement is greatly magnified.
Figure 5.3: Plot of the position of mass point #1. Initially it does not move and then the longitudinal
wave reaches the mass, after the wave has hit mass #2. There is first elongation followed by
compression. Note that the displacement is greatly magnified.
5.2. Transverse Slinky
The transverse oscillation modes for a short “slinky” are studied in the script
“Transverse_Slinky”. This script uses the MATLAB function “eig” to find the
eigenvalues and eigenfunctions for N = 2, 3 mass points connected by springs
with the end mass springs fixed to rigid walls and with k/m = 1 for the
springs. The eigenvalues for an N of two and three are shown in Figure 5.4,
while the eigenfunctions are graphically displayed in Figure 5.5 for N = 2 and
Figure 5.6 for N = 3.
In the case of N equal to two, the eigenfunctions are transverse motion in
the same or opposite directions. In the case of N equal to three, the central
spring is stationary for the lowest state and the two outer springs have
opposite displacements. For the next lowest eigenvalue, the two outer springs
have the same displacement, while the middle mass has the opposite
displacement. With the largest eigenvalue, all three mass points have the same
sense of displacement.
Figure 5.5: Eigenfunctions for N = 2 mass points. The end points are fixed by springs attached to rigid
walls. The lowest eigenvalue is shown as a dotted line.
5.3. SR — Doppler
The Doppler effect is well known in everyday life. However, there are
additional changes to that picture as the source velocity approaches that of
light. The ratio of the frequencies in two inertial frames moving with a
relative velocity v = β/c is:
Figure 5.6: Eigenfunctions for N = 3 mass points. The end points are fixed by springs attached to rigid
walls. The eigenfunction for the lowest eigenvalue is dashed, followed by dashed and solid for the
higher eigenvalues.
Figure 5.10: Amplitude for the damped, driven oscillator in the specific case of a = 0.2, b = c = 1.
Figure 5.11: Radial velocity of the wave in the fluid for a driving frequency of 3. The sphere is of
radius 1 and the velocity is zero for r < 1.
Figure 5.12: Printout of an example of the dialogue from the script “Rectangular Drum”.
Figure 5.13: Solutions to the 2-dimensional wave equation in rectangular coordinates and with
rectangular boundary conditions imposed. The choices made are: size is 1 in x and 2 in y. The modes are
2 in x and 3 in y. There are 2 extreme values in x and three in y.
5.7. Piano
The script “Piano” approximates the motion of a piano string which is struck
by an impulsive force, the piano hammer, at location axo along the string. The
string is held at x = 0 and x = L where L is taken to be one in the script. The
velocity of waves on the string is c, taken here to be equal to one. The
solution for the displacement of the string, y(x, t) depends on the location of
the hammer and the time t. The impulse is approximated by a function which
is large only for times < π/q where q is chosen to be very large. The time t is
zero at the end of the impulse and the string position, y, is plotted only for t
greater than zero. The series solution for the piano string displacement
appears in Eq. (5.6). The boundary conditions are satisfied by the sin terms in
the series, while the initial quasiimpulse is set by the cos term.
A movie is produced after the initial impulse position is chosen and the
number of terms in the series is defined. The last movie frame in the cases of
xo = 0.2 and ten and fifty terms respectively are plotted in Figures 5.14 and
5.15. Note that the waveform is much sharper in the latter case since the
Fourier series is more accurate because of the increased number of terms. No
dissipation has been assumed in this script.
The movie for the time development of the string exhibits the travelling
wave behavior both to increasing x and decreasing z and the reflections off the
ends of the string where it is held to zero displacement.
Figure 5.14: Initial amplitude of the piano string using 10 terms in the series representation and initial
x = 0.2.
The azimuthal angle, φ, is the angle of the electric field of the incident wave
with respect to the outgoing wave vector x axis and is taken to be zero. The
angle θ is the spherical polar angle of the wave vector downstream of the
aperture. The MATLAB utility “besselj” is used to evaluate the numerical
values of the radiated power.
Figure 5.15: Initial amplitude of the piano string using 50 terms in the series representation and initial
x = 0.2.
Figure 5.16: Radiated power for the case of ka = 1 and zero incident angle. There is a forward
diffractive peak in θ and a dependence on φ.
Figure 5.17: Radiated power for the case of ka = 1 and a 45 degree incident angle. The peak is still
forward but wider angles are now more probable.
5.9. Antenna
The power radiated by a center fed linear antenna is displayed using the script
“Antenna”. The antenna length is L; the antenna resistance is Ro; and the crest
current at the antenna midpoint is Io. The length L is in units of the driving
current wavelength. Printout of the script appears in Figure 5.18. The printout
displays the angular distribution of the radiated power for a user defined
choice of wavelength.
The angular distribution of the radiated power in the case where kL = 0.1 is
shown in Figure 5.19. The pattern goes as the square of the sin function as
expected for dipole radiation. The total radiated power is shown in Figure
5.20 as a function of kL. A closed form is not available in this case, so that the
MATLAB numerical utility “quad” is used to integrate the angular
distribution. The power increases rapidly with kL. For kL < 1 the approximate
results for the angular distribution and the total power are quoted in Eq. (5.8).
The total radiated power goes as the square of the antenna length, with a scale
set by the wavelength of the radiated waves.
Figure 5.20: Radiated antenna power as a function of kL. The semilog plot in y indicates the strong L
dependence.
Simple dipole antennas are quite isotropic in their radiation pattern as seen
above for small values of kL. The use of two antennas with controlled phase
between them was already explored in Section 3.17. In that case, substantial
directionality could be obtained. However, often one wishes to more tightly
“beam” a radio or other signal to a specific angular range. This can be
accomplished by having different waves from different parts of an antenna
array interfere with one another. In the specific case of an array of N quarter
wave, λ/4, antennas separated by spacing a and with relative phases φo, the
resulting intensity, I, is shown in Eq. (5.9).
The full array pattern can be thought of as N slit diffraction due to the
contributions of the N line sources. There is a maximum of I at the sin of the
angle equal to 2(1/N − φo/π). The pattern depends on N, the total number of
antennas, and the relative phase of the antennas, φo.
The script “Antenna_Array” allows the user to choose both the number of
members of the array, and the phase of the elements. Radiated power patterns
are shown in Figures 5.21 and 5.22. It is obvious that with a large number of
elements in the array, very tightly beamed power can be obtained. By varying
N, the user can watch the change in the power angular distribution. Clearly,
this beaming technique has important practical implications.
5.11. Lissajous
The solutions are shown in the script “Lissajous” as movies where the user
chooses the parameters for the x and y harmonic oscillations. The patterns
may be re-entrant, but need not be. A plot of (x, y) for a specific case is the
last frame of the movie generated with an amplitude ratio of two, a phase
difference of π/2 and a frequency ratio of four is shown in Figure 5.23. Such
plots are familiar to devotees of old science fiction movies where
oscilloscopes are driven in (x, y) to make amusing “laboratory” displays.
Figure 5.23: Plot of (x, y) for simple harmonic motion in 2 dimensions with differing amplitudes (2×),
phases (π/2) and frequencies (4×).
Figure 5.25: Results of the dialogue for the script “Damped_Forced_SHO”. There are 4 cases; no
damping, no driver, damping, no driver, driver no damping and finally damping with a driving force.
Figure 5.26: Wave forms for the 4 specific cases given in Figure 5.25.
For the driven case, after the transients have died down, the amplitude y
follows the driving force amplitude and frequency. In the absence of damping
the amplitude can become very large if the driving frequency is near the
natural frequency (resonance), while damping limits the amplitude, as seen in
Figure 5.26.
Chapter 6
Quantum Mechanics
6.1. Box
The script “QM_Box” uses the MATLAB symbolic mathematics utilities to
evaluate expectation values for a particle in a onedimensional box in the
ground state or n = 2, 3 or 4. The box boundaries are (−a/2, a/2). The
expectation values for x, momentum p, x2, and p2 are calculated symbolically.
The energy is evaluated and the uncertainty of the ground state, defined in Eq.
(6.1), is explicitly evaluated.
Printout from the script appears in Figure 6.1. The energy is printed along
with the wave function and normalization. Additional printout appears in
Figure 6.2, where the expectation values of position and momentum are
computed for the ground state, n = 1. Other states are available for the user to
choose from. In the ground state the basic Heisenberg uncertainty relation is
confirmed:
The probability to observe the classical particle goes as 1/v, which means it
is mostly near the turning points. Quantum mechanically, the solutions are
Hermite polynomials, which are available using the MATLAB Maple
functions, mfun(‘H’, n, x).
Figure 6.2: Additional printout from the script “QM_Box” for the case of the ground state, n = 1. The
uncertainty principle is explicitly confirmed.
The quantum solution is not limited to be at x values less than the turning
points. Indeed looking at the Schrödinger equation and ignoring the energy E,
the solution is clearly the Gaussian appearing in Eq. (6.4), d2ψ/dx2 ~
2m(kx2)ψ/2. The Hermite polynomials are corrections to the basic Gaussian
behavior of the wave functions.
Figure 6.4: Plots of probability for a classical simple harmonic oscillator and for the n = 20 quantum
case.
6.3. Bound States — 3d Well
The bound state of a three-dimensional square well of radial size a can be
solved, but not in closed form in analogy to the onedimensional square well
of finite depth. The potential is equal to Vo for r less than a and zero
otherwise. The solutions are spherical Bessel functions inside and Hankle
functions outside the well which can be accessed using the MATLAB
functions “besselj” and “besselh”. For the ground state the radial wave
function R, is not used but rather the function u:
The solution for the ground state is found using the script QM_Square_3d.
The script applies the MATLAB utility “fminsearch” to evaluate the energy E,
less than zero for a bound state, that satisfies the condition that arises when
requiring the wave function and derivative to match at the boundary at r = a.
The starting value given to “fminsearch” is taken to be the solution for an
infinite square well
Printout from the script is shown in Figure 6.5. Several solutions for a
value of a of 1A are shown. For a well depth of 10 eV the state is barely
bound, while for a 24 eV well depth the binding energy is 6.46 eV.
Figure 6.5: Printout for some specific choices well depth and extent for the ground state.
The radial wave function rR for the barely bound case is shown in Figure
6.6. The wave function falloff outside the well is very slow since the barely
bound state can easily “leak” outside the well. More deeply bound states are
more localized to be in or near the well.
To make the comparison concrete, the deeply bound example of a one
Angstrom well 24 eV deep is shown in Figure 6.7. In this case the falloff of
the wavefunction outside the well is much faster than in the previous plot, as
expected.
Figure 6.6: Wavefunction for the ground state of a 3d square well when the state is barely bound.
Figure 6.7: Wavefunction for the ground state of a 3d square well when the state is bound by 6.47 eV.
6.4. Identical Particles
In quantum mechanics identical particles obey restrictions on the wave
functions describing their states. A simple example is to consider two
particles confined to a “box” in one dimension. The solutions are sin and cos
functions which vanish at the boundaries of the box. Independent particles
would be described by product wave functions since the joint probability in
such a case is simply the product of the individual probabilities.
However, in quantum mechanics identical particle wave functions must be
either symmetric or antisymmetric under the interchange of a pair of particles.
The Greek subscripts indicate the state and the labels 1 and 2 identify the
particle in that state. There are two possibilities; bosons have the plus sign for
symmetric wave functions under particle interchange while fermions are anti-
symmetric.
The wave function contours for several cases are explored using the script
“QM_Identical”. The user chooses the states to be explored for the box and a
plot is made of the resulting wave function contour. The contour for both
particles in the ground state is not shown since it vanishes for the
antisymmetric case which is the Fermi exclusion principle. For the n = 1 and
n = 2 states of the box, the product contour for classical considerations
appears in Figure 6.8. In this case particle 1 and particle 2 are uncorrelated. In
contrast the contour for the antisymmetric case is shown in Figure 6.9. In this
case there is a sort of “repulsion” when the coordinates are equal. Finally, for
the symmetric case, n = 1 and n = 3 states are plotted in Figure 6.10. Clearly
the symmetries imposed on the states of quantum identical particles have
profound implications for the physics of a system of such particles.
Figure 6.8: Contour of the system wave function for n = 1 and n = 2 for a product wave function. The
axes are uncorrelated.
More printout of the script appears in Figure 6.12. The MATLAB solutions
for the eigenvectors, V, and eigenvalues, D, are shown.
A plot of the eigenvectors is shown in Figure 6.13. There is an isotropic
part with l = 0 and a part with angular dependence. The two perturbed
solutions are not symmetric about ninety degrees as the unperturbed
eigenfunctions are. That asymmetry means that the electrons have a centroid
away from the origin and the displaced charge means that there is an induced
dipole moment which is first order in this case. The alignment of the electrons
can be either parallel or antiparallel to the external electric field.
Figure 6.10: Contour of the system wave function for n = 1 and n = 3 for a symmetric wave function.
The wave function is correlated, being large when the coordinates are similar.
Figure 6.12: Solutions of the perturbation theory eigenvalue equations for the n = 2 hydrogenic atom.
In the approximation that the initial binding energy is small with respect to
the initial photon energy and the final electron energy the continuum electron
takes all the initial photon energy.
The cross section for this process, dσ/dΩ dω, is evaluated in the script
“Continuum_pe_effect”. Printout from that script appears in Figure 6.17. The
atom is assumed to be initially in the ground state, with a wavefunction which
is hydrogenic except that the full Z attractive protons are assumed to be
active. No screening of the nuclear charge by the other electrons is assumed,
so that the Bohr radius, ao, is reduced by a factor Z.
Figure 6.15: Angular distribution for scattering off a 3d square potential with ka = 1.
The user supplies values for the parameters Z and the photon energy in
mec2 units. Results for the choices Z = 90 and /mec2 = 0.01 and 10, 0.4 are
shown in Figures 6.18 and 6.19, respectively. In the first case the angular
distribution is a dipole like form reflecting the transverse nature of the electric
fields associated with the photon. In the second case the electrons are thrown
forward in a relativistic effect, the “searchlight” effect.
The dependence on the incident photon energy and the atomic number Z is
shown in the contour plot of Figure 6.20. The energy dependence is not very
strong, but the Z dependence shows a strong enhancement at low Z. This
effect arises because the “target” is smaller at high Z since the ground state
radius for an inner electron is reduced by Z because of the strength of the
attraction of the Z protons.
Figure 6.16: Angular distribution for scattering off a 3d square potential with ka = 10. In this case
there is a sharp, forward, diffractive peak.
Figure 6.17: Printout which shows the differential angular distribution as a function of the photon
energy, where alpha is the fine structure constant, and t is the polar angle.
Figure 6.18: Angular distribution for the case where Z is assumed to be 90 and is taken to be
0.01 and the process is in the non-relativistic regime.
Suppose that the state being described decays in time with a lifetime τ. The
reciprocal of the lifetime is called the width of the quantum state, Γ because
any unstable state will have a spread in energies of a magnitude about the
width. Expressed in the energy variable, the state has a spread in energies due
to the uncertainty principle and since the time of the state’s existence is
limited.
Figure 6.19: Angular distribution for the case where Z is assumed to be 10 and is taken to be
0.4.
That spread is called the natural width, which has a Lorentzian shape when
described using energy as the variable. In the time domain the wave function
is an exponential function.
6.9. Barriers
The problem of a series of barriers appears in solid state physics for ionic
crystals where they form a periodic potential. It can be approximately solved.
There is assumed to be a region of zero potential, where the solutions are
plane waves and a region where the potential Vo is greater than the energy E
so that there the solutions are exponentially damped in that region. Therefore,
the electrons are bound to the crystal. The coefficients at an interface between
the two regions can be found by requiring the continuity of the wave function
and its first derivative. There is oscillatory behavior with wave vector k and
exponential behavior with coefficient K. The incident waves with left going
and right going coefficient C and D connect to −x and +x exponentials with
coefficients A and B as;
Figure 6.21: Printout from the script “Line_width”. The transformation of the wave function from the
time domain to the energy domain is performed symbolically using MATLAB “int”.
Figure 6.22: Plot of the approximate energy width for hydrogen in the 2p → 1s transition. The
Doppler shift due to atomic thermal velocities dominates except at low temperatures.
The script “Barriers2” allows the user to set the geometry of the array of
potentials whose number is also to be chosen. The solution assumes the
barriers are quite “thin”, so that the exponent Ka is set to zero in the argument
of the exponential. The barrier height is fixed at 7 eV.
Results for two “thin” barriers are shown in Figure 6.23 while the
transmission coefficient for three barriers is displayed in Figure 6.24. In this
case the resonances are quite sharp at low energies where E is less than the
potential. The user is encouraged to explore a single barrier and also an array
of barriers where the exponential region is less “thin”. For example, a single
barrier with a region of size 4 Angstroms is shown in Figure 6.25 and looks
rather like the familiar transmission result for a single barrier. Looks
approximately like the solution of a barrier.
Figure 6.23: Transmission coefficient for 2 thin barriers, 1Å wide, separated by a 6Å free space. The
barrier height is 7 eV indicated by the red line.
Figure 6.24: Transmission coefficient for 3 thin barriers, 1Å wide, separated by a 6Å free space.
Figure 6.25: Transmission coefficient for a single barrier of width 4Å as a function of incoming wave
energy E for a barrier of height 7 eV.
In this formula the grid spacing is Δx. The grid form of the second
derivative was already seen when the discrete “slinky” was taken to the
continuum limit when the wave equation was “derived” in Section 3.
Figure 6.26: Menu for the script “Gen_Eigen2”. The printout for a specific SHO gives the first 3
eigenvalues.
Figure 6.28: Plot of the eigenfunctions for the first three solutions in the example of the specific two
well problem. The green function is the most deeply bound, followed by red and then blue.
Figure 6.29: Plot of the eigenfunctions for the case of a hyperbolic sin potential. The green function is
the most deeply bound, followed by red and then blue. The solutions are like those of the SHO.
Note that the “eigs” script orders the results with the highest energy first,
which means that asking for the first three eigenvectors is ordered with blue
as the highest energy, followed by red and then green. The user can choose
parameters defining all the other menu choices.
6.11. Koenig–Penny
Figure 6.30: Printout for a specific choice of the geometry and energy for the barrier height.
Figure 6.31: Relationship between energy, E, and wave vector, k, for a free particle (blue) and for a
particle bound into a one-dimensional periodic, constant potential (red). Energies in a band
approximately 1 eV wide near 2.5 eV are not possible.
Having found the wave vector k, the wave functions can be solved for at
any particular, user chosen, energy. For a specific energy in the allowed band,
1.5 eV, the wavefunctions are shown in Figure 6.32. The exponential region
for x = (−b, 0) and the oscillatory region, x = (0, a) match at x = 0. The
regions where the potential exists are indicated in red. The wave functions are
continuous and periodic. The solutions are derived from the matching
conditions, assuming A equals one, and using three of the equations to solve
for B, C and D using the MATLAB matrix inversion utility, “inv”, to solve the
three equations in three unknowns by matrix multiplication.
Figure 6.32: Wave functions for the specific case of parameters chosen for Figure 6.30. The function
is periodic and continuous across the 2 regions of potential.
Figure 6.33: Symbolic solution of the populations for the 3 species, a, b and c.
Species b and c are “fed” by species a and b respectively while decaying
with rates g and h. The equations are solved symbolically using the MATLAB
utility “dsolve”. The printout of that script appears in Figure 6.33. The user
can change the rates. For example, it is possible to depress the population of
species c by reducing the rate of species b which is the necessary “gateway”
for species c. A specific example appears in Figure 6.34.
Figure 6.34: Populations of the 3 species in the specific case for decay rates of 1, 0.6 and 0.5. Species
2 builds up first, followed by species 3, while species 1 decreases exponentially.
This effect has been measured and has physical implications. It is, as will
be seen, important only at very small plate separation. In fact even today, as
microelectronics feature sizes continue to decrease, the Casimir effect must be
taken into account by chip designers. This is truly an impact of quantum
virtual pairs of particle-antiparticle in what is now everyday life.
One estimate of the size of the effect is to sum all zero point energies
subject to boundary conditions that the wave functions vanish at the surface
of the conducting plates. The quantized frequency for plates normal to the z
direction, with separation d is:
Figure 6.35: Numerical results for a user defined input of plate separation.
Figure 6.36: Energy per unit plate area as a function of plate spacing d, showing the inverse cubic
dependence on d. With a spacing of 5Å the energy per area is −0.22 in eV and A units.
The sum of all n and the integration over the transverse wave vectors,
however, diverges and convergence factors, in this first quantization
treatment, must be applied. The result is an attractive force between the plates
which creates a pressure, or energy density, of:
The pressure is, numerically, an energy density of 27.1 eV/A3. The Casimir
effect is explored in the script “QM_Casimir”. Printout from that script
appears in Figure 6.35.
The Casimir pressure as a function of separation is shown in Figure 6.36. It
is clear that only on the Angstrom scale is the effect going to be important.
However, it has been measured and it shows that there is quantum energy in
the “vacuum”.
Chapter 7
Astrophysics
“Astronomy compels the soul to look upwards and leads us from this world to another.”
— Plato
“And yet it moves.”
— Galileo Galilei
“I ask you to look both ways. For the road to a knowledge of the stars leads through the atom;
and important knowledge of the atom has been reached through the stars.”
— Sir Arthur Eddington
Figure 7.2: Printout from the script “Mars_More3” for choices of Mars and Neptune as outer planets
to travel to.
Therefore, if we specify the radius we know everything about the orbit. The
dialogue printout is shown in Figure 7.2. The user chooses an outer planet.
In planning for planetary exploration it is useful to establish a feeling for
the size of the times and velocities involved. For example, Mars has a period,
velocity and orbital energy with respect to Earth of 1.87, 0.81 and 0.66,
respectively. A “transfer orbit” starts with a velocity increase to put the
vehicle into an elliptical orbit, semi-major axis a = r1/(1 − e), where e is the
eccentricity. The eccentricity of this orbit is (r1 − r2)/(r1 + r2) where r1 and r2
are the turning points, the perigee and apogee.
Figure 7.3: Approximate circular orbits for Earth (red) and Mars (green) and the elliptical transfer
orbit between them.
In Figure 7.3. the radii refer to the orbital size of the earth and Mars in
astronomical units, (AU). The eccentricity of the transfer orbit in this case is
0.21. The launch is at transfer orbit perigee and the rendezvous is at apogee.
The velocities during the trip are shown in Figure 7.4. As can be seen, boosts
in velocity are needed both at launch and at the end of the trip. The one way
trip time is 0.71 years. Faster orbits are possible but more costly in terms of
the fuel required and the reduced payload ratio. Clearly, there is also a
“launch window” since Mars needs to be there at the end of the transfer orbit.
For other planetary trips the size and time scale gets quite large. For
example, a trip to Neptune along a transfer orbit has an eccentricity of 0.90
and takes 16.0 years. The orbits are shown in Figure 7.5. To arrive at Uranus
requires a very elliptical orbit. The user is encouraged to try a few more of the
outer planets which are available on the menu given by the script “Mars
_More3”.
Figure 7.4: Velocities for the Mars transfer orbit. A boost is needed to begin. The red and green stars
show the orbital velocities for the Earth and Mars, respectively.
It is of interest to speed up the trips. Firstly, the passengers will thank you
for the speedy trip. In addition, there are fierce radiation fields to which the
passengers will be exposed during the trip. Shielding would be heavy, so
perhaps the orbit is not optimal for speed. Indeed, it is a minimal energy orbit,
but other options cost additional fuel. At present, this problem is not fully
solved.
7.2. Flyby
The velocity for an object to escape the gravity field of the earth is 11.2
km/sec, while for the sun it is 42.1 km/sec. A more economical way to escape
the solar system than constructing an enormous rocket has been used by
making a “gravity assist” or “slingshot” around the outer planets, such as
Jupiter. In this fashion the Voyager probes escaped the solar system. The basic
idea is that in an encounter with a very massive object, the spacecraft will
essentially be dragged along and pick up a maximum of approximately twice
the velocity of the object. In this case the momentum the object picks up is
extracted from the gravity field of Jupiter. No actual collision occurs. The
script uses a very simple numerical integration of the force on the rocket due
to a planet with fixed orbit, unaffected by the spacecraft.
Figure 7.5: Approximate circular orbits for Earth (red) and Neptune (green) and the highly elliptical
transfer orbit between them.
Figure 7.6: Printout of “Jupiter Flyby”. The user defines the closeness of the encounter of the
spacecraft with a point like Jupiter by choosing the initial velocity.
Figure 7.7: Trajectories of Jupiter, red, and a spacecraft, blue dashed, for a specific flyby which makes
a close encounter between the spacecraft and Jupiter.
The success of this flyby can be seen in Figure 7.8 where the velocity of
the spacecraft throughout the flyby is plotted. The y velocity, which starts at
0.2 initially, becomes −1 in the encounter which is approximately the assumed
velocity of Jupiter and illustrates the “slingshot” aspect of the flyby. A simple
numerical integration of the encounter with Jupiter’s gravity is used. The
actual flyby which was used trails Jupiter rather than leading it because then
the direction of the spacecraft is not reversed as shown in Figure 7.9.
Figure 7.8: Velocity in the y direction of the model spacecraft as a function of time. The spacecraft
gets a velocity increment comparable to the velocity of “Jupiter”, defined to be 1, in the flyby encounter.
Figure 7.9: Trajectories of Jupiter, red, and a spacecraft, blue dashed, for a specific flyby which makes
a close encounter between the spacecraft and Jupiter and is chosen to lag behind Jupiter, thus largely
preserving the initial direction.
Figure 7.10: Printout of the script “Roche_Lagrange” with a specific mass ratio chosen for the two
large masses.
There are three collinear points on the x axis joining the two masses. Two are
near the lighter mass; one toward the heavier mass and one away. The third
point is well beyond the heavier mass, located at negative x. There are two
additional points at sixty degrees to the heavier mass and at a radius which is
the same as the third Lagrange point. A contour plot of the equipotentials is
displayed in Figure 7.11.
Figure 7.11: Equipotentials for the binary system with mass ratio equal to 2. The location of 3
collinear Lagrange points is visible, as are the 2 points which are at 60 degrees to the heavier mass.
Figure 7.12: Force in the x coordinate for a binary mass ratio of 2. There are 3 collinear points. Two
are near the lighter body, while the third is at large negative x, nearer the heavy body. The locations of
the 2 bodies are indicated by the green and black stars.
The forces can easily be derived from the potential. The force along the x
axis is plotted below in Figure 7.12. The locations of the three points where
the force is zero are clear. The script prints out the locations in x for the ten
minimum values of |fx|. In this specific case they occur at x = −1.15, 1.23, and
0.22. The minima are a bit shallow, so care is needed in interpreting the use of
the MATLAB utility “sort”.
The discovery and understanding of the force law benefitted from the
existence of several planets with different radii and periods and the fact that
the sun has almost all the mass of the solar system. The solar system is
effectively a series of one body, independent, planetary orbits as assumed
previously.
One application of the general problem comes from the present search for
extra solar planets. The Kepler problem solution assumes that the sun is much
more massive than any planet. In that case the problem only requires the
motion of the planet and the sun can be considered to be at rest. However, in
general there is motion of both bodies. An example using the script “Binary2”
for a separation of 1 astronomical unit (AU) with body1 having the mass of
the sun and body2 having one percent of that mass is performed. The initial
position and velocity of the sun are taken to be zero, while that for the
“planet” has an angular velocity of a circular orbit with no radial velocity.
There is a movie of the motion provided and the total paths are shown in
Figure 7.13. Note that there is a wobble to the sun which could be determined
using the Doppler effect to measure the velocity of the sun. This example is
clearly made to enhance the effect, but nearby planets of extra-solar stars
have, in fact, been observed using this technique.
At the other extreme, equal mass binary pairs can be studied. In our galaxy
it appears that about ten percent of the star systems are binary, so the exercise
is useful. An example with equal mass objects with a solar mass each at 1 AU
is shown in Figure 7.14. For body1 the initial velocity was 6 radians/AU and
the radial velocity was 2. For body2 the angular velocity was −5 and the
radial velocity was 2. The resulting evolution of the binary system is
complex. The reader is encouraged to play with other combinations of the six
input parameters to find interesting orbits.
Figure 7.13: Motion of a solar mass being orbited by a “planet” with a mass of 1% of the sun. The
wobble of the sun and the subsequent perturbation of the planetary orbits are very evident.
7.5. Three Body Orbits
An extension of the previous script, “Binary2”, is to consider a heavy sun
with solar mass that is fixed at the origin and is orbited by two “planets” in
unperturbed circular orbits. The script is “Three_Body” although a general
three body problem requires more variables. The forces are central, so that
motion is in a plane. The user chooses a radius and mass for both “planets”
with prompts for the earth and for Jupiter, as seen in Figure 7.15
The script uses the MATLAB “ode45” numerical integration od
differential equations to solve for the subsequent motion of the two planets.
The script is run twice, once for no perturbative force between the two planets
and then again with the gravitational interaction turned on. A movie is shown
in the unperturbed case. This procedure is adopted because the actual changes
due to Earth-Jupiter interactions is small and even integrating over five years
leads to small effects. The difference of the two orbits is shown in Figure
7.16, where the size of the effect is a few parts per thousand of the size of the
orbit after five years. The time dependence of the difference appears in Figure
7.17.
Figure 7.14: Orbital motion for equal mass binary stars. The initial conditions define roughly opposite
angular velocities and equal radial velocities.
Figure 7.15: Dialogue for the choice of the mass and radius of 2 planets in circular orbit about the sun.
Figure 7.16: Differential effect of the perturbation due to Earth-Jupiter attraction during tracking over
5 years. Initially Earth and Jupiter are given the same azimuthal value.
The temperature in the printout follows from the ideal gas law, P = kρT/m
where k is the Boltzmann constant and m is the mean mass of the molecules
making up the star.
The Lane–Emden equation is solved numerically using the MATLAB
utility “ode45”. The two constraints in Eq. (7.4) are imposed with a defined
relationship between pressure and density set by n, Eq. (7.5). The input
needed is the core, r = 0, temperature. The pressure and density are derived
quantities in this formulation. The solutions are integrated to larger r and
terminate at R where the temperature is defined to be zero as a boundary
condition. The solution is fully defined by the normalized temperature φ
treated as a function of normalized radius r/R.
Printout from the script “Star_Polytropic” is shown in Figure 7.18. The index
n of 3.5 gives a reasonable representation of the solar data which is plotted on
the same graph as the polytropic solution. The user chooses the index and can,
therefore, see how the choice changes the density, temperature and pressure
radial profiles.
The temperature profile is shown in Figure 7.19, while the pressure
distribution appears in Figure 7.20. The overall agreement of this very simple
model with the solar data is not too bad and is clearly a large improvement
over assuming a uniform density for the star.
Figure 7.18: A printout of the dialogue for a particular, approximately, solar index.
Figure 7.19: Radial distribution of temperature for a polytropic star with index 3.5. The data points,
‘o’, are solar data.
Figure 7.20: Radial distribution of the density for a polytropic star with index 3.5. The data points, ‘o’,
are solar data.
As seen from Eq. (7.7), depending on the core pressure and radius there may
be either expansion or contraction. The pulsations are considered in the script
“Stellar_Pulse”. The user is given the core mass, the outer shell mass and the
radius. The user chooses the pressure P0. The printout of a specific dialogue is
shown in Figure 7.21.
The heat from the interior is absorbed by the shell when the hydrogen in
the shell is ionized. The shell moves outward, cools, de-ionizes, and the shell
is pulled back in by gravity. The balance is quite critical and values of the
pressure from 0.4 to 0.6, in units of 105 Nt/m2, show stable oscillations, while
outside this range the behavior is not stable.
Plots of radius as a function of time are shown in Figures 7.22 and 7.23 for
pressures of 0.4 and 0.6, respectively. The pulsation period in the former case
is fairly slow, on the scale of months, while in the latter case the scale is much
more rapid, on the scale of weeks. The amplitude is much smaller in the latter
case than in the former, as can be seen in the plots which are provided.
Indeed, this simple picture gives an approximate model for pulsating red giant
stars.
Figure 7.21: Dialogue for stellar pulsations. Note that the sun has a radius of 7 × 108 m and a mass of
2 × 1030 kg. In comparison the script defines a red giant star.
Figure 7.22: Pulsations as a function of time (sec) for a red giant with pressure 0.4 × 105 Nt/m2.
Figure 7.23: Pulsations as a function of time (sec) for a red giant with pressure 0.6 × 105 Nt/m2.
Numerical values of the scale factors for radius and mass appear in the
printout of the script, shown in Figure 7.24.
Figure 7.24: Printout from the dialogue of the script “White_Dwarf”. Numerical values for the scale
of electron number density, mass density, radius, stellar mass and stellar radius are given.
Figure 7.25: Scaled mass as a function for scaled radius for a white dwarf with a scaled central density
of one.
Figure 7.27: Printout of the script “Boltz_Sun2” for two samples of solar surface temperature. The
quoted formula is for energy density per wavelength.
Figure 7.29: Spectral energy density for a temperature of 5700 kelvins, appropriate to the sun.
General Relativity
Figure 8.1: Printout from the script “Light_Deflect”. Showing the symbolic solution of the
approximate equation for the trajectory of light.
The asymptotes can be read off from the approximate equation above for
zero angle, and u of zero, ±2GM/Rc2. The small angle solution for the angle
between the asymptotes is 2rs/R. This appears in the printout as “4m” plus a
small correction for the approximate initial conditions used, since m = GM
and R = 1 in the script. For the sun the deflection is rather small, but light
passing near a black hole can have major angular deviations from a straight
line. The plot made by the script is shown in Figure 8.2.
The light orbits for Newtonian and general relativistic orbits are shown in
Figure 8.3. The blue line is the Newtonian straight line, while the red dashed
line is for rs/R = 0.02 and the black line is a distorted representation of the
surface of the sun, radius R.
Light is “attracted” to the sun, and it has an infinite h which means the
circular orbit for light has a radius 3/2 the Schwarzschild radius, rs = 2GM/c2.
In Eq. (8.4) the first term is the classical result u = 1/a ~ GM/(hc)2.
For a material particle, h is finite and the solution to the geodesic equations
is a function of the parameter h which is a constant of the motion, has the
dimensions of length and is approximately L/c. In the classical limit, a rs
and h rs, h approaches L/c and a approaches L2/GM
In the script, the user picks an initial value of the constant of motion h. It is
clear from Eq. (8.5) that the value of h must be greater than and therefore
the radius must be greater than three times the Schwarzschild radius or twice
the photon orbital radius. An example of the printout for the script appears in
Figure 8.4.
The script supplies the radius as a function of the constant h. The radius,
both classical and relativistic, appears in Figure 8.5. The relativistic radius
approaches three times the Schwarzchild radius, while the classical radius is
smaller and has no minimum. Note the photon point which has a radius twice
as small as the smallest possible orbit for a material particle. However, that
orbit is unstable as are all orbits for material particles below three
Schwarzschild radii unless external power is applied.
Figure 8.5: Radius of a circular orbit for a classical and a relativistic treatment. Note the GR minimum
radius is 3 in rs units. There is no classical minimum. The photon orbit at 3/2 units is also shown.
The coordinate radius is r and the coordinate time, measured at large r, is t,
while the proper time is s. The initial radius is ro, the initial velocity is zero
and rs is the Schwarzschild radius. The proper time is well behaved at all r,
while the coordinate time t diverges as the radius r approaches rs. Clearly as r
approaches rs, ct must approach infinity and an object falling into a black hole
takes forever to reach the Schwarzschild radius.
In the general case, analogous to the Kepler problem in classical
mechanics there is a constant of motion, h, like angular momentum. There is
another choice, basically that proper and coordinate clocks at large r run at the
same rate.
The first three terms arise in classical mechanics and define the Kepler
equation. The last term is added by considering the general relativistic
geodesic motion in the Schwarzchild space corresponding to a point particle
of mass M. For photons, the constant h approaches infinity.
The solutions are calculated in the script “gen_geodesic” which uses the
MATLAB utility “ode45”. The user chooses classical, relativistic or photon
solutions. The trajectory is defined by user inputs for the initial position in r,
the impact parameter (phi angle) and the L/c value in m units. The orbit is
plotted for an angular range also defined by the user.
The orbits for photons are almost straight lines for large r as is expected
classically because the metric becomes flat at large distances. However, for
smaller initial r, the deflection of light is very evident. A sample plot for light
is shown in Figure 8.6.
The orbits of bound systems are not re-entrant in general relativity as are
Kepler orbits. This causes the famous perihelion advance of Mercury. Setting
the phi range of six (pi), the initial position of 5 and impact parameter of 5
with L/c of 6000 m results in the path shown in Figure 8.7. The path is a
bound state for a material particle, but it is far from the familiar Keplerian re-
entrant ellipse.
Figure 8.6: Trajectory for light with initial radius of 10 with impact parameter of 3. Note that b = 2 is
not a stable orbit and the light falls into the origin (red star). The Schwarzchild radius is plotted with
dashed red lines.
An unbound trajectory for initial r of ten, impact parameter of five and L/c
of twenty thousand is shown in Figure 8.8. The orbit is unbound and
corresponds classically to a hyperbolic orbit. The time samples are uniform so
that the slowing down of the particle at large distances is observable. The
relationship between coordinate time, t, and proper time on the orbit appears
in Figure 8.9. At large r values the two are approximately the same, while for
small radii, the proper time remains well behaved and the coordinate time is
larger. This effect has, indeed, been measured and confirms the relativistic
calculation.
Figure 8.7: Multiple orbits for a particle started on a circular orbit at radius 5. The non re-entrant
nature of the orbit is very evident in this extreme case.
Just as with Kepler orbits, the relativistic orbits have many parameters to
vary. The interested user is encouraged to try many combinations and explore
the subsequent motion.
Figure 8.9: Relationship of coordinate time to proper time during the quasi hyperbolic orbit shown in
Figure 8.8. At small r, there is a major difference in t and s.
The geodesic equations for photons in equatorial orbits can be cast into a
simple first order differential equation. Note that a can be positive or
negative, depending on the sense of the rotation. The angular variable in the
equatorial plane is φ which depends on the Kerr rotation parameter a and M.
Printout from the script “Kerr_Photon2” is shown in Figure 8.10. Units with
M = 1 are used in this script. Values for the two event horizons and the two
possible circular orbits are part of the printout.
The equation for the orbit is solvable and is found using the MATLAB
utility “dsolve”. The symbolic solutions are also printed out, for both positive
and negative a. The constants C2 and C4 depend on the initial conditions.
Note that these particular photon solutions are for orbits which approach the
outer event horizon for the specific user input. Note that the trajectories are
incoming toward smaller r.
Figure 8.10: Printout from the script “Kerr_Photon2”. The equatorial photon orbits are solved for
symbolically.
Figure 8.11: Geodesic for an equatorial photon traveling close to the outer event horizon. Units are for
M = 1, rs = 2.
There are then differential equations for the proper time, azimuth and
radius as a function of coordinate time t, with r limited to be larger than the
larger event horizon. There is, in addition, a sign for the radial solutions as
incoming or outgoing. The equations themselves are not very transparent, but
the user can read them off from the script “Kerr4” as desired.
In “Kerr4” the user chooses the orbital parameters analogous to the Kepler
parameters, E and L along with a, the initial radius, and the incoming or
outgoing sense of the trajectory. An example for a = 0.98, E = 1, L = 3, ro =
1.5 and outgoing appears in Figure 8.12. An orbit with the same parameters
except the sense of a appears in Figure 8.13.
Figure 8.12: Kerr trajectory for an outgoing path, E = 1, L = 3 and initial r = 1.5. The green circle is
the outer event horizon. The sense of the spin a and the trajectory reinforce.
Recall that Kepler trajectories are circles and ellipses for bound states and
parabolas and hyperbolae for unbound states and that the plots in Figures 8.12
and 8.13 are far from the simple conic sections. Thus it is clear that the Kerr
solution can have strong relativistic aspects, especially the “frame dragging”
due to the spin of the mass. The solutions in Kerr4 are for material particles
where L and thus h are finite. A movie is provided for the (x, y) motion along
the chosen trajectory as a function of equal steps in coordinate time t.
There are also interesting bound states with negative energy. An example
with E = −1, L = 10 initial r = 3 and incoming sense is shown in Figure 8.14,
where the frames of the movie are plotted as open circles. In this case the
frame dragging aspect of the orbit is very clear, since the sense of the
trajectory changes during the orbit. The user is encouraged to play with the
many available parameters which define a general equatorial orbit in the Kerr
geometry as only a few are illustrated here.
Figure 8.13: Trajectory for the same parameters as the previous figure except that the spin direction a
has been reversed. The trajectory is bent toward the sense of a, reversing the initial motion.
The maximum radiated power is set by the quantity c5G which is 3.8 × 1052
watts. The emitted gravitational waves cause a metrical distortion
(dimensionless) at an observation distance r which is approximately:
Clearly, the metrical distortion is very small and sets the scale for
fractional elongations in any gravitational wave detector. A contour for the
orbital frequency as a function of M and R appears in Figure 8.16. The
detectors must be sensitive to a range from 102 Hz to perhaps 105 Hz if they
are to use binaries to calibrate. The radiated power as a function of M and R is
shown in Figure 8.17 scaled to the maximum possible power. Detectors
should be sensitive to metrical changes several orders of magnitude below the
maximum value.
where M is the total mass and R is the radius. A plot of the interior and
exterior potentials is shown in Figure 8.18.
The Newtonian pressure, P, can be written in terms of the Schwarzschild
radius for a uniform density star. The equation of hydrostatic equilibrium was
already shown for polytropic stars and is reproduced here:
Figure 8.16: Orbital frequency as a function of M and R. Detectors need to be sensitive to disturbances
at those frequencies since the radiation occurs at the orbital frequency.
Figure 8.20: Pressures as a function of r for the ratio rs/R = 0.5. The GR contribution is substantial
compared to a Newtonian estimate for pressure.
Figure 8.21: Pressures at r = 0 as a function of the ratio rs/R. At low values, GR does not contribute
much, but at high values it dominates over the Newtonian estimate.
The Hubble parameter is defined by the expansion rate, set by the rate of
change of the scale parameter R, so that it has the dimensions of inverse time.
The Hubble length is defined by the distance where the recession velocity is
c. Any sources beyond that distance are unobservable. The emission time
when that occurs is the inverse of the present Hubble parameter. A matter
dominated Universe with an R scaling as a power of t, in this case n = 2/3, is
assumed in the script “Cosmo_Light”. Printout from that script appears in
Figure 8.22.
Figure 8.22: Printout showing the Hubble parameters for a given choice of present Hubble parameter.
The photons always travel on a path where the local velocity is that of
light. Then the present reception and emission radial coordinates, r, are:
The reception time is to, while the emission time is t. Assuming a power law
behavior in t for R over the past history, the integrals can be performed and
the coordinates at emission and reception can be calculated as a function of
the z parameter (redshift).
Figure 8.23: The distance at emission and reception for light with redshift z. The distances are scaled
to the Hubble length where the recession velocity is c. The present distance at reception is Ror, while
the distance at emission is Rr.
The present distance to the source is Ror, while the distance to the source at
emission is Rr. There is a maximum present distance of 3cto which occurs at
large z. The emission distance does not increase monotonically with z, but has
a maximum. There is a maximum distance that can be observed because of
the expansion of the reception point. Note that light can also be received at
present distances greater than the Hubble length, also due to the expansion.
The Hubble length and velocity are both divided by n in the expanding
geometry. The Hubble length is ct/n. The results for a matter dominated
Universe, n = 2/3, are shown in Figure 8.23. Present distances larger than the
Hubble length are accessible.
The look back times for reception and the emission times are shown in
Figure 8.24 as a function, again, of the redshift parameter, z. These plots are,
in principle, nothing new since the look back positions are already known as
shown in Figure 8.23. However, they give additional visual insights. The
emission time is the reception time at z = 0 by definition. The emission time
falls steadily as the reception time increases because light arrives from earlier
times. The look back time is then just the time of reception with respect to the
time of reception and increases monotonically.
Figure 8.24: Emission time and look back time as a function of the signal redshift. At high z the
emission time decreases steadily to zero while the look back time increases toward one.
Appendix
Scripts for the Chapter on Classical
Mechanics
All the scripts are available to the user using the enclosed media. However, it
is useful to be able to quickly jump to a written version in order to see what
MATLAB commands are used. To that end, the script text for the chapter on
Classical Mechanics is enclosed below.
%
% Symbolic Angular Momentum
%
clear all;
help Angular_Momentum % Clear the memory
and print header
%
syms x y Lz t vx vy
% define variables as needed
%
fprintf('Find L for Symbolic x(t), y(t) Input \n')
%
iloop = 0;
irun = 1;
while irun > 0
%
krun = menu('Another x(t), y(t) Trajectory','Yes','No');
if krun == 2
irun = -1;
break
end
%
if krun == 1
%
fprintf('Enter x(t) symbolic \n');
x = input(': ','s'); % Read input as a text string
fprintf('Enter y(t) symbolic \n');
y = input(': ','s');
%
m = 1;
vx = diff(x,sym('t'));
vy = diff(y,sym('t'));
Lz = x *vy - y *vx;
fprintf('Angular momentum (z-component) = \n');
Lz
%
tt = linspace(0,5);
for i = 1:length(tt)
t = tt(i);
xx(i) = eval(x);
yy(i) = eval(y);
LLz(i) = eval(Lz);
z1(i) = 0;
x1(i) = 0;
y1(i) = 0;
end
%
iloop = iloop + 1;
figure(iloop)
xmax = max(xx);
ymax = max(yy);
zmax = max(LLz);
xmin = min(xx);
ymin = min(yy);
zmin = min(LLz);
for i = 1:length(tt)
%
plot3(xx(i), yy(i), z1(i),'o');
axis([xmin xmax ymin ymax zmin zmax])
%
title('x,y and Lz ')
xlabel('x')
ylabel('y')
zlabel('Lz')
pause(0.2)
hold on
plot3(x1(i),y1(i),LLz(i),'r*')
legend('x,y','Lz')
end
hold off
%
end
end
%
%
% Program to explore classical scattering
% where in 3 cases the cross section is the same
%
clear all; help Classical_Scatt; % Clear memory and print header
%
fprintf('All Three Scatterings have the Same Total Cross Section
\n')
%
iloop = 0;
%
b = linspace(0,1.0); % impact parameter
a = 1; % all results have sigma = pi*a^2
%
% hard sphere , radius a
% barrier, Vo with E = 2Vo
% n = sqrt(1-Vo ./E), bo = n/a
n = sqrt(1- 0.5);
bo = n .*a;
nw = sqrt(1 + 0.5);
%
for i = 1:length(b)
th_hs(i) = 0;
if b(i) < a
th_hs(i) = pi - 2.0 .*asin(b(i) ./a);
end
%
th_bar(i) = 0;
if b(i) < bo
th_bar(i) = 2.0 .*(asin(b(i) ./(n .*a))
- asin(b(i) ./a));
end
if b(i) > bo && b(i) < a
th_bar(i) = pi - 2.0 .*asin(b(i) ./a);
end
%
th_well(i) = 0;
if b(i) < a
th_well(i) = -2.0 .*(asin(b(i)
./(nw .*a)) - asin(b(i) ./a));
end
%
end
%
iloop = iloop + 1;
figure(iloop)
plot(b,th_hs,'-b',b,th_bar,':r',b,th_well,'-.g')
title('Scattering Angle for Three Scattering Centers')
xlabel('b/a')
ylabel('\theta')
legend('Hard Sphere, 'Barrier','Well')
%
%
% Program to look at the relationship of impact parameter
% and distance of closest approach - force power laws
%
clear all; % Clear memory
help CM_b_DCA; % Print header
%
irun = 1;
iloop = 0;
%
fprintf('Particle with impact parameter b scatters off a force
center \n');
%
syms b a v vo m r alf aa
%
% central forces, L conserved, mo*vo*b = m * v * a
%
fprintf('a = vo*b/v, a is DCA, initial velocity vo, v at DCA \n')
%
fprintf('f(r) = m /r^a, V(r) = -m/(a-1)r^a-1 \n) % force and
potential
%
fprintf(' E conservation; vo = sqrt(v ^2 + 2 /((alf-1) *(r ^(alf-
1)))) \n')
%
while irun > 0
kk = menu(' Another value of the power law a ?
','Yes','No');
if kk == 2
irun = -1;
break
end
if kk == 1
%
ALF = input('Enter force law power: ');
syms b a v vo m r alf aa
ll = menu('Force Law ? 'attractive','repulsive');
if ll == 1
mm = -1;
else
mm = 1;
end
%
alf = ALF ;
aa = solve(a == sqrt(b^2 + mm * (2 *a ^2)/(vo ^2*(alf -
1) * (a ^(alf - 1)))),a)
%
b = 1;
vvo = linspace(0.1, 5);
for i = 1:length(vvo)
vo = vvo(i);
AAA(i) = eval(aa(1));
end
%
iloop = iloop + 1;
figure(iloop)
loglog(vvo,AAA)
title('DCA as a function of vo')
xlabel('vo')
ylabel('DCA/b')
%
end
end
%
%
% Program to compute precession of a Focult pendulum
%
clear;
help foucault_exact;
%
% Clear memory and print header
%
syms
% k1 is natural
X1 frequency =
X2 w^2, k2 is
x1 2*omega*sin
x2 (phi)
k1
k2 ;
% phi is
latitude,
omega is
Earth
frequency
% pick time in
days, omega =
2*pi
% pendulum
precesses by
2*pi*sin(phi)
per day
% x is East and
y is North in
Earth system
%
fprintf('Focault pendulum, Gravity plus Coriolis Causes
Precession \n')
fprintf('D2x = -w^2x + (2*omega*sin(phi))*dydt \n')
fprintf('D2y = -w^2y - (2*omega*sin(phi))*dxdt \n')
%
[X1,X2]=dsolve('D2x1=-k1*x1+k2*D1x2','D2x2=-k1*x2-k2
*D1x1','x1(0)=0','x2(0)=1','Dx1(0)=0','Dx2(0)=1');
%
iloop = 0;
irun = 1;
while irun > 0
%
krun = menu('Another Set of Parameters to
Solve?','Yes','No');
if krun == 2
irun = -1;
break
end
%
if krun == 1
Tpen = input('Enter Pendulum Period (days): ');
w = (2.0 .*pi) ./Tpen; % convert to frequency
phi = input('Enter Latitude (degrees): ');
phir = (2 .*pi .*phi) ./360; % radians
omega = 2.0 .*pi; % Earth rotation
%
k1 = w .^2;
k2 = 2.0 .*omega .*sin(phir);
%
tt = linspace(0,2,200);
ntt = length(tt);
for i = 1:ntt
t = tt(i);
xxx1(i) = real(eval(X1));
xxx2(i) = real(eval(X2));
end
%
iloop = iloop + 1;
figure(iloop)
%
plot(tt,xxx1,'b-',tt,xxx2,'r-')
title('Exact x(t) and y(t) of Focault Pendulum - Earth Frame
')
xlabel('t')
ylabel('x, y')
%
iloop = iloop + 1;
figure(iloop)
plot(xxx1,xxx2,'-b')
title('Exact x vs y of Focault Pendulum - Earth Frame ')
axis([-1 1-1 1])
xlabel('x')
ylabel('y')
%
% approximate result
%
ta = linspace(0, tt(ntt),ntt);
%
% in absolute frame, pendulum has SHO,
%
yaf = sin(w .*ta);
%
% rotating - Earth - frame
%
wpre = omega .*sin(phir);
cp = cos(wpre .*ta);
sp = sin(wpre .*ta);
xear = sp .*yaf;
year = cp .*yaf;
%
iloop = iloop + 1;
figure(iloop)
for i = 2:length(ta)
%
x1(1) = xear(i-1);
y1(1) = year(i-1);
x1(2) = xear(i);
y1(2) = year(i);
plot(x1,y1,'-')
axis([-1 1 -1 1])
title('Approximate Earth Frame - Precession, Movie')
xlabel('x')
ylabel('y')
pause(0.2)
hold on
end
hold off
%
iloop = iloop + 1;
figure(iloop)
for i = 2:length(ta)
%
x1(1) = xxx1(i-1);
y1(1) = xxx2(i-1);
z1(1) = 0;
x1(2) = xxx1(i);
y1(2) = xxx2(i);
z1(2) = 0;
plot3(x1,y1,z1,'-')
grid ON
axis([-1 1-11-14])
titled('Exact Earth Frame - Precession and Absolute
Frame, Movie')
xlabel('x')
ylabel('y')
pause(0.2)
hold on
plot3(0,yaf(i),3,'r*')
end
hold off
%
end
end
%
function Spring_Pendulum
%
% Pendulum in plane with length variable due to spring connection
%
global g k m Lo
%
irun = 1;
iloop = 0;
%
while irun > 0
kk = menu('Pick Another Spring Pendulum?','Yes','No');
if kk == 2
irun = -1;
break
end
if kk == 1
%
BB = input('Enter k, m and Lo - [k,m,Lo]: ');
fprintf('Spring contributes as (Lo-r), >0 and <0 \n')
%
g = 9.8; % m/sec^2
k = BB(1);
m = BB(2);
Lo = BB(3);
%
wspr = sqrt(k ./m); % for SHM, period = 2*pi/w
wpen = sqrt(g ./Lo); % period for simple pendullum
fprintf('w for simple spring = %g and simple pendulum =
%g \n' , wspr, wpen)
%
AA = input('Enter Initial Positions , r and theta(deg) -
[r(0),theta(0)]: ');
fprintf('Initial Velocities Assumed to be Zero \n')
%
ro = AA(1);
tho = (AA(2) .*2 .*pi) ./360.0;
%
tspan = linspace(0,4 .*2.0 .*pi ./wpen);
% time frame - 4 pendulum periods
%
[t,y] = ode45(@pend_spring,tspan,[0 ro 0 tho]);
% vr, r vth, th - initial conditions
%
iloop = iloop + 1;
figure(iloop)
plot(t,y(:,2))
title('r vs t')
xlabel('t')
ylabel('r')
%
iloop = iloop + 1;
figure(iloop)
plot(t,y(:,4))
title('\theta vs t')
xlabel('t')
ylabel('\theta')
%
for i = 1:length(t)
yyy(i) = -y(i,2) .*cos(y(i,4));
xxx(i) = y(i,2) .*sin(y(i,4));
end
iloop = iloop + 1;
figure(iloop) xmax = max(xxx);
xmin = min(xxx);
ymax = max(yyy);
ymax = 0;
ymin = min(yyy);
%
% movie
%
for i = 1:length(t)
plot(xxx(i),yyy(i),'o')
title('Spring - Pendulum Movie - x vs y')
xlabelC'x')
ylabel('y')
axis([xmin, xmax, ymin, ymax])
hold on
penx(1) = 0.0;
peny(1) = 0.0;
penx(2) = xxx(i);
peny(2) = yyy(i);
plot(penx,peny,'g')
plot(0.0,0.0,'r*')
pause(0.1)
hold off
end
%
iloop = iloop + 1;
figure(iloop)
plot(xxx,yyy,'-')
title('Spring - Pendulum - x vs y')
xlabel('x')
ylabel('y')
axis([xmin, xmax, ymin, ymax])
%
end
end
%---------------------------------------------------------
function dy = pend_spring(t,y)
%
global g k m Lo
dy = zeros(4,1);
% y1 = drdt, 2 = r, 3 = dthetadt, 4 = theta
%
ct = cos(y(4));
st = sin(y(4));
dy(1) = g .*ct + (k ./m) .*(Lo - y(2)) + y(2) .*y(3) .*y(3);
dy(3) = -(g .*st) ./y(2) - (2.0 .*y(1) .*y(3)) ./y(2);
dy(2) = y(1);
dy(4) = y(3);
%
%
% Solve for motion of a spherical pendulum
%
function Spherical_Pend
clear all;
help Spherical_Pend % Clear the memory and print
header
global Q w
%
fprintf(' Spherical Pendulum, r = 1, m = 1 \n');
fprintf(' Azimuthal Angular Momentum is Conserved - 1-d Problem
\n');
%
irun = 1;
iloop = 0;
while irun > 0
%
krun = menu('Another Pendulum IC','Yes','No');
if krun == 2
irun = -1;
break
end
if krun == 1;
%
ww = input('Enter g/l for the pendulum: ');
w = sqrt(ww); % SHO
%
Q = input('Enter angular momentum, L/mr^2 : ');
tho = input('Enter initial angle (deg) : ');
tho = (2.0 .*pi .*tho) ./360.0 ;
vtho = input('Enter initial angular velocity (deg/sec) :
');
vtho = (2.0 .*pi .*vtho) ./360.0 ;
%
tspan = linspace(0, (2.0 .*2.0 .*pi) ./w);
% time frame - 4 pendulum periods
%
[t,y] = ode45(@sph_pend,tspan,[vtho tho 0]);
% y1 = dthdt, 2 = th, 3 =
phi, initial conditions
%
iloop = iloop + 1;
figure(iloop)
plot(t,y(:,2))
title('theta vs t')
xlabel('t')
ylabel('\theta')
%
iloop = iloop + 1;
figure(iloop)
plot(t,y(:,3))
title('phi vs t')
xlabel('t')
ylabel('\phi')
%
iloop = iloop + 1;
figure(iloop)
for i = 1:length(y(:,2))
xx(i) = sin(y(i,2)) .*cos(y(i,3));
yy(i) = sin(y(i,2)) .*sin(y(i,3));
end
xmax= max(xx);
xmin = min(xx);
ymax = max(yy);
ymin = min(yy);
for i = 1:length(y(:,2))
plot(xx(i),yy(i),'o')
title('Movie for Spherical Pendulum')
xlabel('x')
ylabel('y')
axis([xmin xmax ymin ymax])
pause(0.2)
end
iloop = iloop + 1;
figure(iloop)
plot(xx,yy)
title('x vs. y')
xlabel('x')
ylabel('y')
end
end
end
%
% ---------------------------------------------------------
%
function dy = sph_pend(t,y)
%
global Q w
dy = zeros(3,1);
%
% y1 = dthdt, 2 = th , 3 = phi
%
dy(1) = -w .*sin(y(2)) + (Q .^2 .*cos(y(2))) ./(sin(y(2)) .^3);
dy(2) = y(1);
dy(3) = Q ./(sin(y(2)) .^2);
%
end
%
%
% Program to compute a single pendulum, arbitrary angle, driven
% using MATLAB tools
%
function Driven_Pendul
%
clear all;
help Driven_Pendul % Clear the memory and print header
%
global vv Adr wdr
%
fprintf('Pendulum - Large Oscillations, Driven, 1-d Angle \n');
%
irun = 1;
iloop = 0;
%
while irun > 0
kk = menu('Pick Another Driven Pendulum?','Yes','No');
if kk == 2
irun = -1;
break
end
if kk == 1
%
% Set initial position and velocity of pendulum
%
tho = input('Enter Initial Angle (degrees): ');
tho = (tho .*pi) ./180.0; % Convert angle to radians
vo = input('Enter Initial Angular Velocity
(degrees/sec): ');
vo = (vo .*pi) ./180.0;
vv = input('Enter Damping in rad/sec: ');
fprintf('Take k/m = 1 - natural frequency units \n')
Adr = input('Enter Driving Amplitue: ');
wdr = input('Enter Driving Frequency: ');
%
tt = linspace(0, 12.0 .*pi);
%
% numerical solution using ODE tools
%
[t,y] = ode45(@pend_dr,tt,[vo tho]);
%
iloop = iloop + 1;
figure(iloop)
yy = y(:,1);
plot(t,yy,'-')
title('Angular Velocity')
xlabel('t(sec)')
ylabel('d\theta/dt')
%
iloop = iloop + 1;
figure(iloop)
yy = y(:,2);
plot(t,yy/'-')
title/'Angular Position')
xlabel('t(sec)')
ylabel('\theta')
%
iloop= iloop + 1;
figure(iloop)
th = y(:,2);
for j = 1:length(t)
%
yy(j) = -cos(y(j,2)); xx(j) = sin(y(j,2));
end
xmax = max(xx); ymax = max(yy); xmin = min(xx);
ymin = min(yy);
for j = 1:length(t)
xL(1) = 0; yL(1) = 0; xL(2) = xx(j) ; yL(2) =
yy(j);
plot(xx(j),yy(j),'o',xL,yL,'-g')
hold on
plot(0,0,'r*')
axis([xmin xmax ymin ymax])
titled ('Movie of Angular Position')
xlabel('x')
ylabel('y')
pause(0.1)
hold off
end
%
end
end
%
function dy = pend_dr(t,y)
%
global vv Adr wdr
%
dy = zeros(2,1);
dy(1) = -sin(y(2)) - vv .*y(1) + Adr .*cos(wdr .*t);
dy(2) = y(1);
A.8. Random Walk
%
% Look at a random walk in 2-d
%
clear all;
help rand_walk % Clear the memory and print header
%
fprintf('Look at a Random Walk in 2-d n')
%
irun = 1;
iloop = 0;
%
while irun > 0
kk = menu('Pick Another Number of Random
Steps?','Yes','No');
if kk == 2
irun = -1;
break
end
if kk == 1
%
Ns = input('Enter Number of Steps of Size 1: ');
%
x(1) = 0;
y(1) = 0;
NN(1) = 1;
for i = 2:Ns
phi = 2 .*pi .*rand;
x(i) = x(i-1) + cos(phi);
y(i) = y(i-1) + sin(phi);
NN(i) = i;
end
iloop = iloop + 1;
figure(iloop)
%
xmax = max(x);
xmin = min(x);
ymax = max(y);
ymin = min(y);
%
% the movie first, to see how the stochastic
distance evolves
%
for i = 1:Ns
plot(x(i),y(i),'o')
hold on
title('Random Walk Steps')
xlabel('x')
ylabel('y')
axis([xmin xmax ymin ymax])
pause(0.1)
end
hold off
%
iloop = iloop + 1;
figure(iloop)
plot(x,y,'-')
title('Random Walk, Full Time Range')
xlabel('x')
ylabel('y')
axis([xmin xmax ymin ymax])
%
iloop = iloop + 1;
figure(iloop)
plot(sqrt(NN), sqrt(x .^2+y .^2),'-*')
title('Distance of Walk vs Number of Steps')
xlabel('sqrt(N)')
ylabel('radius')
%
end
%
end
%
%
% Hoop, radius = 1, Rotates with frequency w with mass point
located at
% theta, wrt vertical
%
function Rotating_Hoop2
%
clear all;
help Rotating_Hoop2 % Clear the memory and print header
%
% Initialize
%
global gg ww tho
fprintf('Hoop Rotates with frequency w, w^2 > g/a for equilibrium
not equal to 0 \n ')
%
gg = 9.8; % a = 1 m, pick w
aa = 1;
%
irun = 1;
iloop = 0;
%
while irun > 0
%
krun = menu('Another Frequency','Yes','No');
if krun == 2
irun = -1;
break
end
if krun == 1;
%
ww = input('Enter Frequency of Oscillation, > sqrt(g)
(~4): ');
tho = acos(gg /(ww*ww)); % equilibrium angle for this w
- rad
fprintf('Stable Angle for Small Oscillations = %g
(rad)\n' ,tho');
%
ro = input('Enter Initial Angle w.r.t. Stable Angle
(rad): ');
vo = input('Enter Initial Velocity (rad/sec):');
%
tspan = linspace(0, 5);
[t,y] = ode45(@Hoop,tspan,[vo ; ro]);
%
iloop = iloop + 1;
figure(iloop)
ymax = max(y(:,2));
ymin = min(y(:,2));
for i = 1:length(tspan)
plot(t(i),y(i,2),'*r')
title('Angle of Mass Point - Released Near
Equilibrium Point')
xlabel('t')
ylabel('\theta - \theta_o')
axis([0 max(tspan) ymin ymax])
pause(0.1)
end
%
iloop = iloop + 1;
figure(iloop)
plot(t,y(:,2),'-b')
title('Angle of Mass Point - Released at Equilibrium
Point')
xlabel('t')
ylabel('\theta')
%
iloop = iloop + 1;
figure(iloop)
rr = linspace(-1, 1);
zz = sqrt(1- rr .^2);
%
% mass point
%
for i = 1:length(tspan)
zzm(i) = cos(tho+y(i,2));
rrm(i) = sin(tho +y(i,2));
xxx(i) = rrm(i) .*cos(ww .*t(i));
rrc = rr .*cos(ww .*t(i));
plot(rrc,zz,'g',rrc , -zz,'-g',xxx(i),-zzm(i)
,'*r')
hold on
plot(sin(tho) .*cos(ww .*t(i)), -cos(tho),'o')
title('Hoop Rotation, w, and Mass Point
Oscillatiion')
xlabel('x')
ylabel('y')
axis([-1.5 1.5 -1.5 1.5])
hold off
pause(0.1)
end
hold off
%
end
end
%
%---------------------------------------------------------
%
function dydt = Hoop(t,y)
% Equation of mass point on the hoop
%
global gg ww tho
dydt = zeros(2,1);
dydt = [-sin(tho+y(2)).*(gg-ww .*ww .*cos(tho+y(2))) ;
y(1)];
%
A.10. Tides
%
% Program to display tides
%
clear all; help Tides; % Clear memory and print header
%
fprintf('Lunar Tides a la Newton \n')
%
iloop = 0;
%
t = linspace(0,2 .*pi); % loction of the Moon
te = linspace(0,2 .*pi,20); % location on earth surface
cth = cos(t);
sth = sin(t);
%
rm = 2;
re = 1;
%
iloop = iloop + 1;
figure(iloop)
%
xm = rm .*cth; % Moon coordinates
ym = rm .*sth;
%
for i = 1:length(t)
% points for the circle - plots
x1 = linspace(-re,re);
y1 = sqrt(1 - x1 .^2);
hold on
%
plot(x1,y1,'r-',x1,-y1,'r-')
axis([-2 2 -2 2])
plot(0,0,'g*')
%
plot(xm(i), ym(i),'o')
for j = 1:length(te)
ang = te(j) - t(i);
tide(j) =0.1 .*(3.0 .*cos(ang) .*cos(ang) - 1);
end
plot((re+tide) .*cos(te),(re+tide) .*sin(te) ,'b:')
pause(0.2)
hold off
clf
end
for i = 1:1
% points for the circle - plots
x1 = linspace(-re,re);
y1 = sqrt(1 - x1 .^2);
hold on
%
plot(x1,y1,'r-',x1,-y1,'r-')
axis([-2 2 -2 2])
plot(0,0,'g*')
%
plot(xm(i), ym(i),'o')
for j = 1:length(te)
ang = te(j) - t(i);
tide(j) =0.1 .*(3.0 .*cos(ang) .*cos(ang) - 1);
end
plot((re+tide) .*cos(te),(re+tide) .*sin(te) ,'b:')
title('Lunar Tides - Twice per Day')
pause(0.2)
hold off
end
%
A.15. Eccentric_Kepler
%
% Program to compute conic sections with different eccentricity
%
clear;
help eccentric_Kepler;
%
% Clear memory and print header
%
fprintf('Keplerian Orbits - defined by Eccentricity \n')
fprintf('r = ro*(1+e)/(1+e*cos(theta)) \n')
%
ro = 1;
th = linspace(0,2 .*pi,100);
st = sin(th);
ct = cos(th);
%
iloop = 1;
irun = 1;
while irun > 0
%
krun = menu(Άnother Eccentricity?','Yes','No');
if krun == 2
irun = -1;
break
end
%
if krun == 1
%
ecc = input('Enter Eccentricity, (0,2): ');
if ecc > 1
thasy = (360 .*acos( 1.0 ./ecc)) ./(2.0 .*pi);
fprintf('e > 1 - Aysmptotic Angle = %g \n', thasy);
end
r = ro .*(1.0 + ecc) ./(1+ecc .*ct);
x = r .*ct;
y = r .*st;
%
figure(l)
%
plot(x,y,'-' ,0,0, 'r*')
title('Orbit/Conic Section for All Eccentricities')
xlabel('x')
ylabel('y')
axis([-10 10 -10 10])
hold on
iloop = iloop + 1;
figure(iloop)
plot(x,y,'-' ,0,0,'r*')
title('Orbit/Conic Section for This Eccentricity')
xlabel('x')
ylabel('y')
%
end
hold off
end
%
A.17. Euler_Angles
%
% Graphics for Euler Angles
%
clear all;
help Euler_Angles % Clear the memory and print header
%
% define variables as needed
%
% circle orientiation for coord system
phi = linspace(0,2 .*pi);
x = cos(phi);
y = sin(phi);
nph = length(phi);
for i = 1:nph
z(i) = 0;
end
%
% x axis
%
xax(1) = 0;
xax(2) = 1;
yax(1) = 0;
yax(2) = 0;
zax(1) = 0;
zax(2) = 0;
%
% z axis
%
xzx(1) = 0;
xzx(2) = 0;
yzx(1) = 0;
yzx(2) = 0;
zzx(1) = 0;
zzx(2) = 1;
%
% now successive rotations
%
ang =35 .*2.0 .*pi ./360.; % all 30 degrees;
sa = sin(ang);
ca = cos(ang);
D = [ca -sa 0; sa ca 0; 0 0 1];
C = [1 0 0; 0 ca sa; 0 -sa ca];
B = [ca sa 0; -sa ca 0; 0 0 1];
%
for i = 1:nph
xx(1) = x(i);
xx(2) = y(i);
xx(3) = z(i);
xD(:,i) = D*xx';
xCD(:,i) = C*D*xx';
xBCD(:,i) = B*C*D*xx';
end
%
% x axes %
for i = 1:2
xxx(1) = xax(i);
xxx(2) = yax(i);
xxx(3) = zax(i);
xaxD(:,i) = D*xxx';
xaxCD(:,i) = C*D*xxx';
xaxBCD(:,i) = B*C*D*xxx';
end
%
for i = 1:2
xxzx(1) = xzx(i);
xxzx(2) = yzx(i);
xxzx(3) = zzx(i);
xzxD(:,i) = D*xxzx';
xzxCD(:,i) = C*D*xxzx';
xzxBCD(:,i) = B*C*D*xxzx';
end
%
plot3(x,y,z,'b-'); % initial orientation
hold on
plot3(xax,yax,zax,'b-')
plot3(xD(1,:),xD(2,:),xD(3,:),'-.r') % rotate on (x,y) plane
plot3(xCD(1,:),xCD(2,:),xCD(3,:),'g--')
plot3(xBCD(1,:),xBCD(2,:),xBCD(3,:),':k')
plot3(0,0,0, 'r*')
plot3(xaxD(1,:),xaxD(2,:),xaxD(3,:),'r-.')
plot3(xaxCD(1,:),xaxCD(2,:),xaxCD(3,:),'g--')
plot3(xaxBCD(1,:),xaxBCD(2,:),xaxBCD(3,:),'k:')
plot3(xzx,yzx,zzx,'b-')
plot3(xzxD(1,:),xzxD(2,:),xzxD(3,:),'r-.')
plot3(xzxCD(l,:),xzxCD(2,:),xzxCD(3,:),'g--')
plot3(xzxBCD(l,:),xzxBCD(2,:),xzxBCD(3,:),'k:')
xlabel('x')
ylabel('y')
zlabel('z')
title('Euler Angles')
axis([-1 1-11 -0.4 0.4])
hold off
%
A. 19. Top_Euler
%
% Top Motion using explicit solution, Euler Equations
%
function Top_Euler
%
clear all;
help Top_Euler % Clear the memory and print header
global B Iz I1 ws
%
% define variables as needed
%
fprintf('Top motion depends on spin, Top moments of I, mass \n')
fprintf('and initial posiition and velocity (4 of) \n')
fprintf('Special Case of "drop", theta = phi = phidot = 0, only
thetao \n')
%
iloop = 0;
irun = 1;
while irun > 0
%
krun = menu('Another Set of Top Parameters - Euler Angle
Solution?','Yes','No');
if krun == 2
irun = -1;
break
end
%
if krun == 1
B = input('Enter m*g*h -Torque at \theta (~1.0) = 0 :
');
I1 = 1;
Iz = input(Έnter Top Shape Iz, I1 = 1 (~1.5): ');
% moments of 2 principal axes
%
tho = input('Enter Initial Top Polar Angle (deg) (~20) :
');
tho = (tho .*2 .*pi) ./360; % theta (0) - rad, must
be non-zero(sleeping)
phio =0; % phi(0)
phio = (phio .*2 .*pi) ./360;
psio = 0;
thdto =0; % thetadot(0)
%
phidto = input('Enter Initial Derivative of Top
Azimuthal Angle - Defines
Nutation (deg) (~0,0.2,0.8) : ');
%
ws = 1.5 + sqrt(4 .*I1 .*B .*cos(tho))/Iz;
%
% time scale for precession is ~ 1/sqrt(B), integrate
eqs for theta(t),
% phi(t)using Euler Angles in body axes, transform to
space axes
%
range = 1.0 ./sqrt(B);
%
tspan = linspace(O, 8 .*range,200);
% y(1) = phi, y(2)= phid, y(3) = th, y(4) = thd, y(5) =
psi, y(6) = s
% s is a constant of the motion = top spin, [tt,yt] =
ode45(@top_euler_eqs,tspan,[phio, phidto, tho, thdto,
psio] );
% constant of the motion
psidot = ws - yt(:,2) .*cos(yt(:,3));
%
iloop = iloop + 1;
figure(iloop)
plot(tt ./range,yt(:,3).*360 ./(2.0 .*pi))
title('\theta - nutation')
xlabel('time in 1/sqrt(B) units')
ylabel('theta degrees')
%
iloop = iloop + 1;
figure(iloop)
plot(tt ./range,yt(:,1).*360 ./(2.0 .*pi))
title('\phi - precesion')
xlabel('time in 1/sqrt(B) units')
ylabel('phi degrees')
%
iloop = iloop + 1;
figure(iloop)
plot(yt(:,1).*360 ./(2.0 .*pi) ,yt(:,3).*360 ./(2.0
.*pi));
title('\phi vs \theta')
xlabel('\phi (deg)')
ylabel('\theta(deg)')
%
iloop = iloop + 1;
xx = sin(yt(:,3)) .*cos(yt(:,1));
yy = sin(yt(:,3)) .*sin(yt(:,1));
zz = cos(yt(:,3));
xmax = max(xx);
xmin = min(xx);
ymax = max(yy);
ymin = min(yy);
zmax = max(zz);
zmin = min(zz);
for i = l:length(xx)
plot3(xx(i),yy(i),zz(i),'r*')
axis([xmin xmax ymin ymax zmin zmax])
title('CM Motion of the Top')
xlabel('x')
ylabel('y')
zlabel('z')
hold on
pause(0.1)
end
hold off
plot3(xx,yy,zz)
axis([xmin xmax ymin ymax zmin zmax])
title('CM Motion of the Top')
xlabel('x')
ylabel('y')
zlabel('z')
end
end
%
%---------------------------------------------------------
%
function dy = top_euler_eqs(t,y)
%
global B Iz I1 ws
dy = zeros(5,1); % one constant of motion, top spin
%
% y(1) is phi of top, y(2) is phidot , y(3) is th, y(4) is thdot,
y(5) is psi
dy(1) = y(2);
dy(3) = y(4);
dy(2) = (Iz .*ws - 2.0 .*I1 .*y(2).*cos(y(3))).*y(4)
./(I1*sin(y(3))) ;
dy(4) = (B - (Iz .*ws - I1 .*y(2).*cos(y(3))).*y(2))
.*sin(y(3))/I1 ;
dy(5) = ws - y(2).*cos(y(3));
%
Graphical User Interface (GUI)
All the scripts used in this volume are command line driven in that the user
makes input via the command window using text. In fact, MATLAB has a
suite of tools allowing the use of GUIs in order to wrap the scripts and have a
graphical input of user choices for a specific problem. There are several
“help” items in the “product help” giving GUI details. In particular there is a
video demo which illustrates how to build a GUI using the MATLAB
supplied tools.
When creating a GUI, there is a palette of possible GUI items. The choices
are shown below. Having chosen an object, the “property editor” allows the
GUI designer to set the properties, for example, the “Tag” to identify the
object or the String defining the text on the pushbutton.
The use of a GUI rather than a command line driven input dialogue is
illustrated with two examples. These examples are “wrappers” for the script
in Section 4.1 (Leaky Box), and 5.13 (Damped, Driven Oscillator), First the
problem of gas leaking from a container is wrapped with a GUI which
features editable text boxes which receive user input rather than command
line input. Default values are given as a text string. The number of molecules,
their temperature and the size of the aperture are supplied by the user, or the
defaults can be run using the start pushbutton.
The gas problem is one where number, temperature and “volume” for the
ideal gas are defined but the “pressure” must be approximately evaluated by
running the script. In another problem, the harmonic oscillator with damping
being driven harmonically by a wave with specified amplitude and frequency
can be done in real time. In that case, sliders are more appropriate. The slider
limits are provided in text boxes and the calculation starts and stops with
pushbuttons. During the calculation the user can choose the values using the
sliders. That implementation makes the response of the oscillator very
intuitively realizable. A snapshot of the GUI for this problem is shown below.
Figure GUI.1: Tools for GUI design in MATLAB. The pallette is on the left and the property editor
for a pushbutton is on the right.
Figure GUI.2: GUI for the leaking box problem showing the use of editable text, text boxes and a
pushbutton. The result for the mean momentum of the remaining and escaped gas appears as annotated
text on the figure of the box.
Figure GUI.3: Snapshot of the waveform for a harmonic oscillator with a particular user chosen set of
slider parameters for damping and driven amplitude and frequency.
References
Numerical Methods for Physics, 2e, Alejandro L. Garcia, Prentice Hall, 2000,
ISBN: 0-13-906744-2. This text has companion script which is very useful as
a starting point for some exercises.
Numerical Recipes in Fortran 77. The Art of Scientific Computing, W. H.
Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, Cambridge
University Press, 1986, ISBN: 0-521-43064-X. This book is a veritable
encyclopedia of numerical methods.
There are many excellent textbooks available for use as references. However,
as technology has evolved, the increasing use of online resources is at hand.
Therefore, a complete set of paper textbooks is not quoted here. Rather the
search engines and compiled online knowledge bases are invoked.
Google is an enormously useful search engine and many specific searches
will yield a great variety of information. Wikipedia has a large store of
interesting Physics topics, and a search through them will very often start the
user on a good path. Indeed, a particular article often has many links that can
be followed deeper into the topic. An example of the first page of a search for
“Foucault pendulum” is shown below. There are additional links and
references provided that give the user a very good reference experience.
Indeed, while looking at the MATLAB scripts for this text, the user can easily
dip into the online resources and gain further knowledge.
Foucault pendulum
From Wikipedia, the free encyclopedia
(Redirected from Focault pendulum)
This article is about the physics expeπment and implement. For the novel by Italian philosopher
Umberto Eco. see Foucaults Pendulum
The Foucault pendulum
(English pronunciation: /fu:’kou/foo-KOH; French pronunciation: [fu’ko]), or Foucault’s pendulum,
named after the French physicist Léon Foucault, is a simple device conceived as an experiment to
demonstrate the rotation of the Earth. While it had long been known that the Earth rotated, the
pendulum in 1851 was the first simple proof of the rotation in an easy-to-see experiment. Today,
Foucault pendulums are popular displays in science museums and universities.
A Foucault pendulum installed at the California Academy of Sciences. The Earth’s rotation causes the
trajectory of the pendulum to change over time, knocking down pins at different positions as time
elapses and the Earth rotates
Index