Mathematica

‫بسم هللا الرحمن الرحيم‬
Doing Physics with Mathematica
KFUPM Physics Seminar
Safar-1425
Spring-2004
Zain Yamani, Ph.D.
Presentation plan
1- Introduction:
2- What’s special about Mathematica?
[The power of Mathematica]
3- Some examples of how Mathematica
benefits in phys-101/102.
4- Higher Level Physics
5- References
6- Conclusions
Notes and Disclaimers
1- Please do not think that you will ‘learn’ Mathematica from this
seminar. Hopefully, you will learn ‘about’ Mathematica.
2- I will skip a very important [relevant] subject: the details of
mathematical modeling.
3- Many of the codes are not mine!
4- Mathematica experts in the audience need to bare with me.
5- I do not want to argue which is better: Mathematica ‘or’ Matlab
6- You will be provided with a set of references at the end of the
lecture.
7- I am willing to answer your questions at the end of the session.
Introduction
Some places/ universities are really concerned about
computer in physics education. APS-2004 W38
Using computers can be by machine coding (Assembly),
high-level language coding (Fortran or Java …etc.) or
mere running of simulations (e.g. PSPICE) and playing
with physlet buttons as in a projectile motion physlet.
Stephen Wolfram
[the creator of Mathematica]
 A physicist!
 Published his first scientific paper at the age
of 15!!
 Received his Ph.D. in theoretical physics
from Caltech by the age of 20!!!
 Worked at the Institute for Advanced Study
in Princeton!!!!, then
 Professor of Physics, Mathematics, and Computer Science
at the University of Illinois @ Urbana-Champaign!!!!!
 President and CEO of Wolfram Research (!!!wow!!!)
Mathematica
 Is a (high level) programming language developed
by Stephen Wolfram (first release in 1988) with
special capabilities to do symbolic and numeric
calculations in addition to graphing and many other
features, as will be seen shortly.
 Integrated environment for technical computing.
 It has had a profound effect on the way computers
are used in many technical and other fields.
 First released in 1988; Current version: 5.1.
 Used by, literally, millions worldwide.
If you do not know much Mathematica
you may benefit from the electronic help
(the -electronic- Mathematica book)
Tour of features
http://www.wolfram.com/products/mathematica/tour/
Power of Mathematica
Basic calculations, significant figures,
trigonometry, complex notation
Algebra [systems of equations, eigensystem]
Graphics:
vector fields
3-D
parametric plotting
histograms
Symbolic computation
Numeric computation
“The key intellectual
advance that made
this possible was the
invention of a new
kind of symbolic
computer language
that could for the first
time manipulate the
very wide range of
objects involved in
technical computing
using only a fairly
small number of basic
primitives.”
Power of Mathematica
Special functions (Legendre, Bessel, Chebysef, …etc.)
Sound
Fitting data
Statistics
Communicate with external lists and Fortran.
How is mathematica any better than other languages
[Fortran, C++] or applications?
You are doing sophisticated Mathematical
programming easily!
With Mathematica, the entire approach to problem solving can be drastically changed.
We give some brief examples.
……………………………………………………………………………………
DOUBLE PENDULUM: This is a topic that is generally treated as an "advanced"
topic. With Mathematica, the solution is relatively straightforward. Once the
solutions is obtained, the textbooks try to describe (in words) the general properties
of the system, and the normal modes. (In particular, the property that the energy is
transferred back and forth between the two segments of the pendulum.) With the
animation capability of Mathematica, we do not need to lead the student to these
conclusions, but we can point them in the general direction, and let them discover
these results on their own by varying the amplitudes of the separate normal modes.
……………………………………………………………………………………
HYDROGEN ATOM: In the standard solution of the hydrogen atom, the student is
completely lost in the mathematics. Mathematica is able to recognize that the
solution of the radial equation is a Laguerre polynomial, assemble the constants to
form the principal quantum number, and plot the solutions. The student then has the
energy and the curiosity to numerically investigate the behavior of the
wavefunctions, and consider the disastrous consequences of choosing a non-integral
value for the principal quantum number.
An excerpt from Mathematica for Physics, by Robert L. Zimmerman and Fredrick I. Olness
Computation and
Mathematical Models
The concept is based on three elements:
1- The evolution of a system is referred to as the independent
variable. Usually, this is the variable of time (t).
2- The state variable is the finite dimensional vector variable
{u1(t), u2(t), ….un(t)} deemed sufficient to describe the
evolution of the physical state of the system. This is also called
the dependent variable.
3- The mathematical model of a system is an evolution equation
suitable to define the evolution of the state variable {u} that is
describing the system itself.
There are issues of validation, determinism and stochasticity that one needs to be concerned
with! (c.f. see: Mechanics and Dynamical Systems with Mathematica, by Bellomo et. al.)
Example of a computational model
A 1 kg particle, initially at x = 0, is moving with a velocity of 10 m/s, is acted
up on by a force in the x direction of the form: f(t) = -18 sin (2 t), where the
force is in newton and t is in seconds.
Describe the system
When it says to ‘describe’ the system, really what that
means is that we need to describe the evolution of the
state variable (x) in terms of the independent variable
(t) according to some model [in this case, Newton’s
2nd equation of motion.
How do we do this with Mathematica?!
[mathematical model]
Some examples of how Mathematica benefits
in phys-101/102.
 Projectile motion (1, 2, 3, 4)
 Waves (1, 2)
 Sound
800
600
400
200
50
By Dr. A. Al-Jalal using Mathematica
100
150
200
250
300
“Intermediate” level
physics
6
4
4
2
2
 Classical Mechanics (1, 2, 3,)
0
 Thermodynamics (1, 2)
-2
-4
-4
-2
0
2
4
 Optics
 Electronics (1, 2)
 Quantum Mechanics (initialize, 1, 2)
-3
-2
-1
1
-2
-4
-6
2
3
Higher level physics
120
100
80
60
40
20
20
 Green's function
 Canonical transformations
 Pendulum (advanced)
40
60
80
A series R,L,C electric
circuit (assume R2 <<
4L/C) initially carries
no charge nor current. At
time t = 0+ a volage V(t)
is applied across the
circuit such that:
 String oscillations
V(t) = Vo e-gt
 Chaos
Find the charge q(t) on
the capacitor for t>0.
 Motion on a surface
Hint: Use Green’s
method; see M&T sect.
3.10
100
Concluding Remarks
If I have made you think that working
with Mathematica is incredibly easy,
comforting and straightforward, and I
have done injustice to humanity 
Working with Mathematica, just like
working with any other computer code,
can become misleading, ambiguous or
even frustrating!
(Lissajous PlotPoints & missing x[n])
Web references that serve
Mathematica
Info[rmation] Center:
•
~ five thousand Mathematica programs and document
•
easy browsing and searching
http://library.wolfram.com/infocenter
Eric’s pages:
http://scienceworld.wolfram.com/physics/
The Mathematica Journal:
http://www.mathematica-journal.com/issue/v9i1/
Mechanics and Dynamical Systems with Mathematica:
http://www.birkhauser.com/supplements/081764007X/Additional_Resources/index.html
List of available books (some with CDs) for
Mathematica in Physics
1) Mathematica for Calculus-Based Physics, by Marvin L.
De Jong.
2) Mathematica for Physics, by Robert L. Zimmerman and
Fredrick I. Olness.
3) Mechanics and Dynamical Systems with Mathematica,
by Bellomo et. al.
4) Numerical and Analytical Methods for Scientists and
Engineers, using Mathematica author: Daniel Dubin
5) Nonlinear Physics with Mathematica for Scientists and
Engineers, by Richard H. Enns and George C. McGuire
6) Mathematical Methods Using Mathematica for Students
of Physics and Related Fields, by Sadri Hassani
Conclusions:
It would be wise of the KFUPM-Physics department to
seriously study the physics students’ computational skills
adequacy (or lack of) visa vis the current physics curriculum.
Mathematica is an interesting computer program that is very
useful in physics.
I hope I have been able to get you more interested in
computer programming for University pedagogy.
Using Mathematica is fundamentally different from using
simulations or playing with physlets.
I am willing to collaborate, on [research] problems, by
modeling, computing and writing papers together.
Thank you for your attention