Tuesday, January 27, 2015

Public transport & cycling orbital for Cambridge

I have long thought that West Cambridge (and Northwest Cambridge, now that it is being built) should be connected by fast public transport to Cambridge railway station and to Addenbrookes hospital. The rough map above shows a proposed route running (from NW Cambridge) East to the Science Park and the new Chesterton Junction Railway Station; and (from West Cambridge) south alongside the M11 to Trumpington and the guided busway. This route would connect to both the Trumpington and Madingley Road Park-and-Ride sites.
If there were a nice cycle-path along these routes too, it would provide pleasant commuting options for people who live outside Cambridge to get to work at the West Cambridge, NW Cambridge, or Science Park sites.
The part alongside the M11 could have a nice view of the Cambridge wind farm that I visualised in June 2009. A 36-turbine wind farm would produce enough power, on average, to power the University's Departments and Offices (not including the Colleges). I think that an arc of turbines alongside the M11 could make an interesting icon.

Monday, January 19, 2015

Bye bye Ubuntu Linux - Hello MacBook Air

Today I unpacked a MacBook Air. I have used Ubuntu Linux happily for a long time, but it seems to be time to migrate.

Favourite software on ubuntu:

mutt for mail
emacs
octave
mgp (magicpoint) for presentations
firefox
gcc
make
python
perl
latex
metapost

I'll record my progress on this blog-post.

Kind friends made excellent recommendations.

MacPort

I installed MacPort and it provides a functionality very similar to apt (apt-get install blah). And I found that many packages are supported by Port, some of which I had never expected to see again! xcode had to be installed for port to be able to do its thing.
sudo port selfupdate
     sudo xcodebuild -license
     sudo port install gnuplot
     sudo port select --set python python27
     sudo port install ghostview 
     sudo port install gv
     sudo port install make
     sudo port install convert
     sudo port install imagemagick
     sudo port install magicpoint
     sudo port install mutt
     sudo port install unison
     sudo port install xv
     sudo port install xephem
     sudo port install ruby
     sudo port install tcl
     sudo port install xeyes
 sudo port install tk
 sudo port install rails
 sudo port install wget
 sudo port install mercurial git 
 sudo port install ffmpeg figlet lynx mysql ncftp stunnel unrar tcsh csh sh git-core  signing-party  ntop tcping bash bash-completion file xdu tree 
 sudo port install acroread
 sudo port install xpdf
 sudo port install dasher

 
To get "locate" to work, I did this:
     sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Tom taught me about caffeinate -i to stop the machine from going to sleep. It is already installed.
To get focus to follow mouse (into terminals at least) I tried this, but it didn't seem to work.
  defaults write com.apple.Terminal FocusFollowsMouse -bool true
  defaults write com.apple.x11 wm_ffm -bool true
  defaults write com.apple.Terminal FocusFollowsMouse -string YES

X11

I installed Quartz because xdvi said it needed X11 in order to run. It says I need to log out and in to get X11 to work. Not sure what that means.

Settings

I used system preferences to crank up the key-repeat speed to the maximum. I switched off most of the audible notifications; to switch off the "outgoing mail sounds like a jet engine" nonsense, I had to go into mail preferences.

MacTeX

I need to figure out whether going with MacTeX is a good idea or should I find a version in Port and stick with that? Instructions for MacTeX
cd /Volumes/packages/MacTeX/
installer  -pkg MacTeX-2011.mpkg -target /

/usr/local/texlive/2014/bin/x86_64-darwin/tlmgr update --self
/usr/local/texlive/2014/bin/x86_64-darwin/tlmgr update --all

Keyboard

I want shift-3 to give # not £ so I went into keyboard preferences, selected "show keyboard options in menu bar" and then added US as well as UK to the list of available keyboards, and switched to US.

Things I still need

Keyboard shortcuts in Apple's Mail programme - can I get it to feel like mutt? Why doesn't "mark as junk" come up as an option? How to move mail's focus between the message and the list of messages? What is the keyboard shortcut to close just one terminal window? (not all terminals! which is what cmd-Q does) Why does
emacs filename & 
not work? How can I get the command line completion feature that I had in tcsh? (e.g. ls !$TAB)

Tim's recommendations

Some of my productivity choices:

Although it comes with an emacs, I use Aquamacs : http://aquamacs.org

Flip windows around with keypresses: http://mizage.com/divvy/

After you have got used to the mac a bit, Quicksilver : http://qsapp.com

And a key macro (e.g. for inserting dates and times): http://smilesoftware.com/TextExpander/index.html

Tom's recommendations

My biggest tip is that, if in doubt about how to do something, try dragging and dropping.

My second biggest tip is to make use of Time Machine. Hassle free overnight recovery from a lost or stolen machine.

As for software:

* A better terminal: http://iterm2.com
* A package manager: http://brew.sh
* Like Divvy: http://manytricks.com/moom/
* Like emacs: https://code.google.com/p/macvim/ ;-)
* For all those random notes: http://notational.net (not been updated in ages but works really well for me)
* Offsite backup: https://www.backblaze.com 
* A forgetful programmers friend: http://kapeli.com/dash
* Like Word: https://www.tug.org/mactex/ 

And some important command line tricks:

* Drag a file or folder onto the terminal
* Drag the little icon at the top of a document window onto the terminal
* Copy, then type pbpaste in a terminal  (e.g. pbpaste | wc)
* ls | pbcopy  — then paste
* caffeinate -s (for when your computer is too sleepy)
* open index.html
* open random-word-doc.docx

Seb's recommendations

Using search is usually quicker than navigating to find stuff. Cmd-space (Spotlight) to find apps (including switching to open ones), files, emails, etc. Or use the search box in ‘file open/save’ dialogs. (Quicksilver is a fancier search/launcher system, which I don’t use)
Cmd-Tab switches applications, but use Cmd-~ to switch windows within each application.
Delete is Fn-backspace  (both for text and things like files in Finder).
If you download an app from the internet which hasn’t got Apple approval, the first time you launch it, override the fact that Apple “protects” you from it by “right clicking” (two-finger-click or ctrl-click) and ‘Open’. Thereafter it will open normally. You can turn off this security feature completely if you want.

Time Machine is indeed excellent for backup - and as the name suggests you can go back to older version of files if you need to. You either plug in an external drive, or configure it to use a device on your home network (Apple Time Capsule or non-Apple equivalent NAS device, just check it offers Time Machine support).

Personally I would be wary of iPhoto - it has some nice features but I don’t trust it either to look after my photos or give them back to me when I want to stop using a Mac.

I don’t know if ti’s still the case, but to get backspace to work properly in Terminal when ssh’d to a Linux box, in Terminal Prefs, I had to select rxvt as terminal type, uncheck 'Delete sends Ctrl+H', (http://chad.glendenin.com/macosx-backspace.html)

Everything below this point is third party stuff you need to install (mostly free):

nvALT is an updated version of notational velocity (which Tom mentioned) - for keeping text-based notes. Works well for me too, and you can store the notes in Dropbox so you can access them on your smartphone too.

pwSafe - password safe (not Mac-specific, but there’s a mac version) (syncs to phone etc too)

Making disk images - Carbon Copy Cloner. Good as an extra backup, and also if you lose you Mac or, heaven forbid, it dies, you can plug the disk into a friend’s Mac and boot up your system straight off it.

An alternative online backup: Arq (looks nice, haven’t got round to trying it yet).

Ripping DVDs: makemkv


Tuesday, August 12, 2014

Wind farm visible from Cambridge

I popped up Castle Hill two days ago and discovered that 13 wind turbines can now be seen from Cambridge.
The wind farm is called Wadlow Farm and here is a bit of it arriving during the 2011-2012 construction:

Monday, May 26, 2014

Energy density of a spring

Energy density of a spring (or a "mainspring")

My 2-year-old son loves wind-up toys, and that set me thinking... what is the energy density (the energy per unit mass) of a wound-up spring? After a bit of googling, I have come to the conclusion that this is one of the few questions to which the internet does not know the answer!

A clockwork toy's gearbox A clockwork toy's mainspring, fully wound down.

Quite a few people have already asked the question.

For example, on the xkcd forum " today I began thinking about mainsprings, the coiled springs typically used to power wind up clocks, watches, etc. While reading up on them I began to notice a trend where articles comment on how much energy they can contain (usually described as "a lot" rather than anything useful.) This led me to try to find a source for the potential energy of a mainspring, something that I've found rather difficult to find." The same question has been asked more than once on physicsforums.

And there must be plenty of experts who know the answer

... for example these Birmingham researchers, and about 400 years of clock-making experts, and Trevor Bayliss who made the wind-up radio. I don't know why they are so secretive! :-)

Let's figure out a rough answer to the question

A coiled spring stores energy in the same way as a bent beam. You can read about the energy stored in a bent beam in my lecture on the musical note produced by the "beams" of a marimba or xylophone.

Gamelan - a musical instrument like a marimba

It's interesting stuff, but actually we don't need all that detail to get the answer. The key insights we need are

  1. The energy per unit mass in a bit of the spring that is strained with a strain of ε is
    0.5 Y ( ε2 ) / ρ
    where Y is the Young's modulus, and ρ is the density.
  2. The stress τ is (roughly) related to the strain by
    τ = Y ε
  3. and the maximum stress you can cope with [in a spring that is to be reused many times] is called the Yield strength, which I'll denote by the symbol τmax.
Putting these facts together, if εmax is the maximum strain [εmaxmax/Y] The maximum energy per unit mass in the bit of the spring that is maximally strained is
0.5 Y ( τmax/Y )2 / ρ = 0.5 (τmax)2 / ( Y ρ )
Now, not all of the spring will manage to be in this state of maximum strain, and the spring must be housed in a container too, which adds to the weight, so this energy density is an upper bound on what is possible with a spring made of a given material.

Material Y τmax ρ 0.5 (τmax)2 / ( Y ρ )
GPa MPa kg/m3 (Wh/kg)
Steel (structural ASTM A36 steel) 200 250 8000 0.005
Titanium 116 225 0.013
Rubber 0.03? 16? 1100 1.1 ?
Carbon fibre [.] 230 4000 1600 6.0?
Carbon nanotubes ? ? ?
Steel (Micro-Melt 10 Tough Treated Tool (AISI A11)) 200 5000 7450 2.3

We can compare these energy densities with those of other energy storage systems featured in my book by looking at page 199. Sadly, the wind-up spring doesn't get close to the energy density of even the worst rechargeable batteries (30 Wh/kg).

[Next steps: quality-assure the numbers in the table, and do a real-world check against the actual weight and actual energy stored in real clock mainsprings.]


Wednesday, November 7, 2012

Monday, July 16, 2012

Video Lectures on Information Theory, Pattern Recognition, and Neural Networks

Before I got into Sustainable Energy (2008) and started working for the government on things like the DECC 2050 Pathways Calculator (2009-2012), I used to have a lot of fun researching, writing, and teaching in the fields of Information Theory and Machine Learning. For about ten years, one of the most popular courses in the Department of Physics was a [senior-level] course that I taught on Information Theory, Pattern Recognition, and Neural Networks, for which my [free online] book on Information Theory, Inference, and Learning Algorithms (2003) was the textbook.
Working as a Chief Scientific Advisor to DECC put a stop to my course (2009), but thanks to help from my research group, and a volunteer audience, we have recreated the course and put together 16 videos of lectures (plus a little bonus lecture, from a practice session).
These lectures will soon all be available on videolectures.net, and are also available from our local website.
A big thank you for Emli-Mari Nel for leading all the hard work - it is amazing how many things can go wrong with video-making, and Emli-Mari has done a fantastic job of cleaning up jittery video-signals and buzzy audio, and making things work nicely on the videolectures site.