.jpg)
- UCAS course code
- F345
- UCAS institution code
- M20
Course unit details:
Introduction to Programming for Physicists
Unit code | PHYS20161 |
---|---|
Credit rating | 10 |
Unit level | Level 2 |
Teaching period(s) | Semester 1 |
Available as a free choice unit? | No |
Overview
Introduction to Programming for Physicists
Pre/co-requisites
Follow-up units:
PHYS20872: Theory Computing Project
PHYS20762: Computational Physics
PHYS30762: OOP in C++
Some experiments in Y3 lab (PHYS30280) require computing.
Many MPhys projects require at least some element of computing (PHYS40181/2)
Aims
The aim of the course is to give a practical introduction to computer programming for physicists assuming little or no previous programming experience.
Learning outcomes
On completion successful students will:
- Be able to write programs in Python to aid them in practical situations they will face in their degree course and future work in physics or in other fields.
- Implement basic programming theory to write efficient code.
Syllabus
Elements of Programming – (3 weeks)
- Introduction to Python
- Variable types and lists
- Operators
- Input / output
- Conditional expressions
- Loops
- Introduction to debugging, testing and errors
- Functions
- Style and PEP8
Basic Python libraries and validation – (2 weeks)
- Python Modules
- Introduction to numpy
- Numpy arrays, built-in functions and indexing
Introduction to algorithms and visualisation – (3 weeks)
- Algorithms and their uses
- Basic manipulation and visualisation of data
- Read and write files
- Data validation
- Root finding
- Basic optimization algorithms
Introduction to scientific programming libraries – (3 weeks)
- Advanced uses of numpy and matplotlib
- Introduction to scipy
- Using inbuilt functions
Assessment methods
5 BlackBoard quizzes worth 7% each due weeks 1-3,7 and 8.
1st assignment worth 15%
Final assignment worth 50%
Standard late penalties apply of 10% deducted per day late for each assessment.
Feedback methods
Feedback is offered orally by demonstrators in the lab, automated responses in the quizzes, and specific written comments for each assignment.
Recommended reading
Hill, C. Learning scientific programming with python (Cambridge Uni. press)
Study hours
Scheduled activity hours | |
---|---|
Lectures | 10 |
Practical classes & workshops | 66 |
Independent study hours | |
---|---|
Independent study | 24 |
Teaching staff
Staff member | Role |
---|---|
Clive Dickinson | Unit coordinator |
Lloyd Cawthorne | Unit coordinator |
Additional notes
Note: Laboratory facilities are not available for resits. A student who has failed may be permitted to submit further assessments, based on laboratory work already carried out, in order to pass the course unit.