| Differences between revisions 15 and 16 | Back to page |
|
Size: 3944
Comment:
|
Size: 3954
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 23: | Line 23: |
| Do you not know python, but like to learn it? Excellent! The first thing to do is then to follow the time-honored and effective <<ln(http://docs.python.org/tutorial/, python tutorial)>>. That covers a lot of very useful basics. Then, you need to read up a little on numpy (arrays and stuff), or at least know where to find <<ln(http://docs.scipy.org/doc/numpy/reference/,the documentation for it)>>. Then, know where to find <<ln(http://matplotlib.sourceforge.net/,the information for matplotlib)>>. Last but not least, you can learn by examples (mine or look in the folder "Python27/Examples" in the enthought distribution). | Do you not know python, but like to learn it? Excellent! The first thing to do is then to follow the time-honored and effective <<ln(http://docs.python.org/tutorial/, python tutorial)>>. That covers a lot of very useful basics. Then, you need to read up a little on numpy (arrays and numerical stuff), or at least know where to find <<ln(http://docs.scipy.org/doc/numpy/reference/,the documentation for it)>>. Then, know where to find <<ln(http://matplotlib.sourceforge.net/,the information for matplotlib)>>. Last but not least, you can learn by examples (mine or look in the folder "Python27/Examples" in the enthought distribution). |
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.
For this reason, in this course, we will practice this using programming homework problems. I think you will feel good about learning one or two tricks during this course!
This note is a brief global overview of Matlab and Python, as relevant to our course. For each homework, some specific discussions of relevant example problems may be provided to "hold your hand." Whether you need such help or not, you may benefit by examining my examples provided.
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 that was given to me by Matlab, and I will use it to run codes for this course. 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 software that is highly compatible with Matlab, while it does lack many nice UI features. On my computer, I have Octave 3.2.4 for Windows installed, and I use it to run codes for this course.
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 run 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, the matplotlib module (or, almost synonymously, the pylab module) is already included. The matplotlib/pylab module provide a matlab like environment on top of python. I plan to use the pylab module frequently in presenting homework solutions.
Do you not know python, but like to learn it? Excellent! The first thing to do is then to follow the time-honored and effective python tutorial. That covers a lot of very useful basics. Then, you need to read up a little on numpy (arrays and numerical stuff), or at least know where to find the documentation for it. Then, know where to find the information for matplotlib. Last but not least, you can learn by examples (mine or look in the folder "Python27/Examples" in the enthought distribution).