| Differences between revisions 4 and 5 | Back to page |
|
Size: 3235
Comment:
|
Size: 3261
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| == Why Programming? == |
Why Programming?
Plotting things up well on a computer is an absolute necessity in most scientists' and engineers' lives. These days, as the quantity of data increases dramatically in science, it is becoming increasingly more important to be able to plot things up competently and correctly, as opposed to being bogged down with technical problems.
In this course, we will practice this using programming homework problems.
This note describes how to use Matlab or Python, two of the popular environments in science, to plot things up.
This note is targeted to those students, who are not initiated in plotting things up on a computer. If you are already familiar with your own favorite plotting environment, then this note is not for you -- you should spend your time doing other worthwhile things. However, even in that case, some part of this note might be informative -- so you might want to run a quick glance.
Matlab
Matlab is the "official language" of our textbook, and it has a wide audience in engineering and science. On my computer, I have Matlab 7.12.0 R2011a, a trial version for teaching. If this software suits you, then you may want to get a student version of Matlab (here is one way). Or, you could consider using Octave, a GNU project that has a high Matlab compatibility. On my computer, I have Octave 3.2.4 for Windows installed, and I test Matlab codes with it.
Python
Python is a language that boasts power, readability, popularity, and flexibility. It also has a wide audience, and seems to be liked by engineers and scientists alike. In the legendary C language book by Kernighan and Ritchie, they brag that the C language wears well over time. I must say that my experience with python is somewhat the same in terms wearing well, although C and python occupy different planes.
A particularly nice python distribution for scientists and engineers is the enthought python distribution, which is a commercial package but is freely available for educational purposes. It is a giant package, with all kinds of scientific packages already included. In my opinion, using this package is a good way to go for a beginner. It does away a lot of hassles for installing various packages. On my computer I use enthought python distribution 7.0-2 for windows (32 bit) to test codes for this course.
One note: I will NOT use python 3 for this course. Python 3 is a big jump from python 2. I have not migrated my own softwares to python 3, nor do I plan to any time soon, since some popular python modules are still not ported to python 3. Likewise, the enthought edition is based on python 2.7, which will be our standard python version for this course.
With enthought python, pylab module or matplotlib module is already included. The matplotlib module provide a matlab like environment on top of python. I plan to use the pylab module frequently in presenting homework solutions.