teaching computational physics

1
Tools for Teaching Undergraduate Computational Physics School on Hands-on Research in Complex Systems, 30 June - 11 July 2014, ICTP, Trieste, Italy Amde A, Dept. of Physics, University of Gondar, P.O. Box 196, Ethiopia, [email protected] Abstract In fact, the use of computation and simulation has now become an essential and integral part of contempo- rary basic and applied sciences, and computation has become as important as theory and experiment. In Ethiopia, the Undergraduate Computational Physics (UCP) course was first introduced in 2003 as an elective course in University of Gondar’s Applied Physics Curriculum. Starting from 2010 UCP is included as a com- pulsory course in the Harmonized Undergraduate Physics Curriculum at all Ethiopian Universities. Though computational physics is now becoming an integral part of undergraduate physics curriculum, there is no still standardization in the contents, programming language and methodology used to teach UCP. The decision of what language to use to teach UCP is not an easy one. Some prefer using a general purpose- programming language while others prefer using symbolic or numeric computing environment. A few even tried to implement unusual approach by using non-specific pseudocode. At University of Gondar we chose Java to teach UCP and have been using it since 2005. Currently, we are considering using Java with Python. In this poster we’ll discuss uses of computers in physics and significance of simulation in studying physics. We’ll also discuss why we preferred Java and specific contents for the course. Our experience using Java to teach UCP is demonstrated by installing and configuring JDK & OSP tools, and by compiling and running some codes. 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, 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. Language and Content Selection Dilemma Content? (1) Linear Systems, (2) Non-linear, Chaotic & Multi-variable Systems, or (3) Both Language? (1) Pseudo-code, (2) General Purpose, or (2) Symbolic or Numeric Computing Environment Objective of the Undergraduate Computational Physics Course and time allotted for it Computing skills and experience of both Instructors and Students Availability and cost of Computational Resources and Facilities Numerical performance, ease of use, Web- and database driven applications, and good graphical inter- faces of Language/Computing Environment. Uses of Computers in Physics Numerical analysis Symbolic manipulation Visualization Simulation Data acquisition & analysis (CADA) Technology supported learning Why Java for Undergraduate Computational Physics? 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. Numerical Analysis Creates, analyzes, and implements algorithms for solving numerically the problems of continuous maths. Used to compute multidimensional integral & differential equations, manipulate large matrices, or solve linear & nonlinear differential equations Visualization (The Eye plus Visual Processing Capacity of the Brain) Patterns & trends that might not be evident from tables of data can be determined. Changes with time can be observed, and can lead to insight into the important mechanisms underlying a system’s behavior Install JDK on PCs Download the JDK Installer (from www.java.com or www.oracle.com/technetwork/java/javase/) Run the JDK Installer & follow the instructions. (JDK should be installed in the directory C:\ ) Add the jdk/bin directory into the execution path Configure Project/Development Environment Create a Project Directory (e.g. “C:\cp_project”) Download the Open Source Physics Eclipse Workspace (from www.compadre.org/OSP/) and unpack the source code for the OSP core library (src.zip) in to the Project Directory. C:\cp_project\src Create a directory named classes under the Project Directory. C:\cp_project\classes Why is Simulation becoming so Important in Physics? 1.Explore nonlinear phenomena - many natural phenomena are nonlinear & most are difficult to solve by analytical methods 2.Investigate systems with many variables or with many degrees of freedom 3.Investigate systems whose experimental studies are too complicated & expensive. Simulation frequently uses computational tools of numerical analysis & visualization. Edit: the source code can be ed- ited using Notepad(++) & saved as “FileName”.java under dir. C:\cp_project\src\”package” Compile: Open Command Prompt (C:\_) Change Directory to Project Dir. C:\cp_project javac d classes/ -sourcepath src/ src/”package”/”FileName”.java Run: java –classpath classes/ “package name”/”FileName” Example: java classpath classes/ sip/ch16/ TDHalfStepApp Results:

Upload: amdeselassie-amde

Post on 17-Aug-2015

73 views

Category:

Science


0 download

TRANSCRIPT

Page 1: Teaching Computational Physics

Tools for Teaching Undergraduate Computational Physics School on Hands-on Research in Complex Systems, 30 June - 11 July 2014, ICTP, Trieste, Italy

Amde A, Dept. of Physics, University of Gondar, P.O. Box 196, Ethiopia, [email protected]

Abstract

In fact, the use of computation and simulation has now become an essential and integral part of contempo-rary basic and applied sciences, and computation has become as important as theory and experiment. In Ethiopia, the Undergraduate Computational Physics (UCP) course was first introduced in 2003 as an elective course in University of Gondar’s Applied Physics Curriculum. Starting from 2010 UCP is included as a com-pulsory course in the Harmonized Undergraduate Physics Curriculum at all Ethiopian Universities. Though computational physics is now becoming an integral part of undergraduate physics curriculum, there is no still standardization in the contents, programming language and methodology used to teach UCP.

The decision of what language to use to teach UCP is not an easy one. Some prefer using a general purpose-programming language while others prefer using symbolic or numeric computing environment. A few even tried to implement unusual approach by using non-specific pseudocode. At University of Gondar we chose Java to teach UCP and have been using it since 2005. Currently, we are considering using Java with Python. In this poster we’ll discuss uses of computers in physics and significance of simulation in studying physics. We’ll also discuss why we preferred Java and specific contents for the course. Our experience using Java to teach UCP is demonstrated by installing and configuring JDK & OSP tools, and by compiling and running some codes.

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, 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.

Language and Content Selection Dilemma

Content? (1) Linear Systems, (2) Non-linear, Chaotic & Multi-variable Systems, or (3) Both

Language? (1) Pseudo-code, (2) General Purpose, or (2) Symbolic or Numeric Computing Environment

Objective of the Undergraduate Computational Physics Course and time allotted for it

Computing skills and experience of both Instructors and Students

Availability and cost of Computational Resources and Facilities Numerical performance, ease of use, Web- and database driven applications, and good graphical inter-

faces of Language/Computing Environment.

Uses of Computers in Physics

Numerical analysis

Symbolic manipulation

Visualization

Simulation

Data acquisition & analysis (CADA)

Technology supported learning

Why Java for Undergraduate Computational Physics? 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.

Numerical Analysis Creates, analyzes, and implements algorithms for solving numerically the problems of continuous maths. Used to compute multidimensional integral & differential equations, manipulate large matrices, or solve

linear & nonlinear differential equations

Visualization (The Eye plus Visual Processing Capacity of the Brain)

Patterns & trends that might not be evident from tables of data can be determined. Changes with time can be observed, and can lead to insight into the important mechanisms underlying a

system’s behavior

Install JDK on PCs

Download the JDK Installer (from www.java.com or www.oracle.com/technetwork/java/javase/) Run the JDK Installer & follow the instructions. (JDK should be installed in the directory C:\ ) Add the jdk/bin directory into the execution path Configure Project/Development Environment

Create a Project Directory (e.g. “C:\cp_project”) Download the Open Source Physics Eclipse Workspace (from www.compadre.org/OSP/) and unpack

the source code for the OSP core library (src.zip) in to the Project Directory. C:\cp_project\src Create a directory named classes under the Project Directory. C:\cp_project\classes

Why is Simulation becoming so Important in Physics? 1. Explore nonlinear phenomena - many natural phenomena are nonlinear & most are difficult to solve by

analytical methods 2. Investigate systems with many variables or with many degrees of freedom 3. Investigate systems whose experimental studies are too complicated & expensive.

Simulation frequently uses computational tools of numerical analysis & visualization.

Edit: the source code can be ed-ited using Notepad(++) & saved as “FileName”.java under dir. C:\cp_project\src\”package”

Compile: Open Command Prompt (C:\_) Change Directory to Project Dir.

C:\cp_project

javac –d classes/ -sourcepath src/ src/”package”/”FileName”.java

Run: java –classpath classes/ “package name”/”FileName”

Example: java –classpath classes/ sip/ch16/

TDHalfStepApp

Results: