Resources

Python

Check your Python version if your numpy/scipy/matplotlib don't work.

Here are a few links to Python tutorials. Learning Python, which we have as a real book in the lab, is also a good place to start. Otherwise:

  • Python Tutorial by Guido van Rossum, Python's author. A more standard introduction to Python for those who already program (a little) in other languages. In general, http://www.python.org is the place to go for all things Python (such as function and module reference, etc.)
  • Dive Into Python. A fast introduction for the programmer, with comparisons to C, Java, and Visual Basic. Has the highest information/page ratio, but it might be too fast-paced for some.

There are tutorials, automatic competitions, clubs, secret societies, and communities of Python throughout the interwebs. If you can't find a subculture to match your level, style, and interests, then start your own.

Students are encouraged to make use of existing libraries of commonly used functions rather than writing their own. In particular, numpy, scipy, and matplotlib enable Mathematica/Matlab functionality and feel. If matplotlib is not working, you're welcome to use GNUPlot, xmgrace, or any other equivalently user unfriendly plotting program. Or write your own.

If you're having difficulty juggling dependencies on OSX (Apple products…) and getting nasty errors, you could try the scipy superpack, which purports to install the whole lot at once.

Finally, for anyone looking to gain a complete command over a language, there are the Euler Problems.

Unix/Linux

Linux is no longer an impressively obdurate seething mass of opaque code and bearded men living in their mum's basement. It now has a GUI. However, in order to understand why it remains the OS of choice for most numerical scientists (bearded or no), and to understand the intense humour of this slightly bizarre subculture, it is necessary to attain fluency.

Here's a few Linux/Unix tutorials that you might find useful:

- This Introduction to Linux and especially its Absolute Basics.

- This RedHat-specific intro.

- On bash, which is the shell you should be using once you figure out what a shell really is. Right now, you probably have tcsh: to change it, do ypchsh, give your password, and then /bin/bash.

Books on Linux may one day have value as collectors items. Today, online documentation is profuse and generally up-to-date. If in doubt, google ”<action> linux”.

List of Computation Lab Computers (for sshing)

To connect remotely: run ssh -Y [username]@[servername].caltech.edu from a unix terminal (present by default on Linux and MacOS systems, but you'll need to install Cygwin/X on Windows). The -Y flag allows you to run graphical programs using the X Window System.

  • lazirus
  • vorpal
  • white-knight
  • mad-hatter
  • queen-of-hearts
  • bandersnatch
  • dodgson
  • cheshire-cat
  • boojum

LaTeX

LaTeX is the lingua franca of scientific discourse, and proficiency is assumed. We require you to write your report with LaTeX. To start with, check Overleaf here. You can also write and compile LaTeX codes on your laptop. A quickstart guide to LaTeX from the command line in Unix type systems (Ok, LINUX!) can be found here, and includes a few templates to get you started.

In addition, Python and LaTeX can be made to interact in interesting and potentially time-saving ways. For instance, if you have a document with figures generated by some code, it's possible to have the code automatically update the figures in a directory each time the code is run, and to recompile the LaTeX document. This approach enables rapid changes in code and can expedite the process of document revision. LaTeX can be written in Emacs or any other text editor, and compiled from the command line. A quick reference for equations and figures (its main strength) is the relevant wikibook.

Graphing

Although students are required to demonstrate ability with open-source graphing packages such as matplotlib, gnuplot, xmgrace, or g, the sometimes spartan nature of their GUI (if any) is no excuse for morally emaciated graphs. Graphical design is an integral part of science communication, which in turn is the life-blood of the research community. A thorough knowledge of LaTeX formatting and graphical design ability is assumed knowledge in anyone with a degree in science who intends to use it.

The global authority on the graphical presentation of quantitative information is Edward Tufte, whose lifelong crusade for informational clarity and density has produced multiple books and even more headaches, summarises his ethos with 'simple design, intense content'. A more thorough exposition of his principles of design can be found here, and is well worth the 3 minutes it will take to read. Plotting programs eliminate the hours of drafting and plotting common in times past, but this should be an aid to revision and perfection rather than a hindrance. As the courses progress we expect to see an improvement in all areas of scientific computing, including communication and presentation. Tufte's books are also available from the library or the TAs, though are somewhat longer reads!

A seminar course run by an ex TA of this course (Michele Vallisneri) on Friday afternoon in Cahill on scientific computing has now had past lectures summarized and put on the internet. Here is the one that concerns graphing nicely, and here is the root directory with all the archived emails available.

Readings and Assignments

Assignments are due by midnight on the due date listed on the course website. For submission, please include your codes and a report written with LaTex. All assignments can also be found on these (Ph20/21/22) pages. In case of confusion, inconsistent dates and pending updates, these websites represent the correct information.

Ph 20 (Winter 2019)
Week of Reading List Assignment Due Date
Jan 7 20.1 Introduction to Python Jan 18
Jan 14 20.2 Introduction to Numerical Techniques Jan 25
Jan 21 20.3 Numerical Solution of Differential Equations Feb 8
Feb 4 20.4 Unix Tools: Shell, Version Control, Makefiles Feb 22
Feb 18 20.5 Introduction to Symbolic Computing in Mathematica Mar 1
Feb 25 20.6 Numerical Computation in Mathematica Mar 8
Mar 4 20.7 To be updated Mar 13
Ph 21 (Winter 2019)
Week of Reading List Assignment Due Date
Jan 7 21.1 Strings and webs Jan 17/18
Jan 14 21.2 Fourier Techniques Jan 31/ Feb 1
Jan 28 21.3 Image processing Feb 14/15
Feb 11 21.4 Bayesian Analysis Feb 21/22
Feb 18 21.5 Markov chain Monte Carlo Feb 28/ Mar 1
Feb 25 21.6 Principal Component Analysis Mar 7/ Mar 8
Ph 22 (Spring 2019)
Week of Reading List Assignment Due Date
Mar 31 22.0 Finding Roots Tuesday Apr 15
Apr 14 22.1 ODEs, higher order methods Tuesday Apr 29
Apr 28 22.2 Three body problem Tuesday May 6
May 5 22.3 N-body Simulations Tuesday May 13
May 12 22.4 N-body using approximations Tuesday June 2

Old Readings for defunct assignments

Acknowledgements

The text on this page and others is derived in part from the work of many previous TAs of this course, including Michele Vallisneri.

 
ph20.txt · Last modified: 2019/01/22 13:18 by physlab
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki