Skip to main content Skip to navigation

PX150-6 Physics Programming Workshop

Department
Physics
Level
Undergraduate Level 1
Module leader
Michal Kreps
Credit value
6
Module duration
5 weeks
Assessment
100% coursework
Study location
University of Warwick main campus, Coventry
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 free-to-user codes available. The module also looks at visualisation of data.

Module web page

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; analyse simple physics
data; Arrays and computer graphics; plotting curves and working with vectors and matrices

Functions: Algorithms and software design; tests, error handling and modules; Random numbers
and computer simulations; Maths on the computer; Differential equations, integration, linear
algebra

Learning outcomes

By the end of the module, students should be able to:

  • Use scientific and graphical libraries
  • Respect the principles of good software design
  • Present their results graphically
  • Write python programs to formulate and solve simple maths and physics problems involving differential equations, linear algebra and integration
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 e-books (2012):
http://link.springer.com/book/10.1007%2F978-3-642-18366-9

View reading list on Talis Aspire

Subject specific skills

Programming in Python

Transferable skills

IT, problem-solving, self-study

Study time

Type Required
Lectures 5 sessions of 1 hour (8%)
Practical classes 5 sessions of 2 hours (17%)
Private study 45 hours (75%)
Total 60 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.

Students can register for this module without taking any assessment.

Assessment group A1
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:

  • Year 1 of UPXA-FG33 Undergraduate Mathematics and Physics (BSc MMathPhys)
  • UPXA-GF13 Undergraduate Mathematics and Physics (BSc)
    • Year 1 of GF13 Mathematics and Physics
    • Year 1 of GF13 Mathematics and Physics
  • UPXA-FG31 Undergraduate Mathematics and Physics (MMathPhys)
    • Year 1 of FG31 Mathematics and Physics (MMathPhys)
    • Year 1 of FG31 Mathematics and Physics (MMathPhys)
  • UPXA-F300 Undergraduate Physics (BSc)
    • Year 1 of F300 Physics
    • Year 1 of F300 Physics
    • Year 1 of F300 Physics
  • UPXA-F303 Undergraduate Physics (MPhys)
    • Year 1 of F300 Physics
    • Year 1 of F303 Physics (MPhys)
  • Year 1 of UPXA-F3N1 Undergraduate Physics and Business Studies
  • UPXA-F3F5 Undergraduate Physics with Astrophysics (BSc)
    • Year 1 of F3F5 Physics with Astrophysics
    • Year 1 of F3F5 Physics with Astrophysics
  • Year 1 of UPXA-F3FA Undergraduate Physics with Astrophysics (MPhys)
  • Year 1 of UPXA-F3N2 Undergraduate Physics with Business Studies