Computational Laboratory in Physics
Physics 102
Spring 2012
Syllabus

Instructor: Prof. Jim Crutchfield (chaos@cse.ucdavis.edu; http://cse.ucdavis.edu/~chaos)
Assistant: Alec Boyd (alecboy@gmail.com)
Lectures: Tuesdays 3:10-4 PM, 148 Physics
Computer Labs: Business hours, 106 Physics
WWW: http://csc.ucdavis.edu/~chaos/courses/clab/

Theme: Tools for Doing Physics

  1. Modeling methods
  2. Graphics
  3. Simulation
  4. Interaction
  5. Programming

Prerequisites:

Readings:

Contents

First Lecture (2 October, Tuesday): Overview

Readings:

Topics:

  1. Introduction and motivations
  2. Survey interests, background, and abilities
  3. Course logistics
  4. Homeworks and projects
  5. Software and program development

Homework Week 0: Assigned. Due 9 October.

Programming Lab A (9 October, Tuesday): Python and Its Environment

Reading: Python Part I (Chapters 1-3) and Part II (Chapter 4, pp. 75-78, and Chapter 5).

Topics:

  1. Modeling: Simulation, interaction, and graphics programming
  2. Python language (Ch. 1)
  3. Python and scientific computing packages installed and running (Ch. 2)
  4. Developing and running Python using iPython (Ch. 3)
  5. Python Data Types (Chapters 4 and 5)
  6. Python as a calculator (WWW)

Homework: Collect Week 0’s, assign Week 1’s.

Programming Lab B (16 October, Tuesday): Python, the Language

Reading: Python Part II (Chapters 4 and 7-9) and Part III (Chapters 11-13).

Topics:

  1. Sequence Objects
  2. Lists (Chapter 4, pp. 86-89, and Chapter 8, pp. 197-206)
  3. Tuples (Chapter 4, pp. 96-97, and Chapter 9, pp. 225-228)
  4. Loops (Chapter 13)
  5. Expressions and conditionals (Chapters 11 and 12)
  6. Text files (Chapter 4, pp. 229-238)
  7. String operations (Chapter 7)

Homework: Collect Week 1’s, assign Week 2’s.

Programming Lab C (23 October, Tuesday): Arrays, Dictionaries, Functions, and Modularity

Reading: Python Part III (Chapters 4, 8, and 15), Part IV (Chapters 16-18), and Part V (Chapters 21-22) & course website (WWW).

Topics:

  1. Dictionaries (Chapter 4, pp. 90-95, and Chapter 8, pp. 207-232)
  2. Arrays (WWW)
  3. Functions (Chapters 16-18)
  4. Modules (Chapters 21-22)
  5. Command line control (WWW)
  6. Scripting (WWW)
  7. Documenting code (Chapter 15)

Homework: Collect Week 2’s, assign Week 3’s.

Programming Lab D (30 October, Tuesday): Statistics, Linear Algebra, and Plotting

Reading: WWW.

Topics:

  1. Statistics (WWW)
    1. Fourier Transforms
    2. Functions on a grid
    3. Random numbers
  2. Linear Algebra (WWW)
    1. Vectors and matrices
    2. Eigensystems
    3. Root finding
  3. Plotting (WWW)

Homework: Collect Week 3’s, assign this week’s (4).

Programming Lab E (6 November, Tuesday): Plotting and One-Dimensional Dynamics

Reading: WWW.

Topics:

  1. Plotting
  2. Saving results
  3. One-dimensional dynamics

Homework: Collect Week 4’s, assign this week’s (5).

Programming Lab F (13 November, Tuesday): Objects, Classes, and Error Handling

Reading: Python Part II (Chapters 4 and 6), Part VI (Chapters 25-31), and Part VII, Chapters 32-35)

Topics:

  1. Data Types (Chapter 4)
  2. Designing data types (Chapter 6)
  3. Object-oriented programming (Chapters 25 and 30)
  4. Architecture of simulation tools
  5. Classes (Chapters 25-27)
  6. Class attributes (Chapter 28)
  7. Specializing Classes (Chapters 28 and 29)
  8. Expending Classes (Chapter 31)
  9. Error handling (Chapters 32-35)

Homework: Collect Week 5’s, assign this week’s (6).

Programming Lab G (20 November, Tuesday): Numerical Integration and Visualization

Reading: WWW.

Topics:

  1. Visualizing two-dimensional maps
  2. Numerically integrating ODEs
    1. Euler Integrator
    2. Runge-Kutta Integrator
  3. Three-dimensional visualization

Homework: Collect Week 6’s. End of Homeworks.

Programming Lab J (4 December, Tuesday): Spatially Extended Dynamical Systems

Topics:

  1. Heat Equation in 1D
  2. Cellular automata in 1D and 2D
  3. Lattice dynamical systems in 1D and 2D