P410 Computing Applications in Physics
P609 Computational Physics
Department of Physics, Indiana University
Fall, 2014


go to lecture notes    go to homework assignments


Taught by: Steven Gottlieb
Meets: Tuesday and Thursday, 2:30 p.m. to 3:45 p.m. in Swain West 246A

Note that this is a cluster of Apple computers in the physics building near the Physics Forum commonly known as the Astronomy/Physics cluster. Please check to see whether you can log in before coming to class.


Computer Help

For help with the issues specific to the Astronomy/Physics Cluster in which we meet, send email to support@physics.indiana.edu. This would include issues like you cannot log in, or other problems that only a system administrator can solve.

For help with general computer issues, the Indiana University Knowedge Base is very useful.

Knowledge Base
Knowledge Base search help

Syllabus

These courses (P410/P609) in computer applications may be taken by undergraduates or graduate students. Click to examine the syllabus for the course.


About the Textbook

The textbook An Introduction to Computer Simulation Methods--- Applications to Physical Systems by Harvey Gould, Jan Tobochnik and Wolfgang Christian is now in its third edition. There is a web page for the text that you might want to visit. This edition of the text stresses object oriented programming. The previous examples in the book were in True Basic. They have now switched to Java. I don't plan to make much use of Java in our class, but students are welcome to do so. My examples will concentrate on C.


Student Academic Support Center


Material Relating to Lectures Will Appear Here

Notes for Lecture 1 - Introduction (August 26).

Notes for Lecture 2 - Axis window, UNIX Basics, Hierarchical File System, Special Characters, Redirection (August 28).

Supplementary Notes for Lectures 2,3 - On-line Help and Unix Tutorials.

Here are some on-line tutorials for AWK:
   An AWK Primer
   Awk - A Tutorial and Introduction - by Bruce Barnett

Some information on choosing a shell:
   UNIX shell differences and how to change your shell
   Top Ten Reasons not to use the C shell

Notes for Lecture 3 - Remote access, Completion of Redirection, aliases, AWK, axis, Introduction to Euler Method (September 2).

    Notes on Remote Access to Cluster and Files.
    Axis Documentation (PDF).

Notes for Lecture 4 - Error Analysis for the Euler Method, Shell Scripts (September 4).

Notes for Lecture 5 - Error Analysis for the Euler Method (II), Introduction to Newton's 2nd Law (September 9).

    A pdf file with discussion of the error analysis of Euler method (PDF).

Notes for Lecture 6 - More shell scripts; Energy (non)conservation, Euler vs. Euler-Cromer (September 11).

Notes for Lecture 7 - Multiple Plots; Fun with Pointers, A Body Falling in a Position Dependent Potential (September 16).

Notes for Lecture 8 - Shell Scripting, Scripts to automate our plotting, Error of the Euler-Richardson Algorithm, Extrapolation to zero height, Adaptive Step Size Code (September 18).

Notes for Lecture 9 - Adaptive step size algorithm, Graphing the velocity ratio, Root finding (September 23).

Notes for Lecture 10 - Details of secant and false position methods, adapt.c, Oscillatory Motion, Non-conservation of Energy in the Euler Algorithm, Sources of Numerical Analysis Code, Final Project (September 25).

Notes for Lecture Class 11 - Graphing options, Higher Order Algorithms, Introduction to Mathematica (September 30).

   Hands-on Start to Mathematica
   How-to Mathematica tutorials
   Join /the Mathematica Community

Notes for Lecture Class 12 - Introduction to Mathematica (continued) (October 2).

Notes for Lecture Class 13 - Biased Estimators (continued), Bias Reduction and the Jackknife Method, Hist, Blockerr (October 9).

Notes for Lecture Class 14 - Jackknife Error, Introduction to Chaos and Logistic Map (October 14).

go to top of page go to homework assignments
Notes from Fall 2013 Lectures

Notes for Lecture 1 - Introduction (August 27).

Notes for Lecture 2 - Axis window, UNIX Basics, Hierarchical File System, Special Characters, Redirection, Remote Access, (August 29).

Supplementary Notes for Lectures 2,3 - On-line Help and Unix Tutorials.

Here are some on-line tutorials for AWK:
   An AWK Primer
   Awk - A Tutorial and Introduction - by Bruce Barnett

Some information on choosing a shell:
   UNIX shell differences and how to change your shell
   Top Ten Reasons not to use the C shell

Notes for Lecture 3 - Completion of Redirection, aliases, AWK, axis, Introduction to Euler Method (September 3).

Axis Documentation (PDF).

Notes for Lecture 4 - Error Analysis for the Euler Method, Shell Scripts (September 5).

Notes for Lecture 5 - Error Analysis for the Euler Method (II), Introduction to Newton's 2nd Law (September 10).

Notes for Lecture 6 - More shell scripts; Energy (non)conservation, Euler vs. Euler-Cromer (September 12).

Notes for Lecture 7 - Multiple Plots; A Body Falling in a Position Dependent Potential; Scripts to automate our plotting (September 18).

Notes for Lecture 8 - Error of the Euler-Richardson Algorithm, Extrapolation to zero height, Graphing the velocity ratio (September 19).

Notes for Lecture 9 - Root Finding, Oscillatory Motion (September 24).

Notes for Lecture 10 - Oscillatory Motion, Non-Conservation of Energy in the Euler Algorithm, Sources of Numerical Analysis Code, Final Project (September 26).

Notes for Lecture 11 - Higher Order Algorithms, Introduction to Mathematica (October 1).

   Hands-on Start to Mathematica
   How-to Mathematica tutorials
   Join the Mathematica Community

Notes for Lecture 12 - Introduction to Mathematica, Random Walks and Biased Estimators (October 3).

Notes for Lecture 13 - Biased Estimators (continued), Bias Reduction and the Jackknife Method, Hist, Blockerr (October 8).

Notes for Lecture 14 - Jackknife Error, Jackknife Method Via Mathematica, Introduction to Chaos and Logistic Map (October 10).

Notes for Lecture 15 - Chaos and Logistic Map, Finding Bifurcation Points (October 15).

Notes for Lecture 16 - AHO, Finding Superstable Trajectories (October 22).

    Why you might not want to use Numerical Recipies

Notes for Lecture 17 - Instability and Chaos Lyapunov Exponent, Numerical Integration in One Dimension (October 24).

Notes for Lecture 18 - Numerical Integration in One Dimension, Error Estimation, Simpson's Rule Rederived, Examples (October 29).

Notes for Lecture 19 - Numerical Integration Examples, Higher Dimensional Integrals, Testing Hit or Miss Method, Aver (October 30).

Notes for Lecture 20 - Sample Mean Method, Inverse Transform Method, Box-Muller Method (October 31).

Notes for Lecture 21 - Correlations, Metropolis Method, Autocorrelations (November 5).

Notes for Lecture 22 - Metropolis Method, Autocorrelations, Shell Scripts for Metropolis Method, Pseudorandom Number Generators (November 7).

Notes for Lecture 23 - Serial Correlation Tests, Autocorrelations of PRNG (November 12).

Notes for Lecture 24 - Feedback Shift Register Random Number Generator, SPRNG, Fitting Data (November 14).

    Monte Carlo simulations: Hidden errors from "good" random number generators

Notes for Lecture 25 - Chi-square Distribution (November 19).

go to top of page go to homework assignments
Notes from Spring 2013 Lectures

Notes for Lecture 1 - Introduction (January 7).

Notes for Lecture 2 - Remote Access, UNIX Basics, Hierarchical File System, Special Characters, Redirection, (January 9).

Supplementary Notes for Lectures 2,3 - On-line Help and Unix Tutorials.

Here are some on-line tutorials for AWK:
   An AWK Primer
   Awk - A Tutorial and Introduction - by Bruce Barnett

Some information on choosing a shell:
   UNIX shell differences and how to change your shell
   Top Ten Reasons not to use the C shell

Notes for Lecture 3 - Completion of Redirection, aliases, AWK, axis, Introduction to Euler Method (January 14).

Axis Documentation (PDF).

Notes for Lecture 4 - Error Analysis for the Euler Method, Shell Scripts (January 16).

Notes for Lecture 5 - Error Analysis for the Euler Method (II), Introduction to Newton's 2nd Law (January 23).

Notes for Lecture 6 - Energy (non)conservation, Euler vs. Euler-Cromer; More shell scripts; Motivation for Euler-Richardson Algorithm (January 28).

Notes for Lecture 7 - Multiple Plots; A Body Falling in a Position Dependent Potential; Scripts to automate out plotting (January 30).

Notes for Lecture 8 - Error of the Euler-Richardson Algorithm, Extrapolation to zero height, Graphing the velocity ratio (February 4).

Notes for Lecture 9 - Root Finding, Oscillatory Motion (February 6).

Notes for Lecture 10 - Oscillatory Motion, Conservation of Energy in the Euler Algorithm, Sources of Numerical Analysis Code, Final Project (February 11).

Notes for Lecture 11 - Higher Order Algorithms, Introduction to Mathematica (February 18).

Notes for Lecture 12 - Introduction to Mathematica, Random Walks and Biased Estimators (February 20).

Notes for Lecture 13 - Statistical Analysis with Mathematica, Biased Estimators (continued), Bias Reduction and the Jackknife Method (February 22).

Notes for Lecture 14 - Application of the Jackknife Method, Hist, Blockerr (February 25).

Notes for Lecture 15 - Jackknife Error, Jackknife Method Via Mathematica, Introduction to Chaos and Logistic Map (February 27).

Notes for Lecture 16 - Chaos and Logistic Map (March 1).

Notes for Lecture 17 - AHO, Finding Bifurcation Points and Superstable Trajectories, Instability and Chaos (March 4).

    Why you might not want to use Numerical Recipies

Notes for Lecture 18 - Lyapunov Exponent, Numerical Integration in One Dimension (March 6).

Notes for Lecture 19 - Simpson's Rule Rederived, Hit or Miss Method, Sample Mean Method (March 18).

Notes for Lecture 20 - Higher Dimensional Integrals, Testing Hit or Miss Method, Aver (March 20).

Notes for Lecture 21 - Sample Mean Method, Inverse Transform Method, Box-Muller Method (March 25).

Notes for Lecture 22 - Correlations, Metropolis Method, Autocorrelations (March 27).

Notes for Lecture 23 - Shell Scripts for Metropolis Method, Pseudorandom Numbers Generators, Serial Correlation Tests (April 1).

Notes for Lecture 24 - Serial Correlation Tests, Autocorrelations of PRNG, Feedback Shift Register Random Number Generator, SPRNG (April 3).

Notes for Lecture 25 - Fitting Data, Chi-squared Distribution (April 8).

Notes for Lecture 26 - Fitting Data, Chi-squared Distribution, Confidence Levels, Polyfit (April 10).

Notes for Lecture 27 - Verification of Error Estimates, Non-linear Data Fitting (April 15).

Notes for Lecture 28 - Non-linear Data Fitting, Introduction to Parallel Computing (April 17).

go to top of page    go to homework assignments


Notes from 2012 Lectures

Notes for Lecture 1 - Introduction (January 10).

Notes for Lecture 2 - Remote Access, UNIX Basics, Hierarchical File System, Special Characters, Redirection, (January 12).

Supplementary Notes for Lectures 2,3 - On-line Help and Unix Tutorials.

Here are some on-line tutorials for AWK:
   An AWK Primer
   Awk - A Tutorial and Introduction - by Bruce Barnett

Some information on choosing a shell:
   UNIX shell differences and how to change your shell
   Top Ten Reasons not to use the C shell

Notes for Lecture 3 - Completion of Redirection, aliases, AWK, axis, Introduction to Euler Method (January 17).

Axis Documentation (PDF).

Notes for Lecture 4 - Error Analysis for the Euler Method, Shell Scripts (January 19).

Notes for Lecture 5 - Error Analysis for the Euler Method (II), Introduction to Chapter 3, Energy (non)conservation (January 24).

Notes for Lecture 6 - Euler vs Euler-Cromer; More shell scripts; Euler-Richardson Algorithm; Multiple Graphs; Body Falling in Position Dependent Potential (January 26).

Notes for Lecture 7 - Body Falling in Position Dependent Potential (continued) (January 31).

Notes for Lecture 8 - Error of the Euler-Richardson Algorithm, Extrapolation to zero height, Root finding (February 2).

Notes for Lecture 9 - Graphing the velocity ratio, Details of root finding, Finding the initial height, Oscillatory Motion (February 7).

Notes for Lecture 10 - Oscillatory Motion, Conservation of Energy in the Euler Algorithm, Sources of Numerical Analysis Code, Higher Order Algorithms (February 9).

Notes for Lecture 11 - Final Project, Higher Order Algorithms, Introduction to Mathematica (February 14).

Notes for Lecture 12 - Random Walks and Biased Estimators Using Mathematica (February 16).

Notes for Lecture 13 - Review of Biased Estimators, Application of the Jackknife Method (February 21).

Notes for Lecture 14 - Histograms, Jackknife Error, Jackknife Method Via Mathematica, Introduction to Chaos and Logistic Map (February 23).

Notes for Lecture 15 - Chaos and Logistic Map (February 28).

Notes for Lecture 16 - Finding Bifurcation Points and Superstable Trajectories (March 1).

    Why you might not want to use Numerical Recipies

Notes for Lecture 17 - Finding Superstable Trajectories with GSL, Instability and Chaos, Lyapunov Exponents (March 6).

Notes for Lecture 18 - Numerical Integration in One Dimension (March 8).

Notes for Lecture 19 - Simpson's Rule Rederived, Hit or Miss Method, Sample Mean Method (March 20).

Notes for Lecture 20 - Testing the Hit or Miss Method, Aver, Testing Trapeziod, Simpson and Romberg Methods (part 1) (March 22).

Notes for Lecture 21 - AHO, NDSolve, Testing Trapeziod, Simpson and Romberg Methods (part 2) (March 27).

Notes for Lecture 22 - Inverse Tranform Method, Box-Muller Method (March 29).

Notes for Lecture 23 - Metropolis Algorithm, Autocorrelations (April 3).

Notes for Lecture 24 - Pseudorandom Numbers Generators, Serial Correlation Tests (April 5).

Notes for Lecture 25 - Autocorrelations of PRNG, Feedback Shift Register Random Number Generator, SPRNG (April 10).

Notes for Lecture 26 - SPRNG, Fitting Data, Chi-squared Distribution (April 12).

Notes for Lecture 27 - Homework Revisited, Chi-squared Distribution (April 17).

Notes for Lecture 28 - More on Chi-squared Distribution (April 19).

go to top of page    go to homework assignments



Homework Assignments Will Appear Below

The first homework is due on Thursday, September 11. It involves awk and axis, if you wish to produce your graph using axis. You are welcome to use a different program as long as you can make the plots as requested.
PDF

Homework Assignment 2 (Due Tuesday, September 23, 2014) .

Homework Assignment 3 (Due Thursday, October 9, 2014) .

Homework Assignment 4 (Due Thursday, October 30, 2014) .

go to top of page    go to lecture notes


Homework Assignments From Fall 2013
The first homework is due on Thursday, September 12. It involves awk and axis, if you wish to produce your graph using axis. You are welcome to use a different program as long as you can make the plots as requested.
PDF

Homework Assignment 2 (Due Tuesday, October 1, 2013) .

Homework Assignment 3 (Due Tuesday, October 15, 2013) .

Homework Assignment 4 (Due Tuesday, October 29, 2013) .

Homework Assignment 5 (Due Tuesday, November 14, 2013) .

Homework Assignment 6 (Due Thursday, December 5, 2013) .


Homework Assignments From Spring 2013
The first exercise is due on Wednesday, January 23. It involves awk and axis, if you wish to produce your graph that way. You are welcome to use a different program as long as you can make the plots as requested.
PDF

Homework Assignment 1 (Due Wednesday, February 6, 2013) .

Homework Assignment 2 (Due Wednesday, February 20, 2013) .

Homework Assignment 3 (Due Wednesday, February 27, 2013) .

Homework Assignment 4 (Due Wednesday, April 3, 2013) .

Homework Assignment 5 (Due Wednesday, April 17, 2013) .

go to top of page    go to lecture notes


Homework Assignments From 2012
The first exercise is due on Thursday, January 19. It involves awk and axis which we will discuss on Tuesday.
PDF

Homework Assignment 1 (Due Tuesday, February 7, 2012) .

Homework Assignment 2 (Due Tuesday, February 21, 2012) .

Homework Assignment 3 (Due Tuesday, March 20, 2012) .

Homework Assignment 4 (Due Thursday, April 5, 2012) .

Homework Assignment 5 (Due Thursday, April 19, 2012) .

go to top of page    go to lecture notes