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.

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...

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...

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...

## 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.

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...

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.

General

## Mathematica Valentines...

Sharing the love through Mathematica... even equations can be beautiful.

How to plot a love heart using maths.

Taken from here.

Teaching

## Mentoring...

Ever since I graduated I’ve always wanted to learn new things and for that reason I’ve pretty much always had at least three different types books on the go at any given time.  Typically I have a fiction book to read when my brain is really tired, a technical book linked to engineering, maths, or programming, and some sort of self-improvement book.   I want to be the best I can be, to reach my full potential and not be limited by my lack of understanding.

Over the past few years I’ve been spending quite a bit of time thinking about how mentoring (and what I believe to be the lack of) is affecting the environment for modern graduates in industry.  As margins become tighter and tighter in industry, the experienced engineers have less and less wriggle room to spend mentoring graduates.  Instead the experienced engineers merely push the less-experienced engineers to a quick solution so that deadlines are met and fee structures are not blown – resulting in a shallow learning experience.

I’ve always tried to make time to help less experienced engineers understand new concepts, even if I think they should know them already from University.  This has meant frequently giving up my dinner hour and time after work to help someone understand a new concept.  I’ve not always been successful and that’s a limitation of my skill and something that I’m getting better at with time as I improve as a mentor, but as time goes by I wonder if my approach is mentoring or coaching?

Most of the time I spend on a 1 to 1 basis with students takes the form of conversations and specific questioning to change the way they think about things.  To change or reinforce their perceptions about how something can be improved in the future.  This is the commonest form of mentoring that I’ve taken over the years, but through what I’ve read of Starr (2010) this approach isn’t mentoring at all, it’s more like coaching.  It’s essentially a series of conversations to help change a future outcome.  One of the favourite activities I teach is the supervision of dissertations, this is the module I can see the biggest leap in a student’s abilities, particularly with regards critical thinking and it presents the biggest opportunity that I get to mentor and build a connection with the students.  It’s the one area that probably sucks a disproportionate amount of time out of my week but it’s definitely where my mojo (Goldsmith, 2010, p17) lies when I’m teaching.

It’s this connection with the students and their topics I think that I enjoy the most, especially as I watch them grow and I still get emails and calls from some of the students that I supervised a few years ago simply so they can let me know what they’re up to.  Of course quite a few students only get in touch when they’re chasing a reference or contacting me because they want something from me but when someone drops you a note to say hi or let you know what they’re up to now without wanting anything from you it's personally very rewarding and it’s this type of contact that I treasure as it’s then that you know you’ve made a real impact on someone’s perspective on life.

Dissertations are also one of the key activities that is keeping me in academia, as it’s giving me an opportunity to continually learn and grow on a personal level although the longer I stay in academia the lower my career progression opportunities and the lower my earning potential become…. Perhaps Robert Greene (2012) is right, when looking back on my life nobody will remember the wonderful report I sacrificed weekends and evenings to complete, but perhaps they’ll remember the time I gave them to help improve their critical thinking skills and understanding of structural behaviour and I know my kids will hopefully appreciate the time we have together now I’m no longer being continually shipped out all over the place to design buildings.

After all I’ve changed quite a few skylines around the world when I had a proper job, maybe there’s more satisfaction to be had creating brilliant engineers to create even more radical designs.  Or perhaps there's a compromise to be had by spending some of my time teaching and another chunk of my time working with brilliant engineers and architects to design really radical and life-changing designs... I think this could be where my future lies in all honesty, it's about time I seized the steering wheel again as these things don't happen by themselves.

References.

Goldsmith, M. (2010). Mojo. London: Profile Books.

Greene, R. (2012). Mastery. London: Profile Books.

Starr, J. (2010). The Coaching Manual (Third ed.). London: Pearson Business.

Tutorial

## ROBOT....

The analysis software of choice at the University is ANSYS and whilst it is a very powerful piece of software it can be a little overwhelming at times for students who are starting to learn how to analyse structures.  Whilst we start them on hand techniques such as moment distribution and then through to matrix methods combined with using LinPRO there's a bit of a jump from those into full blown finite element packages.  One of the good things about being an academic again is that I get access to free copies to all of the AutoDesk software and so I've been giving ROBOT Structural Analysis a whirl to see how I get on.

I've not really used this software in anger yet, but it's comparable to many of the alternative offerings out there that I've used over the years such as QSE, Masterseries, GSA, and SFrame to name a few.  Whilst LinPRO is only 2D, ROBOT brings in the extra dimension to allow 3D frames to be analysed, and importantly for me and the dissertation topics that I offer, it also has the capacity to deal with cables and tension only elements and its this aspect rather than the building modelling that I've been really interested in for the last couple of days.  I started by modelling a simple guyed mast just to see how well it was behaved under dead and live loads.  A nice simple model like this has let me mess about with the different ways of controlling the cable tensions and seeing how the various settings in the analysis engines and element releases work.

After spending a little time getting my head around the releases, for some reason a local x axis restraint doesn't stop the mast spinning with a fixed base, so I had to throw a Global Z restraint to get it to analyse with no warnings...  as a newbie to the software, I'm sure I was probably doing something wrong, but it's all about learning and so there's nothing to beat myself up about.  I was able to get a pretty simple model up and running that seems to be fairly well behaved after about 10 minutes of tinkering which gives an idea of the learning curve involved.

There's a couple of forum posts knocking about that discuss where people have had errors with getting their models to converge, but this appears to be mainly through the application of very large prestress or large change in lengths that are incompatible with each other, meaning that the forces can never balance out based on the criteria set out.  The easiest way I've found to get round this initially is to set the lengths to have a zero change in relative length (as shown below), essentially taking their original starting length with zero prestress or by assigning a very low prestress of say 1kN or 5kN depending on the scale of the system.

After a bit of jigging round, I've managed to get a few different types of cable supported structures behaving themselves, from simple gallow brackets, to cable trusses, and even a simple icosahedron tensegrity prism.... although I need to spend a little more time rotating the geometry to reduce the number of supports needed for the prism.

Now I've got the models behaving and analysing efficiently, I can start to experiment with what difference the various analysis engines make and how they can affect the behaviour of the structure, particularly as I start to increase the complexity into cable nets and stacked tensegrity prisms.  One thing that I'm finding difficult is tracking down a decent ROBOT community, particularly as I think there are quite a few things I could be doing with the API to connect it with Mathematica.

If anyone knows of one, I'd appreciate a heads up or a link....

## Inspiration...

Whilst I've been in academia for about 2 and a half years now, I've only just seen off my second batch of first years and attended my first graduation (after much cajoling by a few final years).  Having a significant birthday approaching I've been thinking a great deal about what am I going to do for the next few years until retirement, I enjoy the teaching a lot and working on dissertations gives me tremendous pleasure, but I miss designing buildings is the dilemma that I've been having.  But there's one aspect I'd not really considered when I moved to academia, and that's that I genuinely love learning and essentially I'm getting paid to learn... not as well paid as I would be as a consultant, but I get a lot of time to be very self-indulgent and learn new skills.

I try hard to not be the kind of lecturer that I had to endure when I was doing my degree and typically put anywhere between 5 and 12 hours of preparation behind every hour of lecture that I deliver.  I'm not saying that my lecturers weren't prepared, they certainly knew their stuff, but they were really dry and tedious in their delivery and at times it felt a little like they were padding.  I had hoped to at least inspire a few of the engineers of the future and hopefully I've done that by combining my industry background with my enthusiasm, but what I hadn't counted on was that my students would inspire me and teach me all sorts of things about the world and myself.

Having been fortunate to work with engineers, architects, and clients who have really been brave and pushed the boundaries of my abilities with the result that we've created some truly fantastic buildings together, I foolishly thought that all of this experience meant that as the lecturer the ability to inspire was my sole domain, but I'm frequently humbled and inspired by my students.  I'll comfortably pull 17 hour days when I've a bee in my bonnet and can sustain this pace for several months at a go, but I've students who put my work ethic and self-discipline to shame.

The beauty of teaching classes far in excess of a hundred students (many of whom are international) is that they come with a multitude and wealth of experience and perspectives.  Each of them are complex individuals with differing opinions and backgrounds and in all honesty I'd never really encountered this level of diversity in industry.  Each week I'm humbled and gain new perspectives from the students, some of whom have faced more adversity than I ever could have imagined and yet still manage to achieve impressive results and retain their ability to be great humans.  Something that perhaps I've lost track of at times during my career, but that hopefully I'm regaining as the days tick by.

When I joined academia, I had a clear exit strategy... 3 years and then exit back to industry.  It's not that clear cut any longer though, I was prepared to be the lecturer... but I don't think I was prepared to become the student and I'm discovering that I've still so much to learn that I may just have to hang around a little while longer than I had planned.

## Critical thinking...

One of the biggest challenges that I face as a lecturer is helping the students to develop their critical thinking skills, especially with regards problem solving as this is one of the key skills an engineer should possess.

It's a fundamental skill for a practicing engineer to not only problem solve, but to critically review the problem and reconstruct it so that only the important parts are focused upon.  Essentially honing in on the nub of the problem.

I'm a fan of using stories in lectures and I used to work with an Italian engineer who unfortunately died last year and he had a plethora of stories and anecdotes that he paraded out whenever the occasion arose.  One of his numerous stories that sticks in my mind and that I think I'll start using in my lectures about critical thinking involves three construction professionals on a train ride to Scotland for the first time.

There is an Architect, a Project Manager, and an Engineer on a train together and as they cross the border into Scotland for the first time on a train racing through the countryside they spot a brown cow in a field.

The Architect, being the first to spot the cow, declares that clearly all Scottish cows are brown, the Project Manager who feels that he clearly has the organisational skills to rationalise this observation and thinks that the architect hasn't been critical enough, decides to correct the Architect and notes that in reality what the Architect has actually observed is that in Scotland there is a field which has brown cows.

The Engineer meanwhile has been listening intently to this discussion and decides to correct them both by sharing his observation, that in fact there is in Scotland, a field, that contains a cow, one side of which is brown.

Tutorial

## Rotating points...

Part of the Mathematica scripts that I've been writing require the generation of curved geometries and I've been spending a bit of time to work through different ways of achieving this.  My initial solutions were quite straightforward and made use of polar co-ordinates to create an array of points, which were then converted to cartesian co-ordinates at the end to make their inclusion in the analysis scripts a little easier.

Another way to do it makes use of complex numbers, but I haven't studied complex numbers for over 20 years and if I'm brutally honest I always struggled to work out what on earth they were really used for in the real world.  I've been through a few texts but the practical applications have always been glossed over.  One line of texts that I've found helpful for rediscovering lost maths skills, specifically for generating geometry, are mathematics books aimed at computer scientists rather than engineers (Vince, 2010).

So what's a complex number?  Essentially a complex number has a real part and an imaginary part and this was the part I used to struggle with as a maths student because I could never understand what use in the real world an imaginary thing could be.  If we could make an imaginary part useful then we could harness the power of unicorns and dragons surely?  This is where Vince (2010) has helped me decipher how complex numbers can be useful as the principles are used in geometry to rotate a point around another point.

And to convert from a simple cartesian co-0rdinate into an equivalent complex number representation is quite straightforward too, you just use the relationship below.

The key concept to understand is that a cartesian co-ordinate can easily be converted to an equivalent complex number and to rotate this new co-ordinate by 90 degrees anti-clockwise you multiply this new complex number by i.  If you want to rotate by a further 90 degrees, then multiply this again by i.  One important thing to remember when going through this series of operations though is that i² can be simplified.

## Example.

So for example if we wanted to take the co-ordinate at point A and rotate it through 90 degrees, we simply multiply the point by i, then simplify and we'll get the new co-ordinate for point B.  Here's the worked example for anyone that wants to follow along at home.

Rotate by 90 degrees, therefore multipy by i.

i² can be simplified to - 1 though

Becoming

Once you've followed the working above, why not have a go at rotating B through 90 degrees to get to point C, then again to get point D and then again to get back to point A?  Essentially multiplying the co-ordinates by i rotates the point 90 degrees in an anti-clockwise direction.

If you wanted to boil this down to a single expression to allow a programme to be coded this can be done quite easily and the expression is as set out below with the angle expressed in terms of degrees.  This expression, takes an existing point (x,y) and rotates it by an angle θ to get the new co-ordinate (x',y')

## Mathematica sample code.

Now we have this simplified expression, let's see how hard it is write a little bit of code to calculate the angle for us using complex numbers.  I don't pretend for a second this code is either elegant or efficient, but for new programmers I think it should be fairly easy to follow.  First we define a variable called coords to input a cartesian co-ordinate, this has to be in between curly brackets.

{-19.94, 392.11}

Next the angle that you wish to rotate between has to be defined, I've assigned this to a variable called angleRot for this example.  This angle has been entered in degrees.

{-49.45}

The next stage applies the equation above for imaginary numbers on the first line of code, with the second line extracting the Real component using the Re[ ] function for the X co-ordinate, and the imaginary component using the Im[ ] function for the Y co-ordinate.

{284.977, 270.066}

This gives the new position based on the co-ordinate being rotated by an angle around the origin (0,0).

## Rotate a point around another specified point.

It's just as straightforward to rotate a point around an arbitrary point rather than the origin it just requires an additional step that moves the co-ordinate back to the origin, then after the rotation has been completed the point is shifted back again by the same amount.

Enter co-ordinates as cartesian.

{3, 2}

Confirm the angle by which you want to rotate the co-ordinate by degrees. All angles are measured positive from 3 o'clock in the anticlockwise direction as per complex numbers standard.

{90}

Now you need to declare the point which you intend to rotate around.

{2, 1}

Before the rotate can begin you need to determine the distance between the origin and the rotate point, this will be the distance you have to translate the point being moved around before the rotation starts.

{-2, -1}

{1, 1}

The final step is to rotate the point around the origin and then move it back by the same amount that it was translated by before rotating.

{1, 2}

## References.

Vince, J. (2010). Mathematics for Computer Graphics (Third ed.). London: Springer.

General

## 10,000...

I've been doing my PhD for a while now and in all honesty it goes through fits and starts with regards its progress, but on the whole I think that it's getting there more or less.  I follow quite a few different people of on Twitter who are on a similar journey and often take a quick run through the #phdchat channel although because of a commitment on a Weds night with the British Red Cross I can never join the conversation.

I've seen a few comments over the past few months that a PhD is about 10% inspiration and 90% perspiration... but it surely can't be that straightforward, can it?  Since I graduated all those years ago I've usually kept a trio of books on the go at any one time, each one from a different genre: fiction, self improvement, and a technical book.  The self improvement book that I'm reading at the minute is called 'Outliers' and is all about those over achievers that sit far and beyond the datum of us mere mortals, but interestingly there are a few things in the book that have really got me thinking about this 90:10 statement.

One of the points raised in the book is that on average it takes about 10,000 hours to get really good at something, whether it's playing the piano, ice hockey, or other activities.  This got me thinking about how much effort it is going to take me to finish my PhD, given that it takes about 4 years on average for a student to complete their PhD and most students work insanely hard at the end which I guess makes for a 50 hour week averaged out over the duration (including time for noodling stuff over and reflection) and that most people take a couple of weeks off a year for a holiday this gives a rough idea of how long it should take a typical PhD student.  After all gaining your PhD is essentially demonstrating that you know an awful lot about a very focused topic.

So the amount of effort seems to match pretty neatly on my guesstimated figures, but what about the 10% inspiration part?  It's argued by Gladwell that once a persons IQ is over a certain point, say 130 or so then they're deemed to be 'capable enough' to be a contended for a Nobel prize or a reasonable University education, in fact just as many people win with an IQ of 130 or so as compared to the ultra intelligent folk who have IQ's of 200+.  Now clearly if you have a huge IQ, then the chances are you going to find it easier to grasp particle physics than say someone with a lower IQ, but this doesn't necessarily mean that you're going to come up with that 10% inspiration easier.  Now I'm never going to aim as high as a Nobel prize, but certainly completing my PhD would be great!

As part of my PGCAP course I was interested to see how different people learned and one thing that I thought was interesting was a test for multiple intelligences as I really connected with the idea that different people will excel at different types of activities, but how can you argue that a musical genius is any less intelligent than a physics genius? Surely they have similar genius qualities, but they're subtly different... My results for the multiple intelligences test are below which show I'm spread over a few different strands, but clearly I can barely hum a decent tune.  If you would like to see how you're intelligences are distributed then you could take the test here.

Personally I think that the 10% inspiration part is going to be easier for the sort of person who likes to think of new uses for existing things, or indeed someone who can noodle over and think creatively and abstractly and I'm remaining hopeful that my experience designing buildings and other structures will be useful in thinking creatively on my PhD.

There is an interesting test that can be taken called the divergence test, this test asks candidates to think of different uses for a common everyday item such as a brick for example.  Creative sorts should be able to come up with all sorts of examples that are beyond the every day uses of this item... some people will list that they could build a house with it and a BBQ and then run out of ideas, a creative sort would be able to list all sorts of madcap ideas from weighing down the corners of your duvet, to using it in a smash and grab, to leaving a car supported whilst you steal the wheels.  I tend to fare pretty well on these sorts of tests and I'm one of the few that's still writing ideas down as the time runs out and I'm hopeful that it's this creative thinking that is going to help me draw upon the 10% inspiration part of my PhD.  The downside is though that I frequently go off on madcap related and unrelated tangents whilst I'm in this kind of thought process, so the biggest risk for me completing my PhD will be focusing on the task in hand I think.

References:

Gladwell, M. (2009). Outliers: The story of success. London: Penguin.