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


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.


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


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.)


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.


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

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.


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” ( 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 online 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

Individuals with disabilities are guaranteed certain protections and rights of equal access to programs and activities under Section 504 of the Rehabilitation Act of 1973 and the Americans with Disabilities Act Amendments Act (ADAAA) of 2008. Therefore, Lebanon Valley College recognizes the responsibility of the college community to provide equal educational access for otherwise qualified students with disabilities.

Any student who needs classroom or testing accommodations is invited to present letters from the Center for Disability Resources and discuss accommodations with me after class or during office hours. The Center for Disability Resources is located in the Lebegern Learning Commons—Mund Suite 002. Students may schedule an appointment by calling 717-867-6028.

If a student believes that appropriate accommodations are being denied, the student may file a grievance. Procedures for filing grievances may be found at

Inclusive Excellence

LVC is a community of inclusive excellence. We affirm the rights of all persons to a superior educational experience that is characterized by respect for others. As such, this class and all classes at LVC, are places where our core values of inclusiveness, civility and appreciation of difference are affirmed.

Title IX

Lebanon Valley College prohibits discrimination on the basis of race, color, national origin, ancestry, religion/creed, sex, pregnancy, sexual orientation, gender identity or expression, age, disability, genetic information, marital/familial status, or veteran status in all programs and activities, as required by Title IX of the Educational Amendments of 1972, the Americans with Disabilities Act of 1990, Section 504 of the Rehabilitation Act of 1973, Title VII of the Civil Rights Act of 1964, and other applicable statutes and/or College policies.

Title IX makes it clear that violence, harassment, and any type of sexual misconduct based on sex and gender are civil rights violations. If you or someone you know has experienced violence, discrimination, or harassment, support is available through Counseling Services, Health Service, the Chaplain’s office, the Victim Advocacy Program, and Title IX deputies. Please refer to the Student Handbook for specific contact information.

Student Success Intervention Team

At Lebanon Valley College, we want you to succeed in and out of the classroom. Administrators and faculty work together to ensure not only academic success but a highly productive and positive four-year experience. Students who are not performing to their potential can be referred to the Student Success Intervention Team (Early Alert Committee), which is a group of individuals from Student Affairs, Academic Affairs, and Enrollment Management. This group will guide you through any difficult situation, whether academic or personal. You should, consider it your assignment to follow through and accept assistance from the appropriate source(s). Don’t be afraid or hesitant to seek help from these individuals: supporting you is their job! Be proactive and take control of your success.

Class Schedule

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