PHY2027 Scientific Programming in C
2011-2012
Code: PHY2027
Level: 2
Title: Scientific Programming in C
Instructors:
Dr J.M. Rowe
CATS Credit Value: 15
ECTS Credit Value: 7.5
Pre-requisites: N/A
Co-requisites: N/A
Duration:
T1:01-11
Availability: unrestricted
Background Assumed: -
Total Student Study Time
150 hours, to include:
16×1-hour lectures;
6×3-hour and 5×2-hour supervised computer labs;
48 hours directed self-study and project work;
58 hours private study.
Aims
A knowledge of a computing language and how to write programs to solve physics
related problems is a valuable transferable skill. It is taught though a series
of practical sessions in which the student will initially learn to understand the
logic of the source code and are required to modify the code for a number of
prepared projects. This module yeaches the C programming lanaguage, but the principles
involved are applicable to almost every procedural programming language.
This module provides a general introduction to programming in C and to the main
elements of ANSI C. It is designed to give students the ability to write clearly structured,
debuggable and maintainable computer programs in C and to be able to understand such
programs written by others.
Intended Learning Outcomes
Students will be able to:
- Module Specific Skills:
- construct flow charts for computer code;
- write and modify simple programs in ANSI-C;
- find errors and debug code;
- use files, keywords, structured programs and
the elements which constitute good robust programs;
- apply the principles of designing and
writing debuggable and maintainable computer programs;
- design and code data structures that reflect the problems;
- write appropriately structured code based on short routines
with a clear purpose and interfaces that are simple and unambiguous;
- explain and use standard features of the C programming
language including structures, pointers and simple memory management;
- Discipline Specific Skills:
- apply logic to the solution of problems;
- keep proper records of work;
- apply the C programming language
to simple physical problems;
- present a portfolio of work.
- Personal Transferable Skills:
- deal with the practicalities of writing a computer program;
- think and plan in a logical manner;
- apply a structured approach to problem solving;
- make straightforward use of a professional programming IDE.
Learning / Teaching Methods
Lectures, e-Learning resources (ELE PHY2027),
and problems classes.
Assessment and Assignments
Contribution | Assessment/Assignment | Size (duration/length) | When |
40% | Four homework assignments | 8-hours each | Two-week intervals |
10% | Theory test | 30 minutes | Week T1:11 |
30% | Practical test | 1 hour | Week T1:11 |
20% | Project | 16-hours | Friday Week T1:11 |
Syllabus Plan and Content
- Introduction
Brief historical survey.
- ANSI C
- The Xcode Integrated Development Environment and C-compiler
- Local and global variables (integers, real, character)
- Arithmetic expressions, relational, logical, increment
and decrement operators
- Input/output (formats, data files, etc.)
- Functions and program structure (standard functions,
user-defined functions)
- Header files
- Arrays (strings, multidimensional arrays)
- Rounding errors and accuracy considerations
- Good programming practice
- Program design
- Data design
- Functions
- Variables and scope.
- Initialisation.
- Function Prototypes.
- Memory
- Pointers
- Arrays
- Memory allocation
- Structures
- Pointers to structures
- Using structures to pass data between functions
- Linked lists
- Projects
A number of projects based upon the Stage 2 physics course.
The background physics required for each project is provided for
the student in the project description.
Core Text
McGrath M. (
2002),
C Programming in Easy Steps (
3rd edition),
Computer Step,
ISBN 1-840-78203-X (UL:
005.133 MCG)
Supplementary Text(s)
Kernighan B.W. and Richie D.M. (
1988),
The C Programming Language (
2nd edition),
Prentice Hall,
ISBN 0-13-110362-8 (UL:
001.6424/C KER)
Oualline S. (
1997),
Practical C Programming (
3rd edition),
O'Reilly,
ISBN 1-565-92306-5 (UL:
005.133 OUA)
IOP Accreditation Compliance Checklist
- Not applicable, this is an optional module.
Formative Mechanisms
Performance in classwork is monitored throughout and problems discussed with individuals
during the class. Advice for better programming is written on homework assignments. Results of
the CA tests are discussed with individuals and a summary of common errors
given to all students.
Evaluation Mechanisms
The module will be evaluated using information gathered via the student representation mechanisms, the staff peer appraisal scheme, and measures of student attainment based on summative assessment.