Monthly Archives: March 2014

General

Speed...

I'd never really given speed a lot of thought when coding my Mathematica notebooks, but after recently attending a seminar I think it's something I need to spend some time thinking about.  My sheets are normally fairly trivial in comparison to some of the large banking house notebooks that run, but what I was interested to hear was that some of the sheets being run take over 6 hours from the other delegates.  That's a long time to wait to see if your numbers are rubbish.

Also what was interesting was that the presenter spends a lot of his time making other people's code work faster, essentially that's the core of his consultancy business.  Some speed improvements were up to 912% faster.

So a 6 hour sheets would potentially run in less than 30 seconds.  Which is a hell of a lot faster and lets you run various scenarios in a day rather than one a day.

One simple thing that I took away from all of this is if I'm only interested in numerical results rather than symbolic, then I need to think carefully about the level of precision I require.

For example using the /AbsoluteTiming flag you can do a simple test to see the difference that the level of precision makes.  By simply adding a decimal point to the number 2 it will convert to machine level precision.

Gives a timing of 0.283438 seconds on my machine.  Simply adding a decimal place to the number 2 gives a significant speed jump.

Gives a timing of 0.000293 seconds, which is a massive shift in computation time.

Something to consider.

Tutorial

Rotations...

In a previous post I showed how complex numbers are useful when rotating co-ordinates and since then I've hard coded several geometrical translation and rotation routines that have been crude, but functional in Mathematica.  Nothing too complex, but a nice little achievement, working with matrices and manipulations.

But the scary thing about a big program like Mathematica, is that it has lots of built in functions that whilst incredibly well documented, you have to be aware that they exist before you can start to search for them.

The transformation matrices scripted above, can be automated using some of the inbuilt functions in Mathematica 9.  So for example if I wanted to rotate some co-ordinates about the z-axis the syntax is quite straightforward and can be taken from the documentation.  Rotating 4 co-ordinates (a) around the z axis (b) to give the newly updated co-ordinates (c).

There are quite a few neat and compact examples over on the documentation website if you're interested.

I personally struggle with Mathematica at times, not because the documentation is poor, but because the scope is so vast.  But with helpful sites such as Stack Exchange or the Wolfram Community Page I'm sure I'll start to work my way through some of the more hardcore functions given time.

General

Annual report...

Last year I created an annual report to help me reflect on the year and determine what it is that I need to keep the same, change, eliminate, or get counselling from to recover.  I found it a really helpful process so I'm going to try and make it an annual event even though I'm a little late with it this year.

1 What are your biggest accomplishments this year?

Last year I've achieved quite a few things that I wanted to, plus a few nice surprises.

  • I was nominated for an NUS teaching award by one of my students, this means an awful lot to me as it shows I'm appreciated and genuinely making a difference.  Plus I got a mug and some free food!
  • I won the Vice Chancellor's Teaching Excellence Award.
  • I passed my interim assessment on my PhD, although I'm still not sure how.
  • We moved into our new family home and got ourselves established after a much harder build than we expected.
  • I turned 40... quite a few of my friends I grew up with never made it this far. I feel blessed.

2 What are the biggest lessons you’ve learned this year?

I'm a dreadful communicator.  I can sing, dance, argue the point about the most complex of subjects, but I'm rubbish at talking about how I'm feeling, particularly if I'm feeling negative, tired, upset, or worried.  I've plenty of friends who'd let me bash their ears if needed, but I choose not to, I bottle it up, burn out, creak along until I fall over.

177:365 - FBE...

I've been surrounded a lot by serious illness this year, from close family, friends, work colleagues, students... and I've got to admit it's been pretty scary.  There's been times where I've genuinely feared for those I hold dearest and panicked that there's about to be a big hole in my life, I need to let these people know more often how much they mean to me, I've learned that life is fragile and precious.

3 With a grade, how satisfied are you with how you spent the year? Why?

I'd struggle to give this a universal grade.  I'm made up with the new house, it's given us a lot of space and we can have friends round for parties and food which has helped us strengthen relationships with friends and have visitors stay for catch ups, this has really contributed to life quality in a positive way.  The glass is definitely half full...

148:365 - Glass half empty?..

As always there are parts of work I love, parts I'd prefer to have surgically removed, but I attended graduation for the first time last year and I really enjoyed seeing my students graduate, which bearing in mind I didn't want to go to my own graduation is quite something.  It was also nice that we went for a few beers with our students afterwards and I think they liked seeing that we're human too... we think a lot of our students, but sometimes feel we have to maintain a bit of distance.  I'm not sure we've got the balance always right.

I think on the whole I'd give the year a B, because I need to gain more balance between home and work and find some collaborators for my research to work with, but on the whole I'm satisfied.

4 What do you want to accomplish next year, such that it’s your best year ever?

  • I want to learn to relax.
  • I want to make progress on my PhD and I want to build a team around my research.
  • I want to survive my chairmanship with the IStructE in one piece.
  • I want to be more anarchic and chaotic in my thinking and behaviour, I want to challenge convention.
  • I want to surround myself with more brilliant people, to collaborate, contribute, relish....
  • I want to grow.

5 What new habits to cultivate that will help you to achieve your goals in Q4?

I hope to identify better places to work, either through sharing an office space with someone, getting a study buddy to work with or perhaps just working from home more often with a colleague/friend.  I really want to immerse myself in research the coming year, but would work better if I had someone to immerse myself with in the topic.

I intend to chill out a little more, I work far too many hours on too many different roles this sometimes results in me spreading myself too thinly.   More concerts, more beer, more silliness, more doing nothing from time to time...

Untitled

Once my chairmanship is up with the IStructE I am seriously considering walking away from several positions to free up time.  I've learned enough about roles to support/coach/mentor future graduates and I've no intention of pushing for a senior position.  I would like to become a Fellow of the Royal Society or the Royal Academy of Engineering, but I can't see that happening as I'm not linked to either institution and you're nominated for membership.

I will be more anarchic, I'm intending that this will be my last full calendar year as an academic (I plan to leave in 18 months time) and so before I leave I will challenge the system and try and leave a positive mark.  However, if I build a good research team around me with PhD students I genuinely could see me extending my timescale, or sharing myself between academia and an industrial role.  I will try my hardest to not become a passenger, I will be different, I will make a difference...

206:365 - Feeling blue...

6 What are your immediate next steps to achieve these goals?

I will make more time to spend time with the family, this year we started playing board games with the kids and going out for walks.  I just need to try and protect more time to head out with my wife.

Last year I said I'd start growing plants and baking with the kids.... the baking part took off and I learned a few basic recipes and even taught my daughter how to use the electric whisk.  I need to do more of this.

Untitled

I will grow, with purpose, focus, and a mohawk...

 

General

Difference...

Since moving into academia three years ago, I don't think that a week goes by when one of my students doesn't humble me or make me appreciate just how lucky I am.  A few of my students recently have commented that I treat them as equals and peers and they like this.  But in all honesty I don't think I make a conscious effort to, I just enjoy working with people who are enthusiastic about my subjects, regardless of if they're a student, engineer, lecturer, layman, or even a professor.... well maybe not a professor, everyone has limits.  I just enjoy working with people who are prepared to step through the gate and share with me...
221:365 - Plas Newydd...
Last week a student asked me to proof read their personal statement for a PhD application and the words they'd written about the support I'd given them and how much of a difference it made to their outlook on education stopped me dead in my tracks.  I'm rarely lost for words, but it took me a minute or two to compose myself, even though I know the student is grateful for all the help they receive, seeing it in writing was humbling and almost gave me a bit of a wobble.  What I didn't realise is that two years ago they'd have happily walked away from their degree if they'd been offered a job, but with a little support and the right topic for their dissertation, they now enjoy their subject enough to want to take on a PhD in the same area.

This week we've had one of our current students talk to 40 prospective students about how his level of maths skills upon leaving school meant that they couldn't understand simple fractions, but through the support of the foundation degree and the additional Math-Scope sessions we run they now regularly score in the 80's and 90's in maths phase tests at degree level.  They were brimming with praise and pride about what they have achieved, and quite rightly so.  One of the mum's even offered to adopt him she thought he was so inspirational...

And that's before all of the trials and tribulations that some of the students face to simply allow them to attend the course, fund the course, keep up to speed with the work.  Personally I don't think I'd have the resolve to deal with some of the issues that these students take on at my age, let alone in my early twenties.  I am in awe at their get up and go attitude and it's the perfect tonic for when I need to give myself the 'man up princess' pep talk.

For all the crap that comes with life as an academic, it's these special people and moments that make it all totally worthwhile, it's this that keeps me teaching in all honesty and it's the pride I feel for my students that has stopped me jumping back to industry on several occasions.  Because the secret is; the lecturers probably learn just as much from the students as they do from us.

If you're thinking of becoming an academic, brace yourself to be humbled regularly and get used to the odd damp eye.  There are a lot of very special and amazing students out there, all you have to do is remember that they're people too.