Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

LAB

OVERVIEW

Introduction
Welcome to computational physics
Computational techniques play a critical role in modern physics. The aim of the module is to introduce you to
computational physics, through a series of experiments related to the Optics and Thermal Physics lecture material.
The module assumes no prior programming experience, and starts by teaching fundamental programming concepts
with MATLAB. The module introduces two classes of numerical methods: Fourier transforms and Monte Carlo
methods. These are applied to solving a range of physics problems. The focus is on computational thinking -
emphasising that numerical approaches to problem solving are a key part of modern physics.
This module will give you a foundation in programming skills and numerical analysis techniques that you will be
able to use throughout the rest of your degree (and career).

Why program in MATLAB?


MATLAB is a powerful stand-alone platform that can be used to solve complex problems in science and engi-
neering. MATLAB contains a wide range of numerical recipes to build numerical solutions to physical problems
and contains powerful data analysis tools. MATLAB uses a high-level interpretative language that largely focuses
on vector and matrix manipulation, and this type of programming is known as vector programming. This makes
MATLAB particularly useful for translating physical problems into code

Why not a lower level programming language like C? Isn’t it faster and better?
This question might be asked by the keen programmers in the group, and perhaps the most important answer is:
time. Although when solving complex and well defined numerical problems a lower level language may be best,
MATLAB’s vector programming language makes it easy to translate problems from paper to computation. It is
also easy to visualise things in MATLAB, which makes it very quick to run different experiments and simulations.
Because MATLAB uses vector programming, with built-in functions compiled in C (and Java), it is still fast
enough for a majority of applications.

How the labs work


In the first four labs, we will introduce introductory programming concepts. Even if you have experience pro-
gramming in another language, you should do all these exercises to make sure you understand MATLAB syntax.
Many of the labs have challenge questions at the end, for students who already have programming experience.
These questions are not assessed and the skills from these sets will not be tested.
As we go through the labs we will build on the basic skills you learn in the first four labs, writing increasingly
sophisticated programs to solve computational physics problems. Each lab will have several sections:

• Walkthroughs: Short introductions to particular skills or topics. You should follow through the activity,
and try out the code snippets yourself.
• Exercises: Questions to test the skills you have just learnt, and reinforce earlier concepts.
• Activities: A series of questions focused on a particular physics topic.
• Challenge questions: For those who have finished the labs. These questions are not assessable but are fun
and challenging exercises to extend your skills in MATLAB.

Also importantly, you don’t need to use your hand-held calculator for any of the questions. You should use
MATLAB for everything: the more practice you get the quicker you’ll learn to program.

PHYS2011/2911 Computational Physics 1


LAB OVERVIEW PHYS2011/2911 Computational Physics

Assessment
This module is worth 20 marks. Of these, 8 marks are awarded for attending and completing the weekly labs.
To get full marks for a lab you have to complete the lab material within the lab session. If you partially complete a
checkpoint you can get half the marks for that checkpoint. If there is a reason you can’t attend the lab session in a
particular week, please email the lab coordinator (or cp-help@physics.usyd.edu.au) to arrange a different session.
In addition there is a mid-semester test worth 4 marks and a final lab exam worth 8 marks. Both of these will be
held in your usual lab sessions and will involve solving problems using MATLAB. A sample exam paper will be
available on the unit website.
All lab work will be completed in pairs. You should stay with the same partner all semester, but if you have any
issues, please discuss them with your lab supervisor. It is preferable that you work with someone in the same
stream (Normal and Advanced) as there are some questions in the lab material for PHYS2911 students only.

Timetable
Date Week Lab Topic
05/03/18 W1 No computational lab
12/03/18 W2 L1 MATLAB as a calculator
19/03/18 W3 L2 Programming in MATLAB
26/03/18 W4 No computational lab
02/04/18 - Mid-Semester Break
9/04/18 W5 L3 Numerical modelling
16/04/18 W6 L4 Numerical ray tracing
23/04/18 W7 Lab Test
30/04/18 W8 L5 Introduction to Fourier transforms
07/05/18 W9 L6 2D Fourier transforms
14/05/18 W10 L7 Radio interferometry
21/05/18 W11 L8 Probability and random walks
28/05/18 W12 L9 Monte Carlo simulations
05/06/18 W13 E Lab exam

Practicing MATLAB
There are a few different options for practicing MATLAB in your own time:

1. In the lab: All students in PHYS2011 and PHYS2911 are free to use the SNH 4003 lab during normal
working hours, whenever it is not being used for another class.
2. Access Labs: The University Access Labs all have MATLAB installed. You will have to copy any relevant
code using a USB, or by emailing it to yourself from the CP Lab.

3. Purchase MATLAB: The student edition of MATLAB is about $100 and is available from a range of places
such as the Co-op Bookshop on campus. If you are planning on going on in physics or engineering this is a
good investment in the rest of your degree/career.
4. Remote desktop: The University has made MATLAB available for free to all students via the remote
desktop. You can use this from anywhere that you have an internet connection.
http://sydney.edu.au/ict/student/software/online.shtml
5. Octave: There is a GPL software package called Octave that is very similar (but not identical) to MATLAB.
If you are a confident programmer this is a good option. I don’t recommend this for complete beginners in
case the small differences between MATLAB and Octave are confusing.

6. Email us: Ask the tutors for help at cp-help@physics.usyd.edu.au

You might also like