I wrote a bit last time on procrastination. I’m going through a weird phase of change in which my philosophy is evolving rapidly and my general priorities are shifting. I’m pretty sure (well I hope at least) it’s all going in a good direction, but here’s where I am now.
Unashamedly stolen from the SSCP website. Click to go there.
In fall quarter 2011, the Stanford Solar Car team is going to Australia – we’re going to race our car across the Australian outback over the course of about 5 days. The race is awkwardly smack bang in the middle of the quarter, which means skipping either the quarter or two fairly critical weeks. At first I was very much against the idea (going overkill on units, getting high grades, blah blah blah), but now I’m thinking very seriously about doing it. In essence, the two main competing priorities here are academic success and epicness, and in my new view of the world, epicness is high up on the list.
In fact, I think that’s how things should be, certainly for myself: my job satisfaction / utility function has large positive partial derivatives wrt epicness at every value of every other parameter. In the words of one of the Solar Car team guys, ‘it’s either going to be epic win or epic fail. But either way it’s going to be supremely epic’. It seems that utility generally has to do with wealth, power and emotional stability, and I think epicness will somehow find a way of satisfying all of the above. Plus epicness is good for street cred (and the resume…)
Over the years I’ve taken part in two school-related trips that I will remember for the rest of my days. The first is my first walking trip to Snowdonia in 2005 at the end of my first year at St Paul’s. The second is this one. Both were characterised by breathtakingly beautiful scenery, exciting activities, and an incredible group of likeminded, diverse and amazing people (both were also organised by physicists…) Ours is also a bit of an underdog story, riddled with adventures, stress, disasters and rollercoaster ups and downs but mitigated by dedication, resourcefulness and the best team I have ever worked with. It’s a good story; I hope you enjoy it.
(Also, please check out my pics. “Click to embiggen” applies to all the illustrations in this post.)
The CanSat Competition
Our CanSat
By means of introduction, we were taking part in the first ESA European CanSat competition – a competition to build coke can sized ‘satellites’ that are to be dropped from 1km up (fired up there by a rocket) and drift down to earth using a parachute, taking data as they descend. The thing was organised by ESA, took place at the Andøya Rocket Range (ARR) and was overseen by NAROM (National Centre of Space-Related Education, translated into Norwegian to make the acronym).
The primary mission was to take temperature and pressure data, and teams were required to come up with and effect a secondary mission. Ours (Team Eclipse) could be classified as ‘advanced telemetry’; we were to take measurements of GPS position, speed and course, and acceleration and heading data, to create a wind profile of the various wind layers encountered during the descent. This could be used for the deployment of a hypothetical second payload – to allow the crew to drop the package at exactly the right location for it to fall to an exact position on the ground. Such devices actually already exist and are known as dropsondes and are used by the RAF for similar purposes. We were sponsored by Mattherhorn Investment.
Here’s a quick overview:
Pressure sensor
Used the one that came with the Pratt Hobbies CanSat kit
Calibrated it using bell jar and Pasco altitude datalogging meter
Confirmed at RAL [we did some testing at the Rutherford Appleton Laboratory] to within experimental error
Temperature sensor
Tested at RAL until batteries conked out.
HMC temp sensor seems not to work, but resists calibration owing to wide scatter
Instead derived function using thermistor’s datasheet. Inferred temp as a function of thermistor resistance using Eureqa, CanSat transmits raw voltage, crunch numbers at ground.
Battery
Conked out at low temp (-15°C). Trying to insulate it. Fulfils 3 hr lifetime requirement at room temp.
GPS chip
Needed to import a few libraries
Needed a voltage regulator to get PCB’d
Needed an antenna + connector pins to be bought
Takes time (anything from 45 seconds to 10 minutes) to boot up + acquire satellites
Very temperamental, often just doesn’t work
Antenna was loose, had to secure using araldite
Accelerometer
At first thought there weren’t enough ADCs on the microcontroller, invented logic / switching circuit; but found more ADCs on board
Needed calibration
Used as redundancy for HMC
A short killed it. Needed to buy a new one two days before flight
HMC
I2C Protocol, took forever (research) to get it to work
In meantime, Plan B: get magnitude of accel using analogue accelerometer and use GPS data points (D speed / Dt) to work out accel bearing (this plan was ultimately abandoned when we worked out how to use I2C)
Poor documentation, took 2 days (12 man hours) to work out interpretation of tilt/roll/bearing, and finally worked it out
Discovered tilt/roll are calculated from accel data on chip to get ‘down’ vector, and are redundant data, so factoring them in resulted in apparent constant direction of accel downwards with varying magnitude (!) Chose to assume tilt/roll = 0 for entire flight, just use heading data. Interpretation we took so long to work out was barely used!
Tested using home-made centrifuge
Centrifuge used for testing accelerometer in HMC - consists of Pasco runway on top of turntable, CanSat sitting in bucket
EEPROMs
Nearly didn’t fit, constructed I2C stack to house it all, caused short due to space shortages
Voltage regulator
Adding EEPROMs in late with extreme limitations of space, +Vcc contact pushed through insulation + touched earthed CanSat body, caused short, fried V regulator
Had to buy Zener diode minutes before shops closed (no stock of 3.3V 3-pin regulators)
The two fried components we threw out at the ARR
Printfloat
The NAROM guys accidentally gave all the teams a buggy and redundant function to print floating point numbers so we spent some time debugging this
Data Flow Diagram of our system
Harvester
Adapted by me from a Visual Basic example program
Dumps raw data to file
HAL
Written entirely by myself in C#
Scrapes + treats data from raw file
Outputs treated data to csv
Outputs GPS trace
Calculates + outputs wind profile
Visualiser
Written entirely by myself in C#
Uses DirectX to display a 3D visualisation of the wind profile
Day 0 (Sat 14th Aug) – Preparations
We had a pressure sensor and thermistor-potential-divider temperature sensor. There was a voltage regulator (3.3V) which powered the entirety of the secondary mission: an analogue accelerometer, a digital compass with a built-in accelerometer (the HMC), four EEPROMs which we had added at the last minute, and a GPS chip.
We hadn’t actually done much proper work on the CanSat until a couple of weeks before going to Norway, though we had done a balloon test. We needed to get the go-ahead from the Civil Aviation Authority to fly weather balloons to 100m altitude from our school playing fields but one balloon managed to get loose and flew upwards out of sight, resulting in several awkward phone calls to the authorities and the end of our balloon test! Due to lack of planning and an abundance of problems (including shorts, loose connections and general unticked to-do list items), we ended up doing our actual balloon test on the last day (a Saturday), the day before we left for Norway with a dummy CanSat using video cameras to judge position and speed etc. The reason for our lack of operational CanSat was a short which fried our voltage regulator and analogue accelerometer, though at the time we only knew the regulator had fried and were assuming the worst for all the 3.3V components. I had to rush to Maplin on bike in the rain and arrived exactly at their closing time, at which point I burst in, dripping and dishevelled, and announced to a group of bewildered Maplin employees ‘I need a 3.3V voltage regulator. It might seem funny, but this is a bit of an emergency!’
I ended up buying a Zener diode, as they had no 3-pin regulators in stock.
Day 1 – Journey Up
I discovered non-vicariously that traffic conditions between Barnes and Heathrow are amazing if you wake up at 4:30 am. The Team Eclipse representatives (Matthew Willetts, Tim Palmer, Jacob Ader, Dr Stephen Patterson and myself) convened at 5:30 at Heathrow Terminal 3 with a broken CanSat and a load of equipment (breadboard, croc clips, multimeter, araldite, superglue etc.) – as Tim pointed out, it was clear from what we packed that we hadn’t a clue what was wrong with the damn thing… We were joking at this point about the probability of getting everything working. We figured it was about 1/256 – 50/50 for each of 8 components.
An interesting feature I noticed about Norway’s airports is the fingerprint-based security (apparently phased in about 4 years ago) which replaces the need for a boarding pass and passport after initial check-in. It was incredibly (surprisingly) efficient, secure and functional, and I personally think the UK is sorely in need of such a system.
Our travel itinerary was slightly ludicrous and to get from London to the Andøya Rocket Range where we would be staying we needed to make three flights: London-Oslo, Oslo-Tromsø, Tromsø-Andenes (and of course a taxi journey from Andenes [Apparently the airport in Norway with the second longest runway] to the ARR). We met the Czech team on Oslo before our second flight and flew with them to Tromsø, and we shared our Tromsø-Andenes leg of the journey with the Belgians and the Norwegians.
We did manage to take a peek around Tromsø during our stop. There are two cathedrals, both of which we managed to visit (though only from the outside) and a long bridge from one side of the river / bay to the other. We also discovered at this point that the GBP is ridiculously weak against the NOK – just about everything at Tromsø cost about 1.5 to 2 times more than it would in London… We did find these things called ‘boller’ which were hot cross bun-sized sweet bread rolls which were going for 3 for 20K (approx. £2).
Tromsø's main street
Tromsø's main square
A view of one of the cathedrals from Tromsø's large bridge
The prop plane that took us on the last leg of our journey - from Tromsø to Andenes
On arriving at the ARR we had dinner2 (the Norwegians have two dinners; the first a heavy one, the second more of a supper snack type thing) when I first tasted Brunost, a type of brown cheese Norway is famous for. As someone put it, you either love it or hate it; I guess I fall into the first category. We were told that there was to be no alcohol at the ARR (to much groaning) and then worked on the CanSat until past midnight. We also quickly botched our presentation together (it appeared that we were the only team that didn’t know we needed to do a presentation the next day), confirmed our primary mission components and HMC were working, and discovered the second analogue accelerometer had fried.
The Andøya Rocket Range Hotel
Day 2 – Presentations and work
There was an opening ceremony in the morning
Opening the competition
Our presentation was extremely rushed as we had attempted to fit 6 months of work into a 10-minute presentation. Luckily the entire competition was in English, so we could talk very quickly and wing it a little. We even managed to throw in some Boris Johnson humour and unpreparedness…
We were then given a talk on the Norway Space Centre, whence these (rushed and probably mostly factually incorrect) notes come:
1st rocket launched was 60 years ago, named after Ferdinand the Bull, to investigate noctilucent clouds which are ~ 82 km up, ~ -130°C, humidity ~ 10-6 sea level humidity; wanted to investigate meteoric clouds as a cause.
Svalbard has 24 hr darkness in the winter, good for Aurora Borealis
Norway owns plenty of ocean; if ocean area were taken into account, Norway would be the second largest country in the world (to Russia)
NSC launched its first satellite recently (July 2010) – a side 20 cm cube satellite weighing 6 kg; geostationary; manage ships in ocean.
Microgravity ecology on ISS. Had to build 50-60 M EUR flowerpot!
Svalbard is the best representation of a Martian landscape on Earth – found chemicals there unique to Mars (!)
There are no Norwegian astronauts as the NSC concentrates more on building stuff
Every year ESA do a space camp thing in Norway – the students build an actual rocket, put instruments inside and launch it.
Torstein Wang from NAROM (Torstein literally means ‘Thor’s Hammer’. How awesome is that?) then gave us a talk on the intruder rocket which was to fire our CanSats into the cloud layer to be deployed. Here are some more notes:
Modified Intruder rocket (great name), but lengthened
0-1.9 s after lift off – fuel burn, rocket gets to max speed
Delayed charge set, rocket goes at constant speed to 1 km altitude
Explosive charge ejects nose cone + CanSats
Using Yagi antennas
We were then given the evening to work on our CanSats. We managed to get the voltage regulator, EEPROMs and GPS chips working, much to our relief. Stephen (the school physics technician who was overseeing our project) explained about the De Broglie-Bohm interpretation of QM during a spare moment, then everyone except myself went to bed – I (along with the Spanish team as it transpired the following morning) pulled an all-nighter to get an EEPROM program working. At about 4am I got bored and climbed a very steep mountain next to the ARR and was rewarded with a truly spectacular view of a sunrise over distant mountains.
I took the Union Jack to the top of the world at 4am
Sunrise over Andoy - staggeringly beautiful
Microwave antenna at the ARR
Day 3 – the launch
I awoke when Stephen opened the door of the electronics workshop to find me sprawled across three office chairs with an enormous platter of crisps on the table – I think I might have dozed off for half an hour or so. The rest of the team entered soon after with my breakfast and we discovered a fault in the radio transmission board. Panicking, we grabbed spare boards from another team and NAROM, and Tim set about debugging a piece of electronics already scarred from months of resoldering. As it turned out, it was just a loose connection to the antenna.
The launch was at Skarsteinsdalen and on the bus ride there I had to do some emergency reprogramming to fix a small problem related to the EEPROMs. Being Paulines we forgot to bring the audio cable to connect the radio receiver to the laptops so ended up having to borrow one. We also discovered at this stage that our alkaline batteries would not survive 30 minutes of flight due to voltage drop (the Zener diode was also a less efficient regulator than the 3-pin one and wasted more power) so ended up having to borrow a lithium one (which retains the same voltage over its lifetime) from the Belgians. We tried to insulate the battery and warm it up to prolong its lifetime by first putting it under Jacob’s armpit then putting it in a bag and dipping it in hot Earl Grey tea!
Our launch!
The Intruder Rocket
During the actual launch the GPS chip, the most important one to our secondary mission, failed and we collected no GPS data. Our (in hindsight way too large) parachute, however, deployed beautifully (we had only worked out how to fold it the previous night and had never tested to check it would open) and thanks to the lack of wind, the thing landed 700 metres away, within the 800m competition limit. We ended up using nothing but accelerometer data to do some Euler’s Method enormously fudged ‘integration’ to get what looked like a decent wind profile and GPS trace. We even ended up having to solve a horrific second order non-linear differential equation to get wind speed as a function of acceleration and the CanSat’s ground speed using Wolfram Alpha (and linear programming to get the constants). We also created the second presentation to present our results.
Beautifully deployed parachute. Photo by Matthew Willetts
One other dramatic moment was when the rocket containing both the Spanish and Czech teams’ CanSats misfired – the first part of the fuel burnt, but owing to (presumably) some sort of blockage the fuel stopped burning for one or two seconds and by the time the CanSats were ejected the rocket had almost hit a mountain, and both teams got mere seconds of data. The Belgian team also blamed us (in jest) for their own lack of GPS data – their GPS stream stopped at the same time as when their accelerometer registered a spike, which corresponded with when our CanSat was dropped into the rocket on top of the Belgian one. We both eventually decided to (still in jest) blame ESA for not planning the thing properly and putting two GPS-enabled CanSats in the same rocket! Though we did feel a bit guilty afterwards.
By the end of the evening I had slept for 10 hours in the previous 72 and quite rapidly conked out.
Day 4 – presentations and result
Most people in the room seemed pretty impressed with our Google Earth and Visualiser visualisations and we managed to time it just right. We got a tour of the ARR and received a talk on NAROM:
All profit goes to organic growth
They have a student rocket programme in which the students take part in the entire operation of building a rocket, launching it to 9 km and analysing data.
They have cool projects like ANSAT and CubeSat
We were then sat back in the main conference room for the results. We were massively sleep-deprived and our best attempt at a joke was ‘the Irish are going to shame us’ which looked pretty likely when they announced the third and second places (the Belgians and the Irish respectively). And finally, first place: ‘we selected this team because they were well-organised and always calm’. It wasn’t us. ‘We have decided that the British team, Team Eclipse, have won the first ESA CanSats in Europe competition!‘ I was apparently too stunned to stand up for a couple of seconds… In the end every team won a well-deserved special award, including the tightest budget and the best outreach.
Wind profile visualisation
In the aftermath, for the first time everyone was free and available to socialise. We played a couple of games of Mafia, took photos and had a BBQ. The Spanish seemed to find my attempts at Spanish inexplicably amusing and I discovered that a member of the Spanish team had worked on a similar electronics problem that I had previously and talked with him for a while on that (in English) – apparently many of the other teams had been forced to take special English lessons for this competition. I found myself in the midst of the friendliest likeminded group of people I had ever met, and really started to enjoy myself.
We also took part in a local tradition of swimming in the Arctic sea – the cold shock made me feel numb and warm stepping out of the sea into the wind which was slightly concerning. The full routine was swim-sauna-cold shower-sauna-jog, and by the end of the evening I had had 16 hours of sleep in the previous 96, but was still feeling physically amazing and revived.
Swimming in the Arctic Ocean
Day 5 – whale safari
We started the morning by talking to a Norwegian reporter who described London as ‘too warm’ and to whom we said we would celebrate by ‘sleeping … a lot’. We (the UK and Belgian teams) went mountain climbing with the help of a map of a good route that I had drawn after my previous ascent. We even found a guest book near the top which we all proudly signed. We lunched rapidly and moved to some really quaint cabins (which reminded Matthew of Cape Cod) in Andenes where we were to spend the night. We bought plenty of spirits and beer (Norwegian Dahls beer is better than Budweiser in my opinion) and I grabbed myself a kilo of Brunost… The Norwegians told us that if you kill a crow, cut off its legs and hand it into the police, you’re entitled to 50 Kroner. When we asked them the reason for this strange law, they responded nonchalantly, ‘they steal our strawberries’.
Signing the mountain guest book
View of Andenes from the top of the mountain
The whale safari which we had signed up for followed. The journey out was probably the roughest journey I had ever had (with the exception of a couple of sailing outings I had previously done) and we sighted two sperm whales. We dined at Andenes’ former jail which had been turned into a restaurant, and ethical issues aside, medium rare whale meat is delicious. What followed was an evening of drink…
A sperm whale!
We found a flagpole. We had a flag...
My photography 'skills' really don't do the sunset justice
A precedent for what happened later...
Day 6 – journey back
We found our CanSat story in two local papers, though one of the published pictures featured us kneeling next to an upside-down union jack. Though considering the photo had been taken just after our launch and we had just discovered we had no GPS data, we were effectively in distress and the orientation was justified. On the way back, for the first time we were questioned about the CanSat at airport security (an aluminium cylinder with wires sticking out) which we explained by showing them the newspaper article! At an idle moment the Norwegians, whose travel itinerary followed us to Oslo, explained a little about their coinage – the 20K piece has the Norwegian king on it (Norway being one of very few countries in which the monarch has any real power), and the 200K note has a picture of the guy who discovered the science behind Aurora Borealis. We said our final goodbyes and took off for Heathrow Terminal 3.
Distressed Union Jack
On the way back the rayleigh scattering from the setting sun lit the clouds beautifully from above.
Concluding thoughts
We’d started off intending to win. Over the course of half a year, as we encountered setback after setback, made agonisingly slow and sometimes negative progress, and lost active team members, we discovered this project was a damn sight more difficult than we had originally anticipated, and morale fell to dangerous levels. We came to Norway with a tin can filled with smoking components and frayed multicore cables, hoping not to win but just to get some data of any sort. Cortisol levels reached personal lifetime highs for every one of our team members at the ARR, and sleep dep began to drive us literally and quite disturbingly delirious. Despite this, we won a European competition, made some amazing friends, took some great photos of the staggeringly beautiful scenery and learnt some lasting lessons. It’s been an amazing experience, and I owe the guys at the ARR, NAROM and ESA, as well as my teammates and everyone else who took part, my sincere gratitude.
The Team Eclipse Norway representatives. Top row: Jacob Ader, Matthew Willetts, Dr Stephen Patterson. Bottom row: Bryant Tan (myself), Tim Palmer. Photo by Dag Martin Nilsen from NAROM.
As a sort of follow-up to my last post, the guys at the Kennedy Space Centre astronaut training day did a demo of sodium polyacrylate (absorbs water, used in space toilets) – the demonstrator put a couple of teaspoons of the white powder into a 250ml beaker, filled it to ~250ml with water, held it while talking, then pretended to trip over and ‘spill’ it all over me! Of course it had solidified by then and stayed in the beaker, but it was such an impressive demo that I decided I had to try it out myself.
It’s a Super Absorbent Polymer (SAP) and can be found in nappies, and is also a component of slush powder, sold in magic shops. So I went to Davenports Magic Shop, a slightly dodgy looking place in the Charing Cross subway, bought a can of the stuff and tested it out.
It works best with pure water, but even one teaspoon can solidify a whole cup of Brita filtered tap water (standard activated carbon filter).
I’m back from an exhausting, exhilarating and grossly exercise-deficient 9-day trip to Florida. This was originally meant as a school physics trip (much like the ‘physics trip’ to Thorpe Park…) to see the penultimate shuttle launch. Sadly the launch was delayed to November, and the rocket launch that was supposed to have replaced the shuttle launch also didn’t happen in the end. Fortunately, it is very difficult to go to FL and get bored, so we had a pretty packed schedule. For me it was one heck of a trip for several reasons, but mainly because there were about 100 other like-minded secondary school students on the trip, and also because it was the first time I’ve been to the US since I was born (I left CA, where I was born, when I was a toddler so everything was new to me) In brief, and in pictures (click any pic to embiggen, or click here to see them all):
Scary
Day 0 – Flight in
We had dinner at Ponderosa, a buffet where, as Matthew put it, we ate so much that we became sad afterwards. Presumably a combination of feeling ill and sleepy, or some sort of shock from having eaten so much oil.
Sunset combined with the East Coast clouds is beautiful. The photo, taken through a double-glazed window, really doesn't do it justice at all.
Day 1 – Baseball, Beach
We were taken to watch a baseball match in the morning. It was something like the national U16′s baseball final, and I didn’t find it hugely entertaining; compared to cricket, the batsman seems to miss most of the time and I seem to remember points (runs?) were scored extremely infrequently.
This is a freakily timed shot - I think the ball itself appears between the legs of the fielder (!)
We spent the afternoon at Cocoa Beach. There wasn’t a trace of any oil, presumably because some poor team of people is paid to somehow keep it at bay by trawling, scraping or shovelling the black mess someplace else, so we got the famous golden sand + glistening ocean experience. Which was pretty cool :)
Pelicans sometimes dive-bomb the water to get fish. They're awesome that way.
Day 2 – Universal Studios
Florida’s famous for its theme parks, so we spent the day at Universal Studios. I was surprised by the amount of care, effort and cash pumped into the actual theming of the rides. I found the Simpsons ride unreasonably effective; it was effectively a glorified ’4D’ (I hate that name…) experience, but by adjusting the tilt and roll of the entire platform to provide a ‘g-force’ direction and having screen practically surrounding the riders (I’d say at least 2 pi steradians), some really incredible effects were achieved.
I can't remember this beast's name. But it was extremely fun, even though there were no inversions.
The universe revolves around me...
We dined at Hard Rock Cafe which was apparently really good, but some of us, me included, were still full at the time (burgers for lunch etc.) that we didn’t eat anything (dinner was ridiculously early; at 4:30)…
Day 3 – Kennedy Space Centre; Lunch with an Astronaut
We explored the KSC Visitor Centre in the morning and did the shuttle launch experience, which I thought was an impressively well-designed piece of kit; they even used the lumbar to give the impression of forward acceleration (relative to the rider’s frame of reference). We then had ‘lunch with an astronaut’ which actually just meant a really tasty lunch during which an astronaut appeared, gave a talk, took some questions and offered photo ops. I had the distinct impression he had been asked to dumb down his talk as much as possible – he answered almost all the questions as if reading from a simple.wikipedia.org page printed in Comic Sans. He did quote an equation which he claimed was related to Kepler but which we had never heard of before, and when we asked him about it he implied Kepler had derived it using linear regression on Tycho Brahe’s data, which could have described any of Kepler’s laws. I suspect it was derived from his laws and energy considerations but seeing as nobody could remember the equation afterwards I decided to drop the matter.
The VAB: the world's second largest building by volume, and it has its own weather...
Day 4 – KSC; Astronaut Training
I wasn’t really sure what to expect from this day but I was actually pretty pleased with how it all panned out. There were some great displays and tours including old space equipment with accompanying stories (corned beef springs to mind), there were live demonstrations of the heat-proofing tiling material used on the orbiter and the hygroscopic powder used in the space toilets (sodium polyacrylate). We did a role-playing exercise of operating the shuttle on a mission, and of course we each had goes in the astronaut gyro things. The organisers were friendly and I thought it was a thoroughly worthwhile day.
Day 5 – Free day at KSC
The centre is actually really massive, including up-close coach tours to the launch sites and the legendary VAB (the Vehicle Assembly Building, which is allegedly so big that rainclouds form inside it). We were told about the ‘twang’ (the brief tipping forward of the entire shuttle before takeoff when the main engines are turned on), the difference between the orbiter (the plane-like thing) and the shuttle (the entire orbiter + external tank + boosters system), and the stages of shuttle launch (which I honestly can’t remember. SRBSep [Solid Rocket Booster Separation] and ETSep [External Tank Separation] happen in that order, I think…), and even had wildlife pointed out to us (including a truly enormous bald eagle nest that’s been around for almost 50 years). Apparently there are something like 320 species of bird on the complex.
Full-scale model of the Saturn V rocket. It's MASSIVE!
Day 6 – Island Adventure Theme Park
More theme parks! All I’ll say is that Harry Potter Land was unbelievably crowded (45 mins queue to get into a shop), butterbeer tastes like Dr Pepper with a 0.5cm thick layer of vanilla cream on top, and Duelling Dragons is probably the most impressively designed ride I’ve ever been on – the timing and closeness of the near-collisions are truly incredible, and the density of twists and turns made me lose track of the true direction of ‘up’, which has never happened to me on any other ride (and I’ve been on quite a few).
The Hulk. Great ride, pulled some pretty big gs
Harry Potter Land - beautifully themed.
Day 7 – Airboating
Airboats are simply awesome vehicles. They are capable of going into (basically) a drift at top speed without the least bit of instability, and you stop by turning them 180° and turning up the fans while going backwards. We managed to snap a load of wildlife with some helpful pointers from the driver.
These go incredibly quickly and have scarily good stability. They're like hovercrafts, but *much* better.
You can just about see a bald eagle near the top right of the tree
I have no idea why this didn't blur or be focussed on the wrong thing (like my camera usually does)
We also visited the mall, which was almost entirely clothes, shoes, jewelry and food, as expected…
Miscellaneous Observations
Lots of the stuff I was told about the US and/or Florida actually turned out to be spectacularly true. The cars are, almost without exception, enormous. Most parking lots are easily 0.5m wider than in the UK. People are generally friendly, happy and Anglophilic (it was also the first time I’d come across a customs person who smiled at me). The food portions are ludicrous, leading to the unmitigated and undeniable crassulence of an alarming proportion of the people. And the skies are just beautiful.
A beautiful and bizarrely radiating-patterned sunset
For some reason there's something beautiful about the skies in Florida. Most of the time, every type of cloud, from cumulostratus to cumulonimbus to cirrus is represented.
P.S. Interestingly, I actually managed to lose 1 lb. Go figure.
According to Brainiac S01E03, cereal is magnetic. According to Wikipedia, iron is added to breakfast cereal as a dietary supplement in the form of elemental iron powder. I couldn’t resist trying it out for myself, and it’s true (see video below)!
Further, this iron can be extracted by grinding the cereal, adding the resultant powder to water to dissolve small saccharides etc that might be trapping the iron in the cereal, and then using a magnet to pick up particles of iron. Supposedly this iron reacts with HCl in the stomach to form soluble iron salts that can be absorbed into the body.
I’m about to sit my last ever batch of secondary school exams (A2 modules), so it’s past paper season and a rant is called for.
In fact, I’m generally happy with the exams that we’re sitting. The Maths syllabus and exams are interesting and cover extremely useful and interesting topics, particularly differential equations and a massive amount of Newtonian mechanics, with some quasi-Lagrangian stuff thrown in at M4; my only major qualms are that the course is weak on linear algebra (a personal interest) and contains nothing on vector calculus, an enormous topic which would have been enormously useful for getting a handle on understanding the extra-curricular physics and fluid dynamics we were shown in lessons (rather than just commenting on the shapes of the symbols). Most importantly the exams do the subject justice; for the further maths modules, it is necessary to be proficient at the subject to do well, which, from my experience so far, for UK exams based on the national curriculum, is almost unique. And of course there’s always STEP which I fail at due to lack of ability rather than lack of exam technique which suggests it’s a good exam.
Physics and computing are similar; the exams are mathematical, quantitative and logical in nature, requiring few wordy answers, of which almost all are worth few marks and have entirely reasonable mark schemes. Though CAPS has been giving us questions from past A level and Oxbridge physics papers throughout the year, and not only are the questions from those demanding – both mathematically and conceptually – but they are also genuinely interesting and by doing them, candidates develop a deep understanding of aspects of some of the topics involved; the rainbow made beautiful in the style of Lilley’s ‘Discovering Relativity for Yourself’ – through working out the answers to a series of exquisitely well-thought-out questions. The current physics exams are almost entirely uninteresting slogs in comparison, though still good.
And now we come to chemistry, and the body of my rant. Perhaps I’m simply biased because I’m not a good chemist in the first place (or at least I’m even worse at chemistry than I am at all my other subjects). Or maybe I just want to blame the fact that I scored a low B on both chemistry mocks on something (which is by today’s standards terrible; according to CAPS last time a C was a perfectly respectable grade owing to the difficulty of the exams). Either way, I maintain that it isn’t entirely my fault that my marks are atrocious (though I concede that it is to a large extent).
It’s an old and possibly overused complaint that mark schemes / exams are badly written, and is consequently often taken lightly. Unfortunately I really do think think it’s gotten to such a stage that the Monster Raving Loony Party’s idea about education wouldn’t be that much worse than how it is currently: “It is proposed that, before the beginning of exams, the exam board will select a certain obscure phrase which will be kept secret. If any pupil inadvertently writes this phrase in any exam, he/she will automatically receive straight A* grades, and a free teddy.”
I’ll cite what I think are some of the worst examples of chemistry exam madness:
1. The mark scheme insisted that one E0 value was ‘more positive than’ another, but specifically rejected ‘greater than’.
2. To obtain the mark for one question, it was necessary to specify movement of *electron* lone pairs, not just lone pairs. Though personally I’ve never heard of lone pairs of anything other than electrons in any context.
3. The ‘Quality of Written Communication’ (QWC) mark is normally awarded for writing ‘two complete sentences’. But if you write a single long complicated sentence containing many subclauses with impeccable grammar that conveys meaning effectively and efficiently, you wouldn’t get that mark. Also, why on earth is grammar being tested in a chemistry exam? And more importantly, why does the government (or whoever it is whose fault this is) deem it necessary to test the ability of 18 year olds to construct cogent sentences!? (I admit my proficiency at written and spoken English is evidently imperfect but even the stuff I write makes sense. Doesn’t it? DOESN’T IT?)
4. Displayed formulae. Nobody uses them. Ever. Everything is skeletal. Also, the OH group is a single atom and should always be depicted as one…
5. Questions like “Discuss isomerism in complex ions” for 12 marks. They invariably have a really tight accompanying mark scheme with exactly 12 scoring points. One could conceivably (and entirely legitimately given the vagueness of the question) write an engaging paper on group theory or electronic orbitals in response and only receive the single QWC mark…
Allow me at this stage to cite Bill Watterson.
This image was taken from a fantastic blog post which more or less summarises why I love Calvin & Hobbes. Anyways, suffice it say Calvin’s words, “You’ve taught me nothing except how to cynically manipulate the system”, form an accurate representation of the national curriculum: learn answers to questions, rather than be educated.
But maybe all this is good preparation for the real world after all. Today I sat the ‘Life in the UK test’, one of the critical stages on the way to becoming a British citizen (apparently wearing tweed, drinking G&T and occasional Scottish dancing isn’t enough; trust me, I asked), for which I had to study (read: flick through Schott’s half an hour before leaving). And it can mostly be frankly and truthfully summarised as b/s: memorising dates (e.g. the precise year women were first allowed to divorce their husbands [1857 or something]), statistics and numbers (some of which as obscure and inconsequential as the percentage of Christians in the UK who are Roman Catholic [10%], some of which are required to be known to an unreasonable degree of accuracy such as the percentage of the UK’s population that is Muslim to 2sf [2.7% as of a few years ago, probably now different], and some of which don’t even make sense such as the coastline of Britain [infinite by my {and Mandelbrot's} reckoning but that wasn't an option]), and mundane facts (e.g. that 1941 was the only year the UK didn’t have a census). They might as well have asked ‘who put Gordon with the bigoted woman?’ [definitely Sue]. There was also what might be described as ‘jack all’ about geography, particularly mountains and weather, information which I personally consider much more central to Britain than the ethnicity of the bus drivers employed in the 1950′s [West Indies and Carribbean] (or even important things like the number of seats in the Commons).
So it seems that even after the horrors of OCR (“Recognising Achievement”) are over, life continues to be dominated by ‘cynically manipulating the system’; learning useless facts or effecting pointless tasks to satisfy some criterion for something really important. I guess that’s just what life is about and I’ll have to learn to live with it, willingly or not; if you can’t fight it, join it. Sucks to be human…
Anyways, rant over, and it’ll probably be the last before the end of June when my exams end…
It’s been a pretty epic weekend. Keeping it brief:
Friday: Journey to Cambridge
I actually went up with a friend who was going to the Informatics Olympiad (BIO2) to which I had been invited but clashed (to the hour) with the chemistry one – I chose chemistry as I did BIO2 last year and sought variety. After my customary meal at Wagamama I dropped my stuff at St Cats (where BChO2 was to be held) and started wandering round Cambridge. When I got back I met up with some of the people from last Summer’s training week who had made it to round 2 this year. We were all standing around in a circle when the inevitable titration jokes started <- actually true ;)
All 20 of us were taken out to dinner at Pizza Express by the olympiad committee (which itself consisted of over 10 members), an event which lasted about four hours due to slowness of cooking / service (…) but was great fun. We planned the pub trip for the next day and went to bed with the knowledge that we would wake up to six hours of chemistry.
A curious tradition of the olympiad, enforced to prevent bias, is for each person to be randomly assigned an element as a pseudonym and for us to use those throughout the competition for written work. I was Phosphorus, which I think I might have spelt wrong…
Saturday: The hardest exam I have done / will ever do
There was a practical exam in the morning which I had been dreading slightly owing to my invariably highly chaotic past lab experiences. As it turns out there was nothing impossibly demanding that we had to do and I managed not to emerge awash with pyridine / phenol / some other nasty reagent, and we all did a TLC, learning on the job, which was completely new to me and cool to do; they seemed to like my TLC plate (woo!). I was really impressed with the facilities (in comparison to St Paul’s anyways – to me having a fume hood each is a luxury) though it was impossible to tap whiz the burettes (an invention of NAL: turning the burette tap 180° letting through about 0.5 cm3)! I even managed to get excited about the pipette fillers (get me…) – squeezy rubber things that suck automatically with virtually no effort on the experimentalist’s part, rather than the really annoying cylindrical plastic ones we get at school that you have to crank with your thumb and never work / fit. It was also the first time I’d ever worn a lab coat.
We had been promised that we would sit a particularly difficult theoretical paper, and it was revealed just before we started that it was in fact the hardest paper they had ever set. Being the worst organic chemist you’ll ever meet, I think I just about managed to get through the ones that would have looked plausible in a physics paper and drew some structures for the organic questions that would certainly have made my teachers cry from despair (if not laughter)…
Walking dazedly through the streets of Cambridge and making conscious and desperate attempts not to talk about anything related to electron movement, we filed into a pub. At some point there was a formal dinner where we each got a glass of each of three different wines, including a rather exquisite dessert wine which was discussed in great detail in terms of aldehydes, esters and hexane (…)
The rest of the evening can probably be found on Facebook.
Chemists are good fun
Sunday: The aftermath
We basically got sat in a room after breakfast, got given goodie bags (including RSC Sigg bottles, a book of Chemistry cryptic crosswords, scientist-shaped memory sticks, safety specs, and a T-shirt) and certificates, and the team was announced. Congrats to those who got in, especially to David Edey for having got through while still in the year below!
It goes without saying that I didn’t get through, but it was an enjoyable weekend and I met some awesome people (who I will be seeing next year)!
The Further Maths syllabus incorporates group theory, a fairly useful but abstract concept. It’s all very interesting and somewhat reminiscent of our semi-formal introduction to set theory and functions with GL last year. Unfortunately, interesting as groups may be, exam questions can ask you to fill out a group table, a task whose tedium is comparable with plotting graphs with pen and paper. While completing a group table in class, after remarking that it’s somewhat similar to doing a SuDoku (each element appears exactly once in each column and row), I pointed out writing a computer program to do this would be interesting and much more fulfilling than bashing through a group table completion. And that’s exactly what I did.
The code is fairly self-explanatory but probably full of bad habits and other rubbish; the only reason I’m making a blog post about it is because it’s the first time I’ve ever implemented (albeit quite messily) a Breadth-First-Search-type algorithm for a vaguely realistic problem, making it particularly interesting (to me).
The algorithm for finding the value for a cell (derived from elements i and j, e.g. ij if the group is multiplicative) is basically this, in really loose structured English:
Concatenate i, j. Call this concatenation c.
Look up if c is an element of the group.
If so, done.
Set c as the table’s value at (i,j).
Else: Add this expression to a previously empty list.
Repeatedly:
For each expression in the list:
Find character sequences which can be simplified by examining the existing table
For each of these simplifications
Add the mono-simplified expression (simplified once) to the end of the list
If this simplification is an element of the group, we’re done.
Remove the expression from the list
In other words the simplification algorithm systematically takes the expression, finds lots of equivalent expressions (by looking up simplifications in the half-completed group table) and chooses the equivalent expression that happens to be an element of the group. This obviously requires closure, or the algorithm will keep searching forever and never complete. For this reason I implemented a counter-measure to infinite runtime – it’s a bit of a hack but hey…
The program prompts for input. The first line is N, the number of elements in the group. The next N lines are string representations of the elements, e.g. a, aa, ab, bba etc. The next N^2 lines are the existing table – the program needs something to start with to simplify anything.
Here’s my example test data:
6
e
a
aa
b
ab
aab
e
a
aa
b
ab
aab
a
-
e
aab
-
-
aa
e
-
ab
-
-
b
-
-
e
-
-
ab
-
-
-
-
-
aab
-
-
-
-
-
This represents the following group table:
e a aa b ab aab
a - e aab - -
aa e - ab - -
b - - e - -
ab - - - - -
aab - - - - -
The program’s output is:
e a aa b ab aab
a aa e aab b ab
aa e a ab aab b
b ab aab e a aa
ab aab b aa e a
aab b ab a aa e
Incidentally this is (hopefully) the answer to one of the questions set for this week’s homework.
Here’s the C#.NET code:
using System;
using System.Collections;
using System.Linq;
using System.Text;
namespace Groups
{
class Program
{
public static string[] elements;
public static int[,] table;
public static int N;
public static int depth;
public static ArrayList simplifications = new ArrayList();
static void Main(string[] args)
{
Console.WriteLine("Size of group");
N = Convert.ToInt32(Console.ReadLine());
elements = new string[N];
Console.WriteLine("Group elements");
for (int n = 0; n < N; n++) elements[n] = Console.ReadLine();
table = new int[N,N];
Console.WriteLine("Existing group table:");
for (int j = 0; j < N; j++)
{
Console.WriteLine("row " + j.ToString());
for (int i = 0; i < N; i++)
table[i, j] = str2index(Console.ReadLine());
}
PrintTable();
while (true)
{
Console.ReadKey();
FillTable();
PrintTable();
}
}
public static void PrintTable()
{
for (int j = 0; j < N; j++)
{
Console.WriteLine();
for (int i = 0; i < N; i++)
{
if (table[i, j] == -1) Console.Write("- ");
else
{
Console.Write(elements[table[i, j]]);
for (int a = 0; a < 4 - elements[table[i, j]].ToString().Length; a++) Console.Write(" ");
}
}
}
Console.WriteLine();
}
public static void FillTable()
{
// for each thing:
// concatenate strings
// look up if concatenation is an element. If so, done.
// else look up from table if part of concatenation simplifies.
// search through all simplifications until one which is an elment is found
for (int i = 0; i < N; i++)
{
Console.WriteLine("now doing row " + i);
for (int j = 0; j < N; j++)
{
if (table[i, j] == -1)
{
string s = elements[i] + elements[j];
if (str2index(s) != -1)
{
table[i, j] = str2index(s);
}
else
{
simplifications = new ArrayList();
simplifications.Add(s);
depth = 0;
Simplify();
table[i, j] = str2index((string)simplifications[0]);
}
}
}
}
}
/// <summary>
/// Simplifies the single element in simplifications.
/// When done, will leave a single element simplifications[0] in simplifications.
/// That will be the simplified string, which is hopefully an element.
/// Told you it's a messy implementation
/// </summary>
public static void Simplify()
{
depth++;
if (depth > 20 || simplifications.Count > 1000)
{
simplifications = new ArrayList();
simplifications.Add("-");
return;
}
int origsize = simplifications.Count;
Console.WriteLine(origsize);
string ret = "!";
for (int q=0; q<origsize; q++)
{
string[] simps = simplify((string)simplifications[q]);
foreach (string t in simps)
if (str2index(t) != -1) ret = t;
foreach (string t in simps)
{
if (!simplifications.Contains(t)) simplifications.Add(t);
}
}
for (int a = 0; a < origsize; a++) simplifications.RemoveAt(0);
if (ret != "!")
{
simplifications = new ArrayList();
simplifications.Add(ret);
}
else Simplify();
}
/// <summary>
/// Finds all single-step simplifications of a string
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static string[] simplify(string s)
{
string[] ret = new string[1000];
int n = 0;
for (int startat = 0; startat < s.Length - 1; startat++)
{
for (int a = 0; a < N; a++) // first element
{
if (s.Length >= startat + elements[a].Length)
{
if (s.Substring(startat, elements[a].Length) == elements[a])
{
for (int b = 0; b < N; b++) // second element
{
if (s.Length >= startat + elements[a].Length + elements[b].Length)
{
if (s.Substring(startat + elements[a].Length, elements[b].Length) == elements[b])
{
if (table[a, b] != -1)
{
ret[n++] = s.Substring(0, startat) + elements[table[a, b]] + s.Substring(startat + elements[a].Length + elements[b].Length);
}
}
}
}
}
}
}
}
string[] realret = new string[n];
for (int a = 0; a < n; a++) realret[a] = ret[a];
return realret;
}
public static int str2index(string str)
{
for (int a=0; a<elements.Length; a++)
{
if (elements[a] == str) return a;
}
return -1;
}
}
}
At the moment, thanks to the post-university interviews honeymoon, I’m involved in some cool projects I’d like to write a bit about.
ESA European CanSat Competition
This is a very interesting competition organised by the European Space Agency and is quite likely the biggest scientific project I have ever undertaken. In brief, each team (consisting of 10 members) has to design a ‘satellite’ (mislabelled in my opinion for this competition) that can perform some interesting and/or useful scientific experiment when dropped from a height of 1km. There are lots of requirements/restrictions, e.g. everything has to fit into a european soda can (hence ‘cansat’) and the budget is limited to 1K Euros (more details here). Needless to say this is immensely exciting for us; we are representing the UK in a massive engineering competition, and are one of only 12 teams in Europe to be chosen to go through with the construction and launch of this thing (at Andøya, in the Arctic Circle on the Norwegian island of Andenes, to which some of our team members will be going[!!]).
Our idea is for our cansat to act as a dropsonde – it will take data which would allow the construction of a wind profile of the descent to enable precise placement of a hypothetical second payload (an idea we got from one of the talks at the Aerospace Competition finals last summer). We have a blog and more details will emerge as time passes (a press release is in the pipeline). You can also follow @cansat_eclipse. We’re also using Google Wave for coordination :)
Homeopathy Investigation
My attention was drawn recently to the 1023 Campaign, a campaign aimed at bringing to public attention the reality of homeopathy: that as far as science is concerned, it’s just water, and apart from the placebo effect is as good at curing diseases as cistern water (which, famously, is potable). As the St Paul’s Sceptical Society, a group of us decided to take part in the 1023 event, a mass homeopathic ‘overdose’ to demonstrate confidence that there’s literally nothing in it. As Paulines we of course missed the date, but instead are planning a serious double-blind test involving pseudo-random number generators and proper statistical analysis and planning to investigate the effect of homeopathic coffee on drowsiness. We wanted to do a Wilcoxon test but we think in the end we’ll just go for a t distribution based investigation, which assumes a normal distribution but seems to be well-respected in the scientific world. This is an important project for me since it will be the first real scientific investigation I’ve been involved in, and especially since it’s both topical and sceptical in nature, I’m looking forward to seeing some results.
UniversityInterviews.com
This project started some time ago but I never got round to blogging about it. When the university interview madness began last term, a friend and I had the idea of building a site for people to share their interview experiences, and this is the result. I’m quite pleased with what we’ve made and I hope to see it being well-used in years to come.
For some reason from the moment I heard of it, I’ve really loved the game of Complex Hearts. It’s not even that mathematical by nature–you just have to keep track of two sets of scores–but the idea of casually saying “I have -4 + 13i points” makes it an awesome game to play. So I wrote an AI for it. It’s one of the most complex (this will never get old) things I’ve ever written and it feels like a great achievement (until it epically fails against humans), so I thought I’d say something about it. It was written in C#, OOP is fairly central to its inner workings, and it uses just the four standard libraries for C# console apps (System, System.Collections.Generic, System.Linq [I did actually use Linq believe it or not. Sorting a list by value], System.Text) – I got by without using a single ArrayList!
Principles of operation
The program hinges around this single critical function GetExpectedScore(…), which attempts to determine the expected score one would accumulate after that trick if a certain card (c) is played. It’s the largest function in the program, and produces some rather convincing results. It looks at each player (p) in turn and attempts to sum the expected accumulated score from each. It does this by getting a list of point cards below the value of c, finding the probability that p has card c, arranging the point cards in order of point magnitude, then finally summing points*probabilities. It sums points by assuming each player will play the highest point card he can without winning the trick (i.e. dump the most painful card he can on you), and takes into account probabilities of being void, so there’s a sort of cascade going on. Letting P(c) be the probability p has card c, N(n) be the nth most painful card playable by p and V(n) be the score given by the nth most painful card:
The program sort of has two hearts, a bit like The Doctor. The first (over 200 lines) is two custom types: each player is an object, and, more importantly, the game itself is an object. This allows a trivially easy-to-implement and foolproof undo function, as well as the ability to create a duplicate game for the sake of simulations. This also includes a really primitive function for attempting to assign probabilities to players having cards (see screenshot below). It appears to be sufficient.
The second is about 350 lines of code enclosed in a region aptly labelled ‘clever stuff’. This is where the interesting functions which determine the best card to play, or the best cards to pass, all of which make use of GetExpectedScore (which itself is in this region). The best card to play is the one that has the lowest expected score determined by GetExpectedScore, and the best cards to pass are those with the highest expected scores. These tend to be high hearts, and spades of value above and including the queen.
User interface
I love console programs, and I don’t think I could have made a better UI for this using a Windows form. It’s all nicely colour coded: cyan for ‘info’, yellow for ‘notice’, red for ‘important’, green for ‘question’ and gray for ‘debug’. I even wrote a procedure to print each player’s table of card probabilities:
Click to embiggen.
Seems to work
I’ve test run it a couple of times with actual games, though personally playing the other three players slightly invalidates the testing! The AI seems to make good decisions and appears surprisingly good at not picking up points, hence doing pretty well for itself in my opinion! Apart from some interesting encounters involving code that looks like it was written while drunk (my code is normally pretty terrible) and functions I defined but never finished coding resulting in very strange happenings (“just make it return ’1′ for now, I’ll code it later”), I’ve needed to add minor caveats here and there, such as taking into account the cards currently on the table when evaluating the probability of winning the trick and the points currently on the table when evaluating the expected score from winning that trick, and taking into account the player’s current score when deciding which card to play.
Test run. The two previous players have played the Ace of Spades (AS) followed by the Queen of Spades (QS). The player has two spades from which to choose (JS and KS). The AI recognises that although KS beats QS, potentially winning unwanted points, it realises any spade played will be beaten by AS with probability 1, so the expected accrued score from each card is 0 + 0i.
Limitations
The AI doesn’t know about shooting, or, more importantly, the existence of the 10 of clubs. I really don’t know how to incorporate that into the current structure which is a real pity considering that’s in a way the entire point of having complex scoring (otherwise you’d just have two separate sets of scores to keep track of which have nothing to do with each other). I have yet to code in the rule about breaking hearts, though it’s pretty unlikely to lead with hearts anyway considering that would tend to result in picking up points (unless you play 2H or something). It is also extremely defensive: it assumes every other player is attempting to screw it over, and consequently doesn’t bother trying to screw other players over at all. Perhaps I should include a constant that decides the aggressiveness of the program – the AI will choose to play the card that most screws over another player (c) provided that c’s expected score is no higher than a certain value, or no higher than a certain fraction of c’s value, or something. Additionally, the algo for working out expected scores is actually wrong – it makes an underestimate because it doesn’t use Bayes’ Theorem (though it’s still quite good). I should implement an improvement soon.