Acknowledgements: Substantial portions of these notes were written by Professor Keinert as Appendix A of his lecture notes for Math 473. I have made revisions and additions for our particular class section.
Printing this document: Use the print button of your web browser (assuming it has one).
You may use any computer of your choice for doing the programming assignments. The Computation Center (CC) provides free access to Project Vincent (PV), a network of DEC workstations, and also maintains several Macintosh and PC labs. I will refer to these three as the ``CC machines''. The Mathematics Department also maintains a Macintosh lab in 449 Carver. Any other machine that you have access to at work or at home is also acceptable.
I recommend that you do the programming assignments in matlab rather than Fortran or C, unless I tell you otherwise. Of the CC machines, only PV has matlab, as far as I know. Matlab is also available in the Mathematics Computer Lab. PV has the necessary subroutines to do the assignments in Fortran or C.
If you want help from me, I recommend that you use PV or the Math Computer Lab. If you want to use your own machine, or one of the other CC machines, you are on your own. You will need a copy of matlab, or a Fortran or C compiler with a library manager.
Public PV workstations are available in Durham Hall and elsewhere on campus. The Computation Center has a current list. Most of the public PV stations are restricted to the user sitting in front of it. However, you may dial into the following computers remotely, either from another machine on campus or through a phone line (see below for details). The first name belongs to a CC group of computers, and the other three are computers in the Math Department.
isum.iastate.edu pv343d.vincent.iastate.edu pv3448.vincent.iastate.edu pv3455.vincent.iastate.edu
You should use the first couple of weeks of the term to familiarize yourself with the computer you are going to use. Here is a brief outline of the things you need to learn. If you are familiar with your system of choice already, you may be able to skip some of the steps. I will provide the details for PV only. The Computation Center offers introductory courses to PV for free. You even get free course notes with that. I recommend this highly for new users. A hypertext introduction to PV is available online. You need to type
% add abc % lesson vincentManuals and other help for CC machines are available in the following places:
Now here are the things you should do or familiarize yourself with:
PV is intended to be run as a window system from a workstation, but most commands also work on a text-only terminal. All the commands you only want executed when you are in window mode go in a file .startup.x11. If you use the save state feature when you log out you probably don't need this file. All the commands you want executed in both text and window mode go into into a file called .startup.tty. For this class, .startup.tty should contain at least the following lines:
add mathclasses add matlab setenv MATLABPATH /home/mathclasses/matlab/473The first time you log in, you can type those in by hand, or type source .startup.tty after creating the file.
Three words of caution:
To print Postscript files in the Math Computer Lab: Open up the Applications:Utilities folder and DRAG your Postscript file onto the application SendPS. Do not double click on the Postscript file, as this will allow you to view the file rather than print it.
There are a number of other editors around. I don't know much about most of them. Some of them are
Whatever you do, be sure you are using a text editor and not a word processor. A text editor creates plain files (``ASCII files'') with only text in them, the kind that compilers like to see. A word processor is a program which lets you use underline, boldface, etc. It puts internal codes in the file that compilers don't like. Most word processors have a way to read and write plain text files, but you have to ask for special treatment for the file every time you do something. This tends to get on your nerves (on mine, at least).
setenv MATLABPATH /home/mathclasses/matlab/473so that matlab knows where to find the files I will provide for you.
You should print out the Matlab Primer (you will need a Postscript printer to do this). On PV, the Primer is in the file /home/mathwww/docs/matlab/matlab_primer.ps. The Primer, together with the built-in help function in matlab, should be all you need to learn enough matlab for this course. If necessary, you can use the manuals in Durham for specific questions. You may also want to read the following additional documents:
To use Fortran, take a simple test program, like the old ``hello, world'' program:
program hello print*,'hello, world' endPut this in a file called hello.f. The standard Fortran compiler on PV is called f77, but you might as well get used to the batch file f473 we use for this course. Using f473 instead of f77 will make sure that your program can find the subroutines it needs. It also turns on some forms of error checking, and it will force you to explicitly declare all variables. You may not like that, but it is good for you. Trust me. You compile and run the program with the commands
% f473 hello % helloIf you keep main program and subroutines in different files, you can still compile them together with f473. Just make sure that the main program is the first file you list.
If you are using matlab, use the built-in plot function to display a plot on the screen. You can print the plot with the print command. If that doesn't work for some reason, you can save the plot in a file with the meta command, convert it to PostScript (at the operating system level) with the gpp command, and print it with lpr.
If you are using Fortran or anything else, you can use one of the two programs ploty and plotxy that Professor Keinert wrote. They do the following steps:
For example, suppose your file prog1.out looks like this:
Results of Program 1 x true values numerical values error -------------------------------------------------------- 0.0 1.000 1.000 0.0 0.1 1.100 1.080 0.02 ...To plot it, find yourself a PV station and log in. If you are logged in remotely, you can still produce a plot to be printed, but you can't look at it on the screen.
% plotxy prog1.out found 3 curves with 20 points each %After a short while, a black rectangle will show up on your screen. Click on it with the mouse, and a plot with three curves will appear: the $x$ axis has units 0.0, 0.1 and so on, the $y$ values come from the other columns. Click again, and the plot will disappear. The program uses different colors for different curves: black for the axes, red for the first curve, green for the second, then blue, purple, gray, and then it starts over again with red.
Since your input file was prog1.out, there will now be a file prog1.out.ps which contains the plot in PostScript form, ready for printing.
There is an intermediate file called gmeta which can be erased afterwards. Look at the manual page for ploty and plotxy for more detail. Basically, these programs were written so that you can take the printed output from your program and plot it, without having to do a lot of reformatting.
If you are dialing in directly through a modem (not using PPP), you need to do the following: call the campus modem pool (294-ENET). To get to pv343d, the connection would work as follows (minor details of this procedure change from time to time):
(you call in, hit return a few times) DIAL: ethernet (or enet) RINGING ANSWERED ( I find it useful to wait a few seconds at this point; the system tends to hang forever if I don't ) ( hit return again) *** Welcome to ISU Telecommunications Terminal Server *** 1. Connect to Telnet host 2. Connect to LAT host 3. Vincent1 4. Vincent2 5. Class1 10. Logout Enter number of selection> 1 Connect to Telnet host... ( type in the full name of the machine, like pv343d.iastate.edu) Xyplex -010- Session 1 to PV343D.IASTATE.EDU established Project Vincent / ULTRIX V4.2 (pv343d.iastate.edu) login:
To get access to /home/mathclasses on PV for ftp, first issue the command quote SMNT mathclasses from inside ftp (SMNT must be in upper case, followed by exactly one space). This should work from most machines. You can then get or put the files you need.
A special PV machine called pvio.vincent.iastate.edu in Durham 139 has every device commonly used on workstations attached to it, including a floppy drive. This floppy drive normally uses a Unix file system, not an MS-DOS or Mac file system. However, there is a bunch of public domain programs called mtools for reading/writing MS-DOS floppies. Type add mtools, and then man mtools for help.
If you are logged in through a modem, you can transfer files through your terminal emulator (Kermit,ProComm, Zmodem, or whatever). Ask the debug room (294-1314) for details. This is likely to be quite slow, and is only recommended for small files.