Intro to Computational Physics (PHY 261)

Contact Information

Course Description

An introduction to the approximate numerical solution of physical problems with computers. The course focuses on problems from mechanics, electromagnetics, and quantum mechanics that are not analytically solvable. Topics include realistic projectile motion, planetary motion, and electromagnetic fields produced by charge and current distributions. 3 credits.

Learning Objectives

It is expected that students will

  1. describe Newton’s second law in the Haskell programming language
  2. interpret Haskell code and explain what it does
  3. apply the Euler method to solve differential equations
  4. calculate quantities of physical interest using the computer
  5. explain how Newton’s second law relates to the state of a mechanical system
  6. program a computer to solve physical problems using the Haskell programming language

IDEA Objectives

  1. Learning fundamental principles and theories, in particular deepening our understanding of Newton’s theory of mechanics and Maxwell’s electromagnetic theory by instructing the computer how to do calculations. The goal of the course is to deepen a student’s understanding of physics by introducing a new language (the Haskell programming language) in which to express the ways of calculating physical quantities (position, velocity, force, momentum, magnetic field, etc.). By using that new language to instruct the computer on what it needs to do to calculate something, we hope to gain a new perspective and a deeper understanding of some of the major ideas in physics, like Newton’s second law, Coulomb’s law, and the Biot-Savart law.
  2. Gaining factual knowledge and terminology, especially a facility in translating among ideas expressed in words, ideas expressed in mathematical symbols, and ideas expressed in a computer language
  3. Learning to apply course material to solve problems using a computer
  4. Developing the specific skill of programming a computer to solve physics problems

Philosophy

We’re not going to ask the computer to do anything that we don’t know how to do. The computer is not going to do magic for us. (One of the problems with packages such as Mathematica is that the computer seems to magically come up with the answer. This is not an empowering situation for us. We have lost control of the situation when we don’t have a basic idea of what the computer is doing for us.) We’re going to ask the computer to do the things that we know how to do (arithmetic, keeping lists, etc.) many more times than we would be willing to do them. The computer is willing to be repetitive in ways and quantities that we are not. This simple extra ingredient of repetitiveness will give us a surprising amount of power to calculate things that we are interested in, without sacrificing control and understanding of what the computer is doing.

While we will ask the computer to do only things that we know how to do, it may be the case that the way the computer does them is different from the way we do them (in some sense it’s obvious that this must be the case). It is not our main interest in this course to ask how the computer does its simple jobs. These are very interesting questions that more properly belong to the subjects of computer science and computer engineering.

Textbook

There is no official textbook for this course. I will give you notes to read.

Projects

This course will have a strong project focus. I hope that you will find the projects challenging, engaging, and fun. I encourage you to work together on the projects as far as talking about what techinques to use or the syntax of the programming language. However, each person is expected to write her or his own computer programs and produce his or her own solutions and reports independently. To this end, it is best not to share the code you’ve written with others who are still thinking about how to do it. For a person that’s still thinking about how to do something (and we’re all in this stage at some point), seeing the way that someone else solved the problem tends to shut down our brain toward other, possibly even better, ways of doing it. Much of the learning in this course takes place when you have an idea about how to do something, and you try it and see if it works.

In any case, programs written independently will typically look very different from each other. In the past, I once had a problem with a person taking another person’s work, changing the variable names and the spacing, and turning it in as their own. This is an act of academic dishonesty, and it’s pretty easy to detect. Be academically honest, and write your own code. Start your work early, and there will always be time to ask me questions when you get stuck.

Finally, it is absolutely delightful to write a piece of code yourself and find that it really works. You will minimize your delight if you ask for too much help from other people. You will maximize your delight if you do as much as you can yourself, and just ask for little hints when you get stuck.

A significant amount of out-of-class time will be required to finish the projects on schedule.

For each exercise or project that you turn in, include all of the things that are relevant to show me the work that you did. Usually, this will include a printed copy of the program, results, and examples of use of the program (such as results for different input values if the program accepts input). I may also ask you to put an electronic copy of your program in my dropbox (I will show you how to do this.)

Exams

There will be three 50-minute exams during the normal class time. These exams will test your knowledge of the Haskell programming language and the techniques we learn in the class. We will not use the computer for the exams. We may or may not allow a calculator, depending on the material to be tested. No computers, cell phones, music players, or any electronic devices with wireless or network capability are allowed during exams. We will have a comprehensive final exam at the end of the course.

Grading

Your overall grade will be determined by a weighted average as indicated in the table below.

Projects45%
Exams30%
Class participation10%
Final Exam15%

Your letter grade for the course is determined by the weighted average. The minimum weighted average (out of 100) required for each letter grade is indicated below.

A93
A-90
B+87
B83
B-80
C+77
C73
C-70
D+67
D63
D-60
F0

Your grade is not an indication of how much I like you. It is not an indication of your worth as a person. It is my judgement of your accomplishment in learning computational physics.

Lateness Policy

It is important for you to stay with the pace of the course, completing projects by their due dates. A significant amount of out-of-class time will be required to finish the projects on schedule. I encourage you to look ahead on the schedule and feel free to read ahead and work ahead on projects. My advice is to try to finish things 24 hours before they are due. This way, if you hit a roadblock, it is still possible to get help. Projects are due at the beginning of class on the due date. A penalty of 10% will be deducted for an assignment turned in late. For an assignment later than the beginning of the following class period, 30% will be deducted. For an assignment more than a week late, 50% will be deducted. No credit will be awarded for assignments more than two weeks late.

Office Hours

Please feel free to stop by my office any time to chat. I will make a special effort to be in my office during the office hours posted on my door (also listed on my web page). We can also make an appointment to get together if that is convenient for you.

Academic Honesty

Any student who submits plagiarized work will be subject to the penalties described in the Student Handbook and outlined in LVC’s “Academic Honesty Policy” (http://www.lvc.edu/catalog/acad-reg-procedures.aspx). This code asks each student to do his/her own work in his/her own words.

A student shall neither hinder nor unfairly assist the efforts of other students to complete their work. All individual work that a student produces and submits as a course assignment must be the student’s own. Cheating and plagiarism are acts of academic dishonesty.

Cheating is an act that deceives or defrauds. It includes, but is not limited to, looking at another’s exam or quiz, using unauthorized materials during an exam or quiz, colluding on assignments without the permission or knowledge of the instructor, and furnishing false information for the purpose of receiving special consideration, such as postponement of an exam, essay, quiz or deadline of an oral presentation.

Plagiarism is the act of submitting as one’s own the work (the words, ideas, images, or compositions) of another person or persons without accurate attribution. Plagiarism can manifest itself in various ways: it can arise from sloppy note-taking; it can emerge as the incomplete or incompetent citation of resources; it can take the form of the wholesale submission of other people’s work as one’s own, whether from an online, oral or printed source.

Students who take part in violations such as cheating or plagiarism are subject to a meeting with the Associate Dean of Academic Affairs, who has the authority to take further action, up to and including expulsion from the College.

Plagiarism Detection Service

In this course, I may submit some or all of your assignments for review by an on-line plagiarism service, such as MOSS (Measure Of Software Similarity). This service will compare the content of your work to the content of your classmates’ work. It is smart enough to realize when only variable names have been changed, or when statements have merely been reordered. Any work submitted to this service may become part of the service’s permanent collection of submitted work. After your work is submitted, the service will generate an originality report which will be sent to your instructor. Any student who submits plagiarized work will be subject to the penalties outlined in LVC’s Academic Honesty Policy found in the Student Handbook.

Disabilities Services Syllabus Statement

Any student who needs classroom or testing accommodations is invited to present letters from the Office of Disability Services and discuss concerns with me after class or during office hours. The Office of Disability Services is located in HUM 004. Students may schedule an appointment by calling 717-867-6028.

Civility, Respect, Community

LVC aims to be a community of inclusive excellence. We affirm the rights of all persons to a superior educational experience that is characterized by respect for and tolerance of others. This class is a place where our core values of inclusiveness, civility, and appreciation of difference are affirmed.

Class Schedule

DateTopicDue at start of class
01/12Ch 1: GHCi as a calculator
01/14Ch 1: Functions and operators
01/16Ch 2: Constants, functions, and typesChapter 1 activities and exercises
01/19MLK Jr. Day
01/21Ch 2: Anonymous functions
01/23Ch 3: Basic typesChapter 2 activities and exercises
01/26Ch 3: Function types
01/28Ch 4: ListsChapter 3 activities and exercises
01/30Ch 5: Functions with parametersChapter 4 activities and exercises
02/02Ch 5: Mapping over lists
02/04Ch 6: Quick PlottingChapter 5 activities and exercises
02/06Ch 7: Type classesChapter 6 activities and exercises
02/09Ch 7: Sections
02/11Ch 8: TuplesChapter 7 activities and exercises
02/13Exam 1 (Chapters 1–6)
02/16Ch 9: List Comprehensions
02/18Ch 10: Presentation plottingChapter 8 activities and exercises
02/20Ch 10: Plotting data
02/23Ch 11: Good coding practiceChapter 10 activities and exercises
02/25Ch 12: PicturesChapter 11 activities and exercises
02/27Ch 12: Animations
03/02Spring vacation
03/04Spring vacation
03/06Spring vacation
03/09Ch 13: Euler methodChapter 12 activities and exercises
03/11Ch 13: Euler method
03/13Exam 2 (Chapters 7–12)
03/16Ch 14: Mechanics in one dimension
03/18Ch 14: Euler methodChapter 13 activities and exercises
03/20Ch 14: Mechanics problems
03/23Ch 15: Air resistanceChapter 14 activities and exercises
03/25Ch 16: Euler-Cromer methodChapter 15 activities and exercises
03/27Ch 17: Mechanics in three dimensionsChapter 16 activities and exercises
03/30Ch 17: Vectors
04/01Ch 17: Mechanics problems
04/03Easter vacation
04/06Easter vacation
04/08Ch 18: Multiple objectsChapter 17 activities and exercises
04/10Ch 22: Numerical integrationChapter 18 activities and exercises
04/13Final projectChapter 22 activities and exercises
04/15Exam 3 (Chapters 13–18)
04/17Final project
04/20Final project
04/22Final project
04/24Final project
04/27Final project
04/29Final project