An Introduction to Computing in Physics


Physics 246 (298 owl), Spring 2019

Loomis 276, Thursday afternoons, 4 pm - 5:50 pm

2 credit hours


Textbooks and so forth


There are no required texts.. You should buy the course packet from the university bookstore, which should be available before the start of the semester. You must come to each class (including the first) with the course packet and a Windows or Mac OS laptop. You'll need to have a couple of gigabytes of available disk space for the first-day installation of the version of Python that we'll be using. Please be sure to bring your power adapter too.

I will have a handful of USB memory sticks for Mac and Windows machines to loan you the first day. They'll hold an installation package for Anaconda's python developer's environment, a folder of useful python scripts, and a PDF file of the course material.

You must buy the course packet at the bookstore. There isn't anything else you'll need to buy, but if you'd like a Python text (at a highly reduced price), consider picking up a copy of Hans Petter Langtangen, A Primer on Scientific Programming with Python, 5th ed. (2016). It is the required text for CS 101. Quoting from the CS 101 web site, "Please note that softcover copies are also available through Springer at a price much reduced relative to the hardcover edition. (You'll need to be on the campus network or log in via the library to see the offer.) An e-book is also available through the SpringerLink service, although we highly recommend acquiring a physical textbook."

Click here for the current version of the course packet.
Click here for a folder of useful python scripts.

Syllabus


  • Unit 1 and homework (class #1; homework due at the start of class #2)

    Using Python to generate numerical solutions to problems that are not suitable for analytic resolution.
    Science: relativistic starship undergoing uniform proper acceleration; infinite series representations of π .
    Programming: a simple model for what goes on inside a computer. An introduction to the Python programming language. Loops, variable types, arrays, conditionals, Spyder development environment.
    Numerical methods: discrete sums as approximations to integrals of continuous functions.

  • Unit 2 and homework (class #2; homework due at the start of class #3)

    Graphical representations of functions of one and two dimensions: a warm-up to representations of spacetime curvature.
    Science: a couple of functions relating to spacetime curvature.
    Programming: software libraries, drawing curves and surfaces, graphing functions of one and two variables.
    Numerical methods: more of the same.

  • Unit 3 and homework (class #3; homework due at the start of class #4)

    Creating graphical representations of spacetime curvature.
    Science: non-Euclidian geometry, spacetime curvature, Schwarzschild metric.
    Programming: more of the same.
    Numerical methods: more of the same.

  • During class #4: in-class quiz, 30 minutes.


  • Unit 4a and homework (class #4; homework due at the start of class #6)

    Numerical integration of differential equations of motion 1.
    Science: linear and nonlinear oscillators, phase space trajectories.
    Programming: using the debugger.
    Numerical methods: numerical integration of differential equations, accuracy vs. step size, comparison of first- and higher-order methods.

  • Unit 4b and homework (class #5; homework due at the start of class #6)

    Numerical integration of differential equations of motion 2.
    Science: continuation of last unit.
    Programming: continuation of last unit.
    Numerical methods: continuation of last unit.

  • Unit 5 and homework (class #6; homework due at the start of class #7)

    Relativistic corrections to GPS satellite clocks.
    Science: relativistic corrections to GPS satellite clocks in elliptical orbits.
    Programming: managing programs built from multiple functions in multiple files.
    Numerical methods: numerical integration of differential equations in two dimensions.

  • Unit 6a and homework (class #7; homework due at the start of class #8)

    Precision orbital dynamics 1: highly eccentric satellite orbits; general relativistic effects.
    Science: general relativistic modifications to Newtonian gravitation, observable astronomical effects.
    Programming: adaptive integration techniques.
    Numerical methods: Extended precision variables and machine precision issues.

  • Unit 6b and homework (class #8; homework due at the start of class #9)

    Precision orbital dynamics 2: general relativistic modifications to Keplerian orbits; effects of the other planets on Mercury's orbit.
    Science: precession of Mercury's perihelion, planetary perturbation of the orbit.
    Programming: More of the same.
    Numerical methods: More of the same.

  • Unit 7 and homework (class #9; homework due at the start of class #10)

    Searching for exoplanets.
    Science: Identifying stars with planetary systems through periodic fluctuations in the Doppler shifts of stellar spectra.
    Programming: file and data I/O.
    Numerical methods: integral transforms.

  • Unit 8 and homework (class #10; homework due at the start of class #11)

    Monte Carlo simulations 1: evaluating π , and the physics of random walks.
    Science: introduction to a microscopic view of fluids and Monte Carlo techniques.
    Programming: histogramming, working with objects and class functions.
    Numerical methods: random number generators, parameter spaces, volume integrals.

  • Unit 9 and homework (class #11; homework due at the start of class #12)

    Monte Carlo simulations 2. An introduction to particle physics; a warm-up to simulating a particle physics experiment.
    Science: Monte Carlo simulation of geometrical acceptance and experimental resolution in a two-particle spectrometer.
    Programming: large codes, working with class functions and variables.
    Numerical methods: Gaussian random number generator.

  • Unit 10 and homework (class #12; homework due at the start of class #13)

    Markov Chain Monte Carlo in thermal physics.
    Science: Markov chain Monte Carlo as a tool for modeling finite-temperature systems.
    Programming: reading, writing binary files.
    Numerical methods: Same as it ever was..

  • Unit 11 and homework (class #13; homework due at the start of class #14)

    Statistics, fitting, precision, and uncertainty.
    Science: extracting physics from data.
    Programming: multitasking when working with long execution times.
    Numerical methods: binomial and Poisson distributions, chi-squared tests, pizza studies.

  • Final exam

    A work-it-solo coding assignment that you'll do in class during the final class of the term.

The owl of Athena