PHYSICS 202: Physics on the Computer - Spring 2014

Instructor: Jennifer Klay Sections: PHYS 202-02,03
Email: jklay@calpoly.edu Time: TR 12:10-14:00, 14:10-16:00
Phone: 756-1250 Location: 180-272 (Baker Center)
Office: 180-620 Office hours: W 10:10-11:00, 14:10-15:00 (in 180-272)

Note: Handouts and announcements will be posted on Polylearn

Catalog Description

Introduction to using computers for solving problems in physics: differential equations, matrix manipulations, simulations and numerical techniques, nonlinear dynamics.

Course Objectives

Upon completion of the course you should be able to:

  • Use basic coding concepts such as loops, control statements, variable types, arrays, array operations, and boolean logic. (LO1)

  • Write, run and debug programs in a high level language. (LO2)

  • Carry out basic operations (e.g. cd, ls, dir, mkdir, ssh) at the command line. (LO3)

  • Maintain a version controlled repository of your files and programs. (LO4)

  • Create publication/presentation quality graphics, equations. (LO5)

  • Visualize symbolic analytic expressions - plot functions and evaluate their behavior for varying parameters. (LO6)

  • Use numerical algorithms (e.g. ODE solvers, FFT, Monte Carlo) and be able to identify their limitations. (LO7)

  • Code numerical algorithms from scratch and compare with existing implementations. (LO8)

  • Read from and write to local or remote files. (LO9)

  • Analyze data using curve fitting and optimization. (LO10)

  • Create appropriate visualizations of data, e.g. multidimensional plots, animations, etc. (LO11)

Text and Materials

  • IPython - an interactive computing environment for the Python programming language

  • Git and github - version control system and public web-based repository for your work. This is how you will turn in your assignments

  • Codecademy - a free online series of interactive programming courses

  • Project Euler - a series of challenging mathematical/computer programming problems that will help you practice your new computing skills

Selected References

Class time and assignments

We will be spending our class time learning to code and solve physics problems numerically by doing hands-on activities at the computer. Sometimes you will participate in pair programming exercises where you are the driver and your partner is the navigator and vice versa. Studies show that this is a very effective way to learn programming. You can expect assignments that build on the skills we develop in class, so make sure to attend every class!

As with any skill, the only way to become proficient is to practice. A LOT. Think about your experiences learning a musical instrument or playing a sport. A little bit of practice every day is crucial. You will probably be spending 8 to 12 hours per week outside of class writing and debugging code. There will be coding exercises from Project Euler as well as assignments related to the various types of physics problems that we discuss in class. If you have trouble with the homework, come to my office hours or seek help from your peers. Don't wait until you are in trouble to take action.

Grading

Your final grade in the course will be based on the following:

Project Euler Exercises: 10%
Assignments: 30%
Midterm Exam: 20%
Project: 30%
Project Demo: 10%

This class is about building skills. The only way to build your skills is to practice them. Therefore, in order to receive a passing grade (C- or better) in this class you must pass/complete a minimum of 50% of the material in each grading category. How well you do in each of the categories will be used to determine your final letter grade. Do not ignore any of the exercises or assignments.

Project Euler Exercises

Each week you will solve a problem from Project Euler. You will check your solution notebook into your PHYS 202 github repository directory for the given week. The file should be named

ProjectEuler<NUM>.ipynb

where <NUM> is the exercise number from the Project Euler site. The notebook should have a Heading cell with the title of the week's problem and a markdown cell with the problem description. Your solution should verify the test case that is usually provided and produce an answer to the question posed in the problem statement.

Exercise solutions are due by 11:59pm on Sundays. Late submissions will not be graded.

Many people have posted their solutions to Project Euler problems on the web. Do not give in to the temptation to view or copy these. Code plagiarism software can detect copied code. Refer to the academic honesty guidelines below for more information.

Assignments

Assignments will be distributed each week on PolyLearn based on the material covered in class that week. These will be handed in by checking your code into your PHYS 202 github repository by 11:59pm on the following Wednesday, to give you time to ask questions at office hours after you have worked on the assignment yourself. Instructions for naming your files will be included in the assignment handouts.

Midterm Exam

There will be one in-class midterm exam on Tuesday, April 29. It will cover programming basics and simple problem solving. There will be "open computer" extensions of previous exercises and assignments. You need to have your own working programs that can be modified/extended to answer the exam questions. As long as you keep up with the material in the first few weeks you should be able to pass it with no problems.

Project

During week 5, you will be assigned an open-ended programming project provided by me. You will have until 11:59pm Friday of the tenth week of instruction to complete your project and submit the code to your PHYS 202 github repository. We will spend some class time working on the projects but most of the work will be completed outside of class. Part of the project will be collaborative with other students assigned the same project, but you will be responsible for completing the coding, documentation and analysis assigned to you. Detailed instructions for completing the projects will be included in the project descriptions.

Grading Rubric

All code, assignments and exam questions will be graded on the following five-point scale:

Points Description
5 Goes above and beyond. Extra neat, concise, well-commented code, and explores concepts in depth.
4 Complete and correct. Includes an analysis of the problem, the program, verification of at least one test case, and answers to questions, including plots.
3 Contains a few minor errors.
2 Only partially complete or has major errors.
1 Far from complete.
0 No attempt.

Project Grading

The grading for the projects will be based on the following categories. You will receive a number between 0 and 5 for each category, following the same rubric as for other graded course elements (see above).

Category Description
Design Project is well-organized, easy to follow and clearly states the problem being solved.
Documentation Instructions for how to run the code are included. Variable and function names are descriptive. Code includes comments that aid the reader in following the algorithm. Algorithms/functions include test cases that clearly show they successfully accomplish their stated goals.
Completeness All of the major elements of the project have been included.
Correctness The logic of the code is correct and it produces meaningful results.
Analysis All of the analysis questions in the project description have been answered/addressed. Interpretation of the results is included.

Final Demo

During the final exam period you will present a 5-7 minute demonstration of your project and its results to the rest of the class. The demonstration will be graded by me and your peers using an oral presentation rubric. These assessments will be used to assign your grade on the demonstration.

  • Section 02: Tuesday, June 10, 13:10-16:00

  • Section 03: Tuesday, June 10, 16:10-19:00

Guidelines for Academic Honesty

(adapted from Grand Valley State University and George Washington University computer science departments)

You are expected to...

  • create / develop your own assignments (including source code)

  • understand your solutions

  • acknowledge the help of others in writing

  • cite its source on assignments for which inclusion of code other than your own has been explicitly permitted

  • protect yourself from being suspected of misconduct by not allowing others to see your assignment before it is submitted

  • contact your instructor for clarification about assignment requirements

You are encouraged to...

  • discuss general approaches to a solution

  • share knowledge with other students about syntax errors, coding tricks, or other language-specific information that makes programming easier

  • provide and receive help with simple execution errors

  • provide and receive help with using the computing environment

  • engage, with other students, in a general discussion of the nature of an assignment, the requirements for an assignment, or general implementation strategies

  • engage, with other students, in discussion of course concepts or programming strategies in preparation for an assignment or examination

You are guilty of academic misconduct if you...

  • give your source code to anyone in hardcopy or electronic form

  • receive another student's solution in hardcopy or electronic form

  • submit as your own work the files, solutions, or documents prepared by others

  • submit assignments as your own without attribution if they were created in collaboration with someone

  • make modifications to someone else's solution in an effort to disguise misconduct

  • use unauthorized materials during an examination, or communicate during an examination in an unauthorized way with another person

  • knowingly permit another person to turn in your work as his or her own work


You will be contacted by me if I suspect academic misconduct. Appropriate actions might include but are not limited to a failing grade on the assignment, a grade reduction in the course, or a failing grade in the course. See the Office of Student Rights and Responsibilities website for further information.

To help you remember to follow these guidelines, we will create a pledge file (called pledge.txt) with the following text that will reside in the main directory of your PHYS 202 github repository. It is your signed contract stating that you have read and understand the rules regarding academic honesty and agree to abide by them.


Academic Honesty Pledge

Cal Poly PHYS 202 - Spring 2014

I have read and understand the rules regarding academic honesty and I agree to abide by them.

I pledge on my honor that I have not given or received any unauthorized assistance on assignments or examinations in this course.

Signed: <YOUR NAME HERE>

Dated: <DATE HERE>


Miscellaneous

  • In general, there will be no make-up exams. However, in certain circumstances (illness, schedule conflict, etc.), special arrangements may be possible if you come see me about it.

  • I encourage you to work with other students (form groups?); however, you must do and turn in your own work. Review the guidelines for academic honesty for guidance on appropriate collaboration.

  • Check the appropriate university documents for details and deadlines concerning academic honesty, adding, dropping, grading, withdrawal, incomplete, etc.

  • Unforeseen circumstances may necessitate changes in this information. Changes will be announced in class and posted on PolyLearn.

The story of my life with computers and what I will probably do with you when you ask me complicated questions in office hours:

If you don't already know about xkcd, check it out. One of my favorite places on the web.


All content is under a modified MIT License, and can be freely used and adapted. See the full license text here.