Programming Projects

Programming Project #2: Due Friday, Dec, 12


Assignment: Choose a physical science problem that involves multiple interacting objects or stochastic processes or (with prior approval) some other topic that involves material discussed in PHYS 165. Write a computer program to calculate the behavior of the system and display the results effectively. Your program output should make it easy for the user to understand your problem and the significance of the result. You should clearly indicate at least one independent variable in the problem, document the effects of changing the values for that variable in the program and explain the significance of the result. .
During the last week of classes, you will describe and demonstrate your program in a 10-15 minute presentation for the class to share what you have learned.

Program Specifications:
The program should illustrate your ability to do the following:
a) define and use functions

b) use multi-dimensional lists and nested loops (for many-body problem)
OR
Calculate statistical averages and distributions (for stochastic problem)
c) create and use effective input/output screens, including graphics
d) design, use and document test cases to insure the correct functioning of your program
To do an interesting problem will probably require about 50-100 lines of code* (documentation statements don’t count as lines of code). The maximum length should not be more than 150 lines of code.

It would be desirable, though not mandatory, to define and use classes and associated methods (use at least one)

Programming Approach:
Use the 6 steps of software development :
1) Specify the problem requirements (and see me for topic approval)
2) Analyze the problem
3) Design the algorithm (and see me for approach approval)
4) Implement the algorithm
5) Test and Verify
6) Document thoroughly and CLEARLY!! The program should begin with a clear description of what the program is designed to do.

*If you modify an exisiting demo or course program, you should clearly indicate (with documentation statements) what part of the code is original (e.g. you wrote it) and what parts of the code came from other sources.

Some examples from 2001 are available here:

Stress-Strain

Velocity and Temperature

Heat Transfer

Programming Project #1: Due Friday, October 24
Topic approval, no later than Sept. 29
Approach approval no later than Oct. 8

Assignment: Choose a physical-science problem amenable to computer-based analysis, and write a program to solve that problem.

Program Specifications: The program should illustrate your ability to do the following:

a) create and use lists
b) use control statements effectively (for, while, if..else)
c) solve Newton's equations of motion numerically
d) create and use effective input/output screens, including graphics
e) design and use test cases to insure the correct functioning of your program
To do an interesting problem will probably require about 50 lines of code (documentation statements don’t count as lines of code). The maximum length should not be more than 100 lines of code.

Problem Choice: You should choose a problem where you can illustrate some effects that are not easy to generate analytically. Topics from Chapters 2 and 3 of Matter & Interaction might be a good choice. You can get some ideas from the problems in the book (or from other books on physical science). Examples of reasonable problems would be; projectile launch to orbit, orbital motion with three bodies, pendulum outside of harmonic approximation, simple harmonic motion with friction…. You must discuss your plan for your project with me, and get approval of the topic.

Programming Approach: Use the 6 steps of software development :

1) Specify the problem requirements (and see TLE for topic approval)
2) Analyze the problem
3) Design the algorithm (and see TLE for approach approval)
4) Implement the algorithm
5) Test and verify
6) Document thoroughly