Experience from Physics Department, University of Gondar ...why we should teach our students undergraduate computational physics (UCP), and Free & Open Resources for teaching UCP
Resources for Teaching Undergraduate Computational Physics
1. Tools & Resources forTeaching
Undergraduate Computational
Physics
Amde A, Dept. of Physics, University of Gondar, P.O. Box 196,
Ethiopia, mdselassie@gmail.com
“Computers are incredibly fast, accurate, and stupid; humans are incredibly
slow, inaccurate, and brilliant; together they are powerful beyond imagination”.
- Albert Einstein
“Computational scientists solve tomorrow’s problems with yesterday’s
computers; computer scientists seem to do it the other way round”.
- (Unknown)
2. What is Computational Physics?
A multidisciplinary subject that uses computing approach to
gain understanding in complex systems, like QCD,
electronic structure, molecular dynamics, nuclear fusion,
climate dynamics, relativistic astrophysics.
Provides the capability to study and gain novel insights into
physical systems, especially for those where no analytical
solutions can be found or an experimental study is too
complicated or expensive.
An essential and integral part of contemporary sciences,
and has become as important as theory and experiment.
3. Computational Physics is multidisciplinary.
It combines disciplines like Computer Science and
Mathematics with Physics (Landau)
4. Computation is as important as theory & experiment
Use of computation and simulation has now become an
essential and integral part of contemporary basic and
applied sciences (Landau)
5. Some Uses of Computers in Physics (Gould)
I. Numerical analysis
II. Symbolic manipulation
III. Visualization
IV. Simulation
V. Data acquisition & analysis
VI. Technology Enabled Learning
6. I. Numerical Analysis - Creates, analyzes, & implements algorithms
for solving numerically the problems of continuous math.
Used to compute multidimensional integral & differential
equations, manipulate large matrices, or solve linear & nonlinear
differential equations
Some software: MATLAB, LabVIEW, GNU Octave & SciLab
II. Symbolic Manipulation
Used to manipulate differentiation, integration, matrix
inversion, power series expansion, …
Some software: Mathematica, Maple, Maxima & SAGE
7. III. Visual Representation (Gould)
◦ The Eye +Visual Processing Capacity of the Brain
◦ Patterns & trends that might not be evident from tables of data
can be determined. Example: Run Sfileosp_qm_twostate.jar
◦ Changes be observed & can lead to insight into the important
mechanisms underlying a system’s behavior
8. IV. Technology Enabled Learning
developed by integrating education research results with
technology tools
transform learning from teacher-centered to student-centered
requires new physical and cognitive architecture
Some Examples
1. Lecture Based Model - Just inTimeTeaching, Peer Instruction,
Interactive Lecture Demonstrations, …
2. TEAL (Technology Enabled Active Learning),
http://icampus.mit.edu/projects/teal/
3. SCALEUP (Student Centered Active Learning
Environment with Upside down Pedagogy)
http://scaleup.ncsu.edu/
9. 4. Laboratory:
a. Remote Controlled Lab, i-Lab
real experimental facilities/setups that can be controlled
remotely over the internet.
Examples:
◦ robotic telescopes, rcl (http://rcl.physik.uni-kl.de/),
◦ i-labs (http://icampus.mit.edu/iLabs/default.aspx)
b. Virtual Lab
interactive pc-based activity where students conduct or create
simulated experiments.Virtual instruments & apparatus that
simulate the functions & characteristics of real ones are used.
Examples:
◦ Run: Sfileub_optics.jar
◦ PhET Interactive Simulation: https://phet.colorado.edu/
11. 5. Data Acquisition & Analysis
◦ Computer based measurement that requires interfacing the
computer with various instrumentations & sensors
◦ Involves real-time control & interactive data analysis
◦ You need: computer hardware, software, sensors, interfaces
Example:
◦ Software: LabVIEW
12. o Sensors & Interfaces/DAQ Boards
Example: Determination of Coefficient of Linear Expansion
13. The Importance of Computer Simulation
Simulation – implementing a model on a computer (to understand
its behavior & predictions)
Frequently uses computational tools of numerical analysis &
visualization.
14. Why is computation becoming so important in physics?
1. Explore nonlinear phenomena. Many natural phenomena
are nonlinear & most are difficult to solve by analytical
methods. Example: Download & Run Sfileejs_sip_ch06.jar
2. Investigate systems with many variables or with many
degrees of freedom
3. Investigate systems whose experimental studies are too
complicated & expensive.
15. Language & Content Selection Dilemma
Though undergraduate computational physics (UCP) is now
becoming an integral part of the physics curriculum, there is
no still standardization in the contents & programming
language used to teach the course.
Content Options?
◦ Linear Systems,
◦ Non-linear, Chaotic & Multi-variable Systems, or
◦ Both (Linear & Non-linear)
Language Options?
◦ Symbolic or Numeric Computing Environment (MATLAB,
Octave, Mathematica, Maple …)
◦ Non-Specific Pseudo-code (Giordano), or
◦ General Purpose (FORTRAN, C/C++, Java, Python …)
16. … Language & Content
The decision of what contents & languages to use to teach
UCP is not an easy one, but depends mostly on:
◦ Objectives of the UCP Course and time allotted for it,
◦ Computing skills & experience of both Instructors and
Students,
◦ Availability & cost of Computational Resources and
Facilities,
◦ Numerical performance, ease of use, good graphical
interfaces, & Web-based & database driven applications
of Language/Computing Environment.
17. … Language & Content
At University of Gondar we chose following contents &
language to teach UCP & have been using it since 2005:
◦ Both (Linear & Non-linear Systems) for Content, &
◦ Java for Language
◦ Currently, we are considering using Java with Python.
Why Linear & Nonlinear Contents?
◦ The course focuses on studying & developing simulation
for nonlinear & many variable systems, but
◦ Linear systems are used for introducing the basics of the
Language & Numerical Methods
18. … Language & Content
Why Java?
◦ Platform independent; (API, neutral byte code, JVM)
◦ Flexible standard graphics libraries & good performance
◦ Web-based & server-based applets
◦ Free and relatively simple to learn
◦ Supported by OSP (OpenSourcePhysics), extensive library of
open-source Java routines for computational work
(www.compadre.org/OSP/ ).
Disadvantage:
◦ Despite the high level of abstraction and platform
independence, the speed & performance of Java is not
comparable with C++ or Fortran.
◦ It is not supported by numerical libraries.
19. Installation
Download the JDK Installer (from www.java.com or
www.oracle.com/technetwork/java/javase/downloads/index.html)
JDK on Windows:
Run the JDK Installer & follow the instructions. (JDK should
be installed in the directory C: )
Add the jdk/bin directory into the execution path
JDK on Linux (for root users):
Uncompress the binary file (for 64-bit & update 60):
tar zxvf jdk-8u60-linux-x64.tar.gz
Move the JDK directory to /usr/lib
sudo mkdir -p /usr/lib/jvm
sudo mv /jdk1.8.60 /usr/lib/jvm/
20. … Installation
JDK on Linux:
Now enable Java
sudo update-alternatives --install "/usr/bin/java" "java"
"/usr/lib/jvm/jdk1.8.0_60/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac"
"/usr/lib/jvm/jdk1.8.0_60/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws"
"/usr/lib/jvm/jdk1.8.0_60/bin/javaws" 1
Change the file ownership & permissions of the
executables; use the chmod a+x command.
21. Configure Project/Development Environment
(Based on OpenSourcePhysics & An Introduction to Computer Simulation
Methods, 3ed, by Gould &Tobochinik)
Windows:
Create a Project Directory (e.g.“C:cp_projects”)
Download the OpenSourcePhysics Eclipse Workspace (from
www.compadre.org/OSP/ ) and unpack the source code for the
OSP core library (src.zip) in to the Project Dir.
Create a Dir. named classes under the Project Dir.:
C:cp_projectsclasses
Create a Dir. named org under classes & a Dir. named
opensourcephysics under the org Dir.:
C:cp_projectsclassesorgopensourcephysics
Copy the resource Dir. from …srcorgopensourcephysics to
…classesorgopensourcephysics
22. …Configure Project
Linux:
Create a Project Dir. under the user’s Home Dir., unpack
the core library src.zip, & make directory named classes:
mkdir /cp_projects
unzip /cp_projects/src.zip
mkdir /cp_projects/classes
Create a directory named org under classes & a directory
named opensourcephysics under the org Dir.:
mkdir /cp_projects/classes/org/opensourcephysics
Copy the resource Dir. from …srcorgopensourcephysics to
…classesorgopensourcephysics
23. Edit
Windows:
the source code can be edited using Notepad (++) &
saved as “FileName”.java under Directory:
C:cp_projectsrc”package”
Linux:
the source code can be edited using text editor gedit &
saved as “FileName”.java under Directory:
home/”user”/cp_project/src/”package”