|
|
PHY308 Spring 2009 |
||||||||
|
Science and Computing II |
||||||||
PHY308/600: Science and Computing II
Prof. Duncan Brown SyllabusThe course syllabus is available online in PDF format.Useful linksProject 1: Introduction to Unix and CThis project is intended for students who do not have prior experience with UNIX and the C programming language, or would like to refresh their knowledge before attempting the later projects. The project will introduce the UNIX operating system, the vi editor, the gnuplot plotting program and basic C programming. The first few pages of this project are intended to be used as a reference. You will become familiar with these commands as you use them in the practical sessions and write up a short report on a computing exercise.The report for project 1 is due Friday February 13, 2009. If you are comfortable with C programming in the Unix environment, you may instead complete project 1A. If you do this, the report is due on same day as the project 1 report. Example programs:
Project 2Project 2 is due on Friday March 27, 2008 at 4pm.
To save a plot to a file in gnuplot, first make the plot you want to save in the usual manner, e.g. gnuplot> plot x title 'y(x)' gnuplot> set xlabel 'x' gnuplot> set ylabel 'y(x)'Next set the terminal mode to postscript and the name of the file to write to. In this example I use myplot.ps, but you can use anything as long as the filename ends with .ps: gnuplot> set terminal postscript Terminal type set to 'postscript' Options are 'landscape noenhanced monochrome blacktext \ dashed dashlength 1.0 linewidth 1.0 defaultplex \ palfuncparam 2000,0.003 \ butt "Helvetica" 14' gnuplot> set output 'myplot.ps'The final command is replot which writes the graph to the file in the format specified: gnuplot> replotWhen you quit gnuplot you should have a file called myplot.ps (or whatever name you chose): [dbrown@antares ~]$ ls myplot.ps myplot.psYou can now convert the postscript file for PDF for use in Windows: [dbrown@antares ~]$ ps2pdf myplot.ps This will create a file called myplot.pdf which you can transfer to Windows using the Secure File Transfer program and drop into your report. Project 2 asks you to empirically deduce formulas for the error terms of several derivative functions as a function of h. To do this you will need to investigate different values of h. Obviously h has to be small enough for the approximation to the valid, so don't use values bigger than h = 0.1. You will need to look at values logarithmically spaced, i.e. decrease h by a power of 10 each time (e.g 0.1, 0.01, 0.001, ..., 10^{-16}) to determine whether h scales linearly, quadratically or is even independent of h When you are plotting this (and particularly when you're looking for numerical instabilities at small values of h) you may find it convenient to plot your error as a function of h on a logarithmic scale in gnuplot. To do this type gnuplot> set logscale gnuplot> replotwhich will set the x and y axes of your plot to logarithmic, rather than linear, spacing. To set your plot back to linear axes, type gnuplot> set logscale gnuplot> replot Project 3Project 3 should be completed by students who did not completed project 1 and not project 1A. It is due on Friday May 1, 2008 at 4pm. Project 3 introduces the use of the GNU Scientific Library to solve physical problems. Project 4Project 4 is an alternative to project 3 for students who completed project 1A instead of project 1. It is due on Friday May 1, 2008 at 4pm. |
|||||||||
|
|||||||||