Physics 21 Reading List #4
This week you have readings about the two Voyager missions, and about a few C++techniques (some of which you have already met) that you will need to complete the assignment.
1. Voyager
- Read Voyager's 25th anniversary coverage at the Planetary Society website, including an interview with Mission Design Manager Charley Kohlhase.
- Browse Voyager's mission description in the Planetary Data System.
- Have a look at a heliocentric view of the trajectories of the two Voyagers. Because in our assignment we make several simplifying assumptions, you won't be able to replicate these trajectories eactly.
2. C++
- Read about classes and how to create and use them in your favorite C++ book, or here for the basics. In this week's assignment you will be creating a class 'Planet' to hold information about each planet in the solar system. If you haven't programmed using classes before, you will probably want to ask your TA or me for help in the lab this week.
- Now that your programs are getting longer, it is very helpful to place different pieces of code into different files in order to keep track of them. For example, you could have files called Planet.hpp, Planet.cpp, Vector.hpp, NewtonRaphson.hpp, NewtonRaphson.cpp, etc. Each file could contain a piece of code that you can re-use for different purposes.
To compile all of these files into a single program, you can simply list all the .cpp (but not the .hpp) files on the command line of the g++ command, as in
Or you can use a Makefile to compile the program and automatically keep track of which pieces need to be recompiled. You can read about this here.
1. Voyager
- Read Voyager's 25th anniversary coverage at the Planetary Society website, including an interview with Mission Design Manager Charley Kohlhase.
- Browse Voyager's mission description in the Planetary Data System.
- Have a look at a heliocentric view of the trajectories of the two Voyagers. Because in our assignment we make several simplifying assumptions, you won't be able to replicate these trajectories eactly.
2. C++
- Read about classes and how to create and use them in your favorite C++ book, or here for the basics. In this week's assignment you will be creating a class 'Planet' to hold information about each planet in the solar system. If you haven't programmed using classes before, you will probably want to ask your TA or me for help in the lab this week.
- Now that your programs are getting longer, it is very helpful to place different pieces of code into different files in order to keep track of them. For example, you could have files called Planet.hpp, Planet.cpp, Vector.hpp, NewtonRaphson.hpp, NewtonRaphson.cpp, etc. Each file could contain a piece of code that you can re-use for different purposes.
To compile all of these files into a single program, you can simply list all the .cpp (but not the .hpp) files on the command line of the g++ command, as in
g++ -o MyProgram MyProgram.cpp Planet.cpp NewtonRaphson.cpp -lm
Or you can use a Makefile to compile the program and automatically keep track of which pieces need to be recompiled. You can read about this here.

0 Comments:
Post a Comment
<< Home