$Date: 2009/01/03 18:31:09 $ $Id: lab01bcomments.txt,v 1.3 2009/01/03 18:31:09 mike Exp $ General info: * M. M. Sussman - sussmanm@math.pitt.edu - Office Hours: 3-4PM MW, Thack 605 - Was Bechtel Bettis Inc. - Feel free to email me at any time or to stop in any time my office door is open Course objective: * Reinforce lectures * Learn enough Matlab programming to use Matlab. - Matlab provides much more than will be covered in the labs. - Mostly, problems can be done using Octave. Remarks about Linux/Unix * kate, nedit: good, general purpose editors - can use any: vi(m), emacs, etc. * Be careful to save your files in your AFS directory or they will disappear when you log off. * You can use a USB drive. Don't forget to unmount! * When programs die, they leave a file named "core" around. - can be big - find ~ -name core -exec rm '{}' \; * Matlab is also on unixs. If you have a fast internet connection and you are running Linux (or if you have an X-server running), you can log in remotely using ssh and use Matlab. - You can also use it in command-line mode using a simple window like a telnet window. If you want to do this, contact me for instructions. * Much of the lab work can be done using octave instead of Matlab. Lab summaries and grading * summary report o see sample as described on web page for lab 1 * diary.txt * plot files (jpg preferred), m-files, etc. NO .fig files! * mail to me: pine on unixs or web page or move to your pc and email or whatever. * Best to zip all files together first - zip filename.zip *.m *.txt *.jpg - the zip command is easier. It can be issued from the Matlab command prompt by prefixing it with a "!" !zip filename.zip *.m *.txt *.jpg - WARNING: shut down the diary by typing "diary" before issuing the the zip command. Otherwise the diary file will be incomplete. * Grades: A+, A, B, 0. (99, 94, 88, 0) - I will average the grades and send them to Prof. Layton - He counts the lab grade as 30% of the course grade. lab 1(b) * three sessions * For returning students * Starting up Matlab 6 * Adaptive quadrature * Examination of source of roundoff errors in the case of matrix multiplication. * Implicit and explict Euler method for ODEs EXERCISES 1. q_elt.m: elemental 4-pt Gauss integration 2. qerr_elt.m: estimate errors 3. q_total.m: integration on uniform mesh. Uses structure. 4. integrate three_peaks 5. q_adaptive.m: adaptive strategy 6. Look at meshes for 25*x^4*y^4 7. Look at meshes for three_peaks 8. Roundoff error in matrix inversion 9. Explicit Euler for simple ODE 10. Implicit Euler for simple ODE lab 1(a): * three sessions * For new students * Starting up Matlab 6 - Matlab java window interface windowpanes * Using a browser (Netscape/Mozilla/Konquorer) - download - cut-and-paste * getting help * Lab summaries * Getting started (homework) * Intro to Matlab by doing * A little bit of ODE's EXERCISES: 1. editing a file 2. using the debugger 3. using the debugger to trace execution ------------------------------------------ summary file starts here! ------------------------------------------ 4. Matlab variables and notation 5. script m-file 6. vectors and matrices 7. loops and if 8. non-trivial script m-file 9. function m-file 10. ODEs, Explicit Euler, graphics 11. Implicit Euler login/startup step by step 1 Log in: Pitt ID (not Math) 2 Click on icon to start Firefox 3 Go to www.math.pitt.edu/~sussmanm 4 Click on Math2071 5 There is a schedule, pointers to Mathworks web site. 6 Go to lab 1 7 Iconize using "-" at top right of window 8 bring up Matlab with Matlab icon or K (start menu) 9 Blank window comes up: minimize it 10 Matlab window comes up: lotsa error messages, ignore them 11 Discuss windowpanes and what they do a little - Workspace - History - Current directory 12 Focus on "Current Directory" windowpane 13 Double-click on "Desktop" 14 Double-click on AFS - This is same directory as unixs sees. 15 Click on "create new directory" icon, create math2071 - double-click to get into it 16 Similarly, create lab01, lab02, ..., lab10 17 Double-click to get inside lab01 (In future, you can jump straight to this directory from drop-down list.) 18 Ready for Exercise 1 now, but tell them to wait until after 19,20 19 Discuss - Diary.txt: I will look at this if I cannot see how you did something. If it is not there, I cannot provide help and advice. - summary file: o This is very important! o It should not be too long or too short. o I want to be able to read this file, so it should contain full sentences. o I want to be able to check correctness of your work, so it should contain numerical results. o One point of writing a summary is to help fix in your mind the focus of each exercise. o A second point of the summary file is to get you into the habit of keeping track of your numerical experiments in some formal manner. When you are doing research, you may be doing hundreds of numerical experiments, and you MUST get into the habit of documenting 1. What was the point of each experiment? 2. What exactly was done in the experiment? There should be enough information here to repeat the experiment. Matlab files will help in this documentation. 3. What was the result of the experiment? Not just the numbers, but what the experiment told you. - tell them to Read "Getting Started": question list at end of lab is really a study guide. 20 Finish Ex 1,2,3 in lab, 21 "Getting Started" 22 Exercises 4-10 in next 2 sessions