Physics 210 2014 - Archived Material

This document will be updated throughout the course.

Table of Contents

      
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

1 November 23, Sample term projects from 2014

Here are links to scans of the writeups of two exemplary projects from 2012.
This should provide you with some idea of what a good project might look like.

Feel free to try to raise the bar, and perhaps yours will be gracing these web pages in 2016!

2 November 20, Interruption of service

As those of you who were in the lab this afternoon know, the machine that acts as the "server" for the course--laplace.phas.ubc.ca--(hosts the web site and the file system /phys210) was down for an extended period.

I was doing some reconfiguration of equipment in my office that necessitated a restart of the machine, and due to a technical issue that I won't bore you with, the machine was rendered unbootable. After 90 mins or so of flailing around trying various futile fixes, I finally downloaded a DVD of the most recent version of Mageia, which includes a "rescue" facility that allowed me to remedy the problem.

You shouldn't have lost any data due to this snafu, but if you think you did, let me know and I will check the backups for you.

I apologize for the inconvenience this caused, as well as the fact that I was unavailable for most of the afternoon.

Note, however, that I will be in the lab tomorrow (I'll try to post the hours so somewhat beforehand) as well as for a few hours both Saturday and Sunday.

3 November 13, Interstellar

Lots of gravitational physics in this movie [TRAILER]

Kip Thorne, an executive producer and chief scientific consultant for the film has a very readable book on the science that underpins the movie: The Science of Interstellar

4 November 5, Homework 3 Handout now Complete

The full Homework 3 handout is now available HERE as well as from the course home page and the homework page. I'm sure that you'll find a bug or two or three, but it's definitely in good enough shape to allow you to get working on Problem 4.

5 November 4, Homework 3 Problem 3 now OPTIONAL

Since Problem 4 of the current homework---which I consider to the most important homework question in the entire course by a substantial margin---has developed in length beyond by initial expectations, Problem 3 is now OPTIONAL, and for bonus credit.

From my snooping, it appears that only on the order of five of you have started and/or completed it, and if you are among those, you will all receive bonus marks for what you have done, with a level of bonus commensurate with how well you have completed it.

HOWEVER, NOTE THE FOLLOWING

  1. I still urge all of you to attempt to complete it. Newton's method plays an extremely important role in many areas of computational science, and is an absolute must for the toolbox of anyone who wants to consider themselves even moderately educated in scientific computing. For example, the last part of the question has you solve a nonlinear equation that arises directly from the material on quantum mechanics most of you are currently studying in Physics 200.

    If you think you can solve it quickly, then I would go ahead and do so before you start with Problem 4; otherwise I recommend that you focus your attention on finishing Problems 1 and 2 soon, and then move on to Problem 4

  2. Most importantly: since I have already mentioned in class that I expect that Problem 4 will be quite challenging for many of you, and that you shouldn't be too concerned about how well you solve it will impact your final grade, I am concerned that some of you might be inclined not to put enough effort into it.

    Now that Problem 3 is optional I expect that most, if not all of you, should be able to do a good job with Problem 4, particularly if you get assistance from your instructors and classmates as needed. The TAs and I will be able to tell from your code the amount of effort that you have expended, and if the effort is low you can expect your performance to have a substantial negative impact on your final grade.

To summarize, the effort you have invested in working on Problem 4 definitely matters, and the amount of effort you have invested in Problem 3 also matters in that regard; i.e. we will be considering the sum total of what you have done when we decide what grade you should receive.

My expectation is that most of you will need to spend more time on this problem set than the others; that should be your expectation as well.

However, I firmly believe that as you work on your term projects you will find the return on your investment to be substantial.

6 October 30, Homework 3 handout and Homework 3 bug page

As always, the online version of the homework is up to date. Be sure to clear your browser cache as necessary so that you get the most recent version.

Download it from HERE (or from the course home page or course homework page.)

7 October 21, 2014: Quiz 2 grading

Mona reported a problem with the grading of her Quiz 2 which, due to the fact that I used a script, was probably not isolated to her work alone. I have thus re-run the script, and hope that the updated /phys210/$LOGNAME/matlab/README_q2_$LOGNAME files are now correct. Let me know if there are appear to be further problems.

8 October 17, 2014: Term project proposals presentation schedule

I think I have everyone's lab section sorted out, so the presentation schedule for next week is available HERE.

I will greatly appreciate if everyone can have a quick look at the page to ensure that you are scheduled to speak in the section in which you are enrolled.

Once again, please refer to the instructions in the

Term Project Proposal Page

for full details concerning how your presentations should be prepared and e-mailed to Arman.

Presentations must be e-mailed to Arman in PDF form by

Noon, Monday October 20

and this is a firm deadline.

9 October 10, 2014: MATLAB on hyper fixed

The MATLAB issue on hyper has been fixed. Let me know if you encounter any problems running it there.

10 October 10, 2014: Quiz 1

I've run your MATLAB Quiz 1 scripts (q1.m) through a grading script. Results are in

/phys210/$LOGNAME/matlab/README_q1_$LOGNAME

Class averages (won't add to 12 due to some missing scripts)

Well done!

11 October 9, 2014: Variations on a theme

All those Hello World!'s:

 Variant             Frequency count.

'Hello WOrld'               1
'Hello World!!!!'           1
'Hello World!'              5
'Hello World'               3
'Hello word'                1
'Hello world !'             1
'Hello world!!!!!!!!!!!!!!!!!!!!!!!!!!! LOLZ'        1
'Hello world!'             16
'Hello world'              27
'hello world!'              1
'hello world'               3

Anarchists indeed ...

12 October 9, 2014: Running MATLAB on hyper

A couple of you have noticed that executing matlab on hyper doesn' t work. There's a small system issue that needs to be addressed and I hope that it will be fixed soon. For the time being there are at least two work-arounds:

  1. Use the full pathname to start the application

    hyper% /opt/matlab/R2013a/phas/bin/matlab -nosplash -nodesktop
    
  2. Secure-shell to tau.phas.ubc.ca and start matlab there (recall that tau is the server I mentioned a while ago that will eventually replace hyper).

13 October 9, 2014: Term projects must be coded in MATLAB

I need to emphasize that all projects must be implemented in MATLAB unless you have my explicit approval to use a different language. So if you do want to use some other language, you will need to speak with me soon about the matter.

14 October 8, 2014: Term project topic: Simple ray tracing optics

As I was discussing with a few of you in the lab yesterday, the ray tracing optics project is reasonably challenging and, I think, fun to do. You can see an example of the results from a nice implementation of it last year by Alex Fang here: MPEG and MPEG.

Note that this is not a pre-approved topic: I ask you to speak with me (i.e. in person if at all possible) should you wish to try it since students have tended to struggle with it in the past for a variety of reasons.

15 October 8, 2014: Clarification for Homework 2 Problem 2

Since there has been some confusion about this, note that for Problem 2, the only subproblem that involves a plot is 2.5. For the others, your expression should evaluate to either

  1. A single floating point number (2.1 and 2.3)
  2. A symbolic expression (2.2 and 2.4)

So, in summary, generate one plot for Problem 2.

16 October 6, 2014: Term Project Proposal Page

See THIS PAGE for detailed information concerning the selection of your term project topics, how your choice of topic is to be e-mailed to me, and how you should prepare for your presentation to your peers and myself on Oct 21 and 23.

17 October 6, 2014: Homework 1 Graded

Amanda and Arman have finished grading your first homeworks and comments along with your marks are available in a README file (what else?) in your hw1 directory, i.e. in

/phys210/$LOGNAME/hw1/README

Note that the grading was split in the following way:

Amanda marked: 1, 2 and 5.

Arman marked: 3 and 4.

Should you have questions or concerns about the grading of one or more problems, please direct your questions in the first instance to the TA (or TAs) who graded the question(s). Should the issue(s) not be resolved to your satisfaction you are then absolutely free to consult me about the matter.

18 October 4, 2014: Maple finished --- on to FDAs & MATLAB

"Except" for the homework, we're done with Maple and will move on to new topics this coming week:

19 October 4, 2014: Homework 2 finalized

The complete handout for Homework 2 is now available HERE. There will likely be some bug fixes, but I hope not too many.

20 pages of handout, but, in principle, less than 100 lines of procedure code to write, so don't panic, but please em do read the handout. It's to be viewed as part of the course notes as well as an assignment.

Deadlines

20 September 30, 2014: Introducing the Homework 2 bug page

Now that part of Homework 2 is out, the bug reports are coming in! To minimize confusion and the number of detailed Connect messages that I will need to send, I have started a SPECIAL PAGE that will enumerate the bugs, along with a summary of what action you will need to take, relative to the original handout, to deal with the defects.

So far, all the bugs are harmless; i.e. require no action on your part.

Nonetheless, I surely appreciate the reports, no matter how trivial the issue might seem to be, so keep at it!

The bug page is also available from the course home page, under the homework link.

Finally, I will keep the online handout and any other related online material (such as my version of the worksheet for Problem 1) updated approrpriately. Just remember to clear your cache as necessary (again, Safari users are likely to have to do this), to ensure that you get the latest version of any document.

21 September 30, 2014: Shellshock

In what I consider to be a bit of a cosmic coincidence, given that the first homework had a significant bash component, the server outage was due to the recently discovered "Shellshock" vulnerabilities in the bash.

I predict that there will be quite a few more problems unearthed with this particular piece of software before all the dust settles.

22 September 26, 2014: Course web server back up, homework due tonight at 11:59PM

The course web server http://laplace.phas.ubc.ca is back up. The course home page and links within, including your own course pages, should now be visible from any browser per usual.

Those parts of homework 1 for which the deadline was extended are now due tonight at 11:59 PM.

23 September 25, 2014: You're not alone ... :-)

For your amusement, here's a pipeline which tells me how many students were still working on the homework today:

% ls -lR /phys210/*/hw1 | grep 'Sep 25' | awk '{print $3}' | sort | uniq | wc -l

(note that you can't execute this since you don't have access to anyone's hw1 directories but your own).

The first student who e-mails me the integer that this command produced at 9:46 PM on Sept. 25 can collect $10.00 from me.

One entry per student only --- no generation of 65 messages covering all the bases

If you play the game, make sure that I can identify your name from the message.

P.S. Sorry Arman & Amanda, only undergraduate students can play!

24 September 25, 2014: New physics server: tau.phas.ubc.ca

The PHAS system administrators are in the process of replacing the aging hyper.phas.ubc.ca, with a new server

tau.phas.ubc.ca

and although the configuration is not quite complete (as we shall see in today's lab), you should now be able to ssh to that machine, both from the lab machines, and on your own systems. Additionally, provided that you have the appopriate software installed, X-based applications (kate, gedit, gnuplot, maple, etc) running on tau should also work for you, modulo the fact that some packages including gnuplot and kate have not yet been installed.

Once we (the sys admins and I) feel that tau is properly set up, I will recommend that you start using it rather than hyper, not least so that we can get any remaining bugs worked out quickly.

25 September 23, 2014: Note added to Homework 1 handout

Please note the following:

For HW 1, Problem 2, be sure to check that all of the intended contents of your page---most notably the images---appear when the page is accessed outside the lab, e.g. using a browser on your laptop or home machine. To facilitate this, make sure that the image files are located in

/phys210/$LOGNAME/public_html 

not somewhere within your home directory /home2/$LOGNAME.

26 September 20, 2014: Another small modification of Homework 1 handout

I've made a small amendment to the Homework 1 handout. In Problem 4, I have modified all three instances of the text

Using a single pipeline of commands ...

to

Using a single command or pipeline of commands ...

I.e. if you can solve any/all of the problems with a single command, that is fine.

The online version of the handout has been updated to reflect the change, and thanks go to Mona for bringing to my attention the need for the clarification.

The online version of the handout has been updated to reflect the change.

27 September 20, 2014: Using filezilla/wget to transfer files to lab machines

If you are having difficulties transferring files from personal machines to the lab machines, see HERE for a workaround. Please e-mail me immediately if you encounter problems with the workaround.

28 September 20, 2014: Soln of gnuplot exercise

Sample solution of gnuplot exercise.

As emphasized in the lab notes, I would like you to get in the habit of scripting commands that you would normally type at the command-line (when using any command-line driven software), and then using the software's facility to redirect input to execute the commands in the file.

## Display the contents of the script file, created using my text editor
% cat gnuplot-input

# Enable dashed lines ...
set terminal wxt dashed

# Plot the title ... 
#  - tc rgb "blue" -> title color is blue
set title "My plot of cos(x**2)" tc rgb "blue"

# Make the plot ...
#  - lt 2 -> line type is 2, i.e. dashed (use test command to see this)
#  - lc rgb "green" -> line color is green
plot cos(x)**2 lt 2 lc rgb "green"

## Start gnuplot and load the script file to generate the plot
% gnuplot 
gnuplot> load "gnuplot-input"

29 September 18, 2014: Soln of sed and pipeline exercises

Sample solution of sed exercise. We can't use redirection directly to change myfireice so introduce a temporary file.

% cd ~/redirect

% cp fireice myfireice

% sed 's/say/state/g' < myfireice > foo

% MV foo myfireice

_Or ..._

% my foo fireice

_... and answer 'y' to the overwrite prompt._

Sample solution of optional pipeline exercise

% sed 's/ .*$//g' < poems | grep -v '^[ ]*$' | sort | uniq | wc -l

Sample solution of backquotes exercise.

Part a)

% mylist=`ls`

% cd ~phys210t
% mylist=`ls`
% echo $mylist

cmd dir1/ dir2/

Part b)

First, determine the full pathname to the "real" ls using the which command, then use that pathname within the backquotes:

% which ls
/usr/bin/ls

% mylist=`/usr/bin/ls`

% cd ~phys210t
% mylist=`/usr/bin/ls`
% echo $mylist

cmd dir1 dir2

30 September 16, 2014: Solution of pattern matching exercise

Sample solution of Pattern matching exercise 2

% mkdir -p /tmp/$LOGNAME/mywords

% cd ~phys210/words

% cp [aeiouAEIUO]*ing /tmp/$LOGNAME/mywords

31 September 13, 2014: Safari users -- clearing the cache

For Safari users:

lease see HERE for instructions to clear Safari's cache. Knowing how to do this is important to ensure, for example, that when you click on a homework handout link you will retrieve the most recent version.

32 September 13, 2014: Installing filezilla for file transfers

See the course Software page for information about FileZilla, an application you may want to install on your personal machines to allow you to easily transfer files to and from hyper.

33 September 11, 2014: Some humour?

Let's lighten up... 1 |2 |3

34 September 11, 2014: Installing PuTTY/Xming

If you are working remotely using PuTTY/Xming (Windows) or with a Mac, I suggest that you use the text editor gedit rather than kate. gedit appears to have much better performance than kate when used remotely and is just as good a text editor for the purposes of this course.

35 September 11, 2014: Solution to aliases exercise

Sample solution to Lab 2 aliases exercise

36 September 5, 2014: Analysis of Lab Exercise 1.2

Some RESULTS from Lab Exercise 1.2