PX15910 Physics Programming Workshop
Introductory description
This module introduces the Python programming language. It is quick to learn and encourages good programming style. Python is an interpreted language, which makes it flexible and easy to share. It allows easy interfacing with modules, which have been compiled from C or Fortran sources. It is widely used throughout physics and there are many downloadable freetouser codes available. The module also looks at visualisation of data.
Module aims
To introduce scientific programming with the help of the Python programming language, a language widely used by physicists.
Outline syllabus
This is an indicative module outline only to give an indication of the sort of topics that may be covered. Actual sessions held may differ.
A brief introduction to python. Simple maths and physics on the computer. Data/File Input/ Output and control in Python. Loops, conditions and lists.
Functions: Algorithms and software design; tests, error handling and modules
Introduction to Numpy and scipy. Working with vectors and matrices, integration
Graphical representation of the calculation using matplotlib
Basic statistics, probability density distributions, random number generation
Simple data fitting using scipy, physics analysis
Learning outcomes
By the end of the module, students should be able to:
 Write python programs
 Formulate and solve simple maths and physics problems involving differential equations, linear algebra and integration, using python
 Use scientific and graphical libraries
 Perform statistical calculations using python
 Implement good software design
 Present results graphically
Indicative reading list
Python documentation: http://www.python.org/doc/
Scientific Python: http://docs.scipy.org/doc/scipy/reference/
H.P. Langtangen, A Primer on scientific programming with Python, Springer ebooks (2012):
http://link.springer.com/book/10.1007%2F9783642183669
View reading list on Talis Aspire
Subject specific skills
Programming in Python
Transferable skills
IT, problemsolving, selfstudy
Study time
Type  Required 

Lectures  10 sessions of 1 hour (10%) 
Practical classes  10 sessions of 2 hours (20%) 
Private study  70 hours (70%) 
Total  100 hours 
Private study description
Work through module notes, write programs in Python, discuss with others taking the module, prepare and submit assessments
Costs
No further costs have been identified for this module.
You do not need to pass all assessment components to pass the module.
Assessment group A
Weighting  Study time  

Problem sets / Practical tasks  100%  
Weekly problems sets, practical tasks 
Feedback on assessment
Surgery discussions and comments on assessed work
Courses
This module is Core for:

UPXAGF13 Undergraduate Mathematics and Physics (BSc)
 Year 1 of GF13 Mathematics and Physics
 Year 1 of GF13 Mathematics and Physics

UPXAFG31 Undergraduate Mathematics and Physics (MMathPhys)
 Year 1 of FG31 Mathematics and Physics (MMathPhys)
 Year 1 of FG31 Mathematics and Physics (MMathPhys)

UPXAF300 Undergraduate Physics (BSc)
 Year 1 of F300 Physics
 Year 1 of F300 Physics
 Year 1 of F300 Physics

UPXAF303 Undergraduate Physics (MPhys)
 Year 1 of F300 Physics
 Year 1 of F303 Physics (MPhys)

UPXAF3F5 Undergraduate Physics with Astrophysics (BSc)
 Year 1 of F3F5 Physics with Astrophysics
 Year 1 of F3F5 Physics with Astrophysics
 Year 1 of UPXAF3FA Undergraduate Physics with Astrophysics (MPhys)
 Year 1 of UPXAF3N2 Undergraduate Physics with Business Studies