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
- Modeling methods
- Graphics
- Simulation
- Interaction
- Programming
Prerequisites:
- Interest in modeling physical phenomena
- Vector calculus
- Linear algebra
- Lower division Math, Physics, or CS courses
- Programming: C/C++, Java, or Python (We will use Python.)
- Laptop with Python version 2.7 running
Readings:
- Python textbook: Learning Python, Lutz & Ascher, Fourth Edition, 2009
- Course Lecture Notes (available via course website).
Contents
First Lecture (2 October, Tuesday): Overview
Readings:
- Chaos, JP Crutchfield, JD Farmer, NH Packard, RS Shaw, Scientific American 255 (1986)
46–57. Online here.
Topics:
- Introduction and motivations
- Survey interests, background, and abilities
- Course logistics
- Homeworks and projects
- 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:
- Modeling: Simulation, interaction, and graphics programming
- Python language (Ch. 1)
- Python and scientific computing packages installed and running (Ch. 2)
- Developing and running Python using iPython (Ch. 3)
- Python Data Types (Chapters 4 and 5)
- 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:
- Sequence Objects
- Lists (Chapter 4, pp. 86-89, and Chapter 8, pp. 197-206)
- Tuples (Chapter 4, pp. 96-97, and Chapter 9, pp. 225-228)
- Loops (Chapter 13)
- Expressions and conditionals (Chapters 11 and 12)
- Text files (Chapter 4, pp. 229-238)
- 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:
- Dictionaries (Chapter 4, pp. 90-95, and Chapter 8, pp. 207-232)
- Arrays (WWW)
- Functions (Chapters 16-18)
- Modules (Chapters 21-22)
- Command line control (WWW)
- Scripting (WWW)
- 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:
- Statistics (WWW)
- Fourier Transforms
- Functions on a grid
- Random numbers
- Linear Algebra (WWW)
- Vectors and matrices
- Eigensystems
- Root finding
- 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:
- Plotting
- Saving results
- 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:
- Data Types (Chapter 4)
- Designing data types (Chapter 6)
- Object-oriented programming (Chapters 25 and 30)
- Architecture of simulation tools
- Classes (Chapters 25-27)
- Class attributes (Chapter 28)
- Specializing Classes (Chapters 28 and 29)
- Expending Classes (Chapter 31)
- 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:
- Visualizing two-dimensional maps
- Numerically integrating ODEs
- Euler Integrator
- Runge-Kutta Integrator
- Three-dimensional visualization
Homework: Collect Week 6’s. End of Homeworks.
Programming Lab J (4 December, Tuesday): Spatially Extended Dynamical Systems
Topics:
- Heat Equation in 1D
- Cellular automata in 1D and 2D
- Lattice dynamical systems in 1D and 2D