Wednesday, February 8, 2012

Numerical Analysis on a Calculator

Today in my differential equations class, we ended up trying to solve the equation x=cos x. And couldn't. Well, I'm not sure everyone was trying very hard, but I had scribbled trig identities all over my page without making any progress whatsoever. Eventually the lecturer took pity on us (or decided that giving us any longer was a waste of his time, perhaps!) and told us to take out our calculators. Oh! So all that analytical fiddling wasn't helpful. It's quite easy to solve the equation numerically on a pretty standard scientific calculator, though, and quite a pretty technique too, I think. I thought I'd share it.

Pick any number you like. If you pick it close to the right answer, the process will be a little quicker, but it doesn't really matter. From the picture below (drawn with Gnuplot), 1 seems like a reasonable starting point.



Now you put cos(1) into your calculator. You don't get 1 back out, so that's not your solution. But if you take cos of that answer, and then cos of that answer and so on for a little while (you can probably do something like just hitting '=' over and over) the answer eventually stops changing. You've found a value which - at least to the accuracy your calculator displays - is it's own cosine. That's the solution. Quite neat! (I think that method is the numerical form of Picard integration, but I could be quite wrong.)

Having started playing with Gnuplot, I don't want to stop, so before I go back to work, why don't I show you a picture of the probability densities we're calculating for the particle-in-a-box problem? It's pretty, at least.
Probabilities of finding an electron at different points in an infinite potential well for five different energy states. (I hope.)

Saturday, February 4, 2012

Details

Despite appearance, I am neither dead nor gone. I'm landing. Working out how to cook for two. Working out how four people with three cars can share a single garage. Hoping that the university internet will be a little more reliable once the registration hordes have faded.

Lectures start on Monday morning. In preparation, I have worked out my timetable. I haven't worked out my lecture venues yet. Or labelled my files. Or actually registered for the extra elective which is making my timetable look as scary as it does. (There are six timetable blocks, running 07:45 - 17:30, Monday to Friday. I have  courses in five of those blocks.) I most certainly haven't looked over last years notes so that I'm ready to pick up where we left off, or more than half thought about doing that so-lauded preparatory reading for any of my courses.

Probably, none of that is necessary. Certainly, it's more important that I know how to work the kitchen of the house we're staying in, that I've got the best route from the fridge to the supermarket and back worked out, that I've met the lovely people who are helping our church youth group get organised again, that I'm working out how to do the things I do 'just for fun', but which are really rather important to my sanity.

So tonight I'm going to work out how to make handwritten file tags look just as snazzy as computer-designed ones. I'm going to work on the Baltic myth I'm retelling for a deviantART contest/project. (I don't expect to win, but I want to enter anyway.) I'll have a go at cooking for one, since my sister and partner-in-crimeooking is going out.

Nothing fancy; nothing tragic; nothing exciting, perhaps. But life is taking shape. Sometimes the drama is in the details.

Monday, January 23, 2012

Here and Back Again

Sometimes life just turns itself inside out. I suspect this happens rather a lot, but right now it's happening so that I notice. See, on Saturday morning I'm flying up to my university town. In some senses, this is the standard 'moving out' box checked in the great big growing up checklist. But -

I'm actually flying back to the city I've lived in for the last two years. It's just that (except for my sister) the rest of the family aren't coming with. I'm going to end up in an area I know far better than the one I'm living in now. I'm going back to my very own bed and my desk and my books. Oh glorious books! That may seem a little ridiculous when you know that in the room I'm currently sharing with my sister, I use more shelf space for books than for clothes, but I really am looking forward to being able to pull out Brewster's Dictionary of Phrase and Fable whenever I want it or to check a detail from my biography of Lewis Carroll just as soon as I get home*. I will miss my family, but there's a strong tug from the other side too.

On the same note, I'm going back to people I already know and a bunch of systems I know how to work. Sure, some stuff will be new (we'll have to do our own banking - ick), but a lot of it won't be. And a lot of what I'm expected to struggle with seems more fun than intimidating. One girl asked me how we would manage cooking and I very nearly assured her that my parents would be  fine without us. (In my defense, I was trying to keep track of three conversations at once just then.) I'm sure we'll make grocery shopping mistakes, but I'm looking forward to 'Maritzburg supermarkets where things are organised the way they should be (not that I'm biased or anything).

I don't think the leaving/coming home paradox is at all unique to me - everybody (well, 'most everybody) grows up and moves on. I do think I have a slightly unusual logistical twist on it though! And since I won't have a new city to explore, I might need a list of books to occupy myself with until the deluge of coursework is keeping me busy. If making lists of books to read for fun ranks that high on my priority list, life really can't be that bad. I'm looking forward to seeing what 2012 sem. 1 has to throw at me.

_____
*I realise I could check details online, but that's just not the same.
†Yep, semester one. Our school year matches the calendar year. (Possibly it's different because summer holidays run over Dec/Jan in the southern hemisphere.)

Friday, January 20, 2012

Seven Quick Takes

7 quick takes sm1 Your 7 Quick Takes Toolkit!
One
  The thing about living in a UCT+2 timezone is that by the time I see people posting about Friday, it's well into Saturday for me. Or maybe it's just a problem because I follow a lot of international American blogs. Or maybe it's just that I'm not organised enough. At any rate, the last couple of weekends have seen me scrolling through my feedreader saying 'Oh, I guess it's too late to write one of those 7QT posts'. But it looks like I might've pulled it off this time.

Two
  It's not that I'm a perfectionist or anything. I completely accept that nothing will be done 100% right. I'd just like everything to be within a few standard deviations of correct. 3-sigma certainty, for example, is 99.7%. A 0.3% error in the posting time would give me, um, less than four and a half minutes into Saturday when I could post. See? Totally not perfectionist about stuff. Not whatsoever.

Three
  The holidays are too long. Now, people will object if I advocate for more term time, but I think it would be cool if we could take a couple of weeks from the long summer/winter holidays and tack them onto the ridiculously short mid-semester breaks. It might be nice to have a more balanced kind of year, but it would definitely be nice if I didn't have time to realise that the sensible thing to do with my curriculum might be to pick up Operations Research and Numerical Methods and drop Real Analysis and Algebraic Structure. I think it's worth struggling to take the courses I'll most enjoy, though.

Four
 It's not that the other modules are horrid, but it feels like switching waffles and ice-cream for macaroni and cheese. Macaroni cheese is yummy and good for you, but, well, it's not waffles and ice-cream.

Better than macaroni cheese? [Photo by Michael Kwan]
 It's kind of hard to justify that, though. The applied maths courses would probably open more doors for me in terms of postgrad studies and the fact that they don't clash with my required physics courses is probably also significant. The pure maths courses look like more fun. And given that I don't really know what I want to do next year, I can't base my decisions on that. But it's not worth stressing about till I'm back on campus. So really, the holidays should just be shorter.

Five
 When I'm trying not to stress (for whatever collection of reasons) I read. A lot. In the last few days I've read Northanger Abbey as well as all five books in Rick Riordan's Percy Jackson and the Lightning Thief series. Riordan is awesome, but I couldn't help noticing that Percy dreams an awful lot in those books. Dreams are used as a really cool plot device, but given the number of throwaway comments the guy makes about his past dreams, he must have way more non-plot-related dreams than plot related ones. But he says he dreams way more at camp (where the action happens) than elsewhere. The epistemo-temporal maths doesn't work out. (It's still better than Harry Potter, where there are forty kids per year, but six or seven hundred in the school . . .) Despite such things, I love the books.

Six
 No, I don't think epistemo-temporal is actually a word. But let's pretend and use our etymological detective skills, yes? Epistemo from the Greek word ἐπιστήμη (epistēmē), meaning "knowledge". Temporal from the Latin root tempor- meaning "time". That is, the knowledge Percy gains by dreaming doesn't seem to tie up with the amount of time he spends dreaming. And I feel totally justified in mixing Latin and Greek, since Riordan does it all the time, although we hardly noticed until it became the premise for the new Heroes of Olympus series.
Next on my (re)reading list (anyone who writes about classical mythology set today with a steampunk edge has to be pretty awesome, right?)
Seven
 There is a blog called Faraday's Cage is where you put Schroedinger's Cat.

 It reminds me of why engineering is awesome, as well as why it frustrated me. It makes me think it doesn't really matter that much which bunch of cool courses you take for your undergrad degree: you can still shift around a bit more later if you're willing to work. It's pretty cool if you're interested in stuff like Physics/Maths/Engineering/Science Education/Gifted Child Education/Homeschooling/Cute Fluffy Animals*. I saw it featured here and it's part of the reason The Lost Hero is still on the to-be-read list (rather than the currently-reading list).
___
*Actually, it's pretty cool even if you aren't, but you probably have to like some of them to enjoy it.

Sunday, January 15, 2012

Mathematics

I want to unpeel mathematics
and hand it to you
on a plate of curiosities.

I want to find the gravel
you brushed off your knees
three years ago and tell you
"These are seeds. We could
plant them together if you liked."

I want to fly
three hundred million metres per second
(that is, to be massless)
by exploiting the nature of
multidimensionality and

I want you to come with.



But my wings grow tired
just imagining
and I can't
find fertile soil.

When I curl into an armchair
with my maths book and tea,
saying, "You should try it sometime,"

I don't expect you to listen.





In general, I don't particularly like depressing/sad poetry. Sadness, it seems to me, is not an end in itself (which is not to say it's without value). Poems can successfully take sadness and use it to another end (this reflects life, I think), but I would propose
wallowing ≠ art.
This is rather wallow-y. However, I told myself very firmly when I started writing here that I was not to have expectations of art. So I argued with myself a bit:
   This is rubbish.
   It isn't! It's true!
   Well, it's certainly not factual and I don't see it uncovering the intrinsic nature of reality.
   Didn't you like the part about maths being like flying even a little?
   Okay, that wasn't too bad, but people won't get it.
   How do you know what people will get? You're not people. And the second part is also good. The emotion is universal, but the context is specific.
   Fine then. I'm not saying it's bad, but it's not good enough. You know that's not the whole story.
   Yeah, it's not the whole story, but you haven't lived the whole story yet. How do you expect to write it?
   You can't write it yet.
   Please?
   No.
   What if I guilt you about never writing blog posts?
   What?
   It's been five days since the last post. Can't I put this up?
   No.
   Oh come o-o-o-n.
   Fine then. Make a fool of yourself. But put up a disclaimer saying I had nothing to do with it.
And then I posted it, against my [better/worse] judgment, together with the transcript as a disclaimer.

Tuesday, January 10, 2012

Music – Poetry

Recently, I have been learning (or trying to learn) to play classical guitar. I had piano lessons years ago, so I have some grasp of basic musical theory, but everything is still pretty new. I can see that the music wants me to play an F and a D together, but I end up staring at the fretboard wondering how to play both of those at the same time. It forces me to slow down and think about which notes I'm playing; gives me a chance to wonder why.



The first poetry I remember enjoying is the dwarves' songs at the beginning of Tolkien's The Hobbit. I read them more as poems than as songs, but they carry music in their wording and are generally delightful. They did not, however, give me much cause to think about what poetry is all about, since they follow every convention of structure and metre and rhyme that I understood at the time. Those, it seemed to me, were poems. The newfangled free verse stuff that my English book went on about was not.

It worried me that the great fount of wisdom that was Comprehensive English Practice: Grade 6 said (or seemed to say) that breaking writing up onto lots more lines than were needed made it poetry. (It doesn't, of course, but what does make it poetry is rather subtler.) Somewhere in the middle of that textbook is Seamus Heaney's Storm on the Island. I don't think it's exactly a difficult poem. It works at face value; it is not the kind of poem that describes a ship without mentioning the ship and is not in fact about a ship at all. It is quite a complicated poem, because it largely describes what isn't there. (Which is rather the point.) It hits a balance point that eleven-year-old me had to think about, but could understand.



I am learning to play an étude by Dionisio Aguado. It is not, in the grand scheme of things, very difficult at all, but it is quite a challenge for me. I am pleased when I work out how to play another bar and delighted when I can pick up the patterns of the music. Oh, this is the same chord, but with the A an octave lower and I keep playing this sequence because it's the broken-chord A minor triad and the piece is written in A minor! I can't find a melody line in my étude, but when I have to slow down to think about it, I can find patterns in it. And then, hopefully, I can take those patterns back to the sweep of the music played as quickly and flowingly as it should be, so that I can see the weave without forgetting the warp and the weft.



Sometimes art is at least as much thinking as feeling.

Friday, January 6, 2012

Recursive Wanting

recursive adj.: related to learning joined up writing for the second time (not really)

The topic of things people want is a rather thorny one, I think. After all, I may want to eat an entire slab of chocolate, but doing so will not actually make me much happier. Whereas I want to do things like write blog posts and practice guitar and what's more, doing those things makes me happier. So wanting something is not necessarily much of a recommendation, but it's probably worth being aware of.

Sometimes I think I want things that I don't, in fact want. This is confusing. What seems to be going on is a kind of recursive wanting. I don't want x, but I wish I did and since the two things are so similar, I mistake the one for the other and put a fair amount of effort into achieving x. Then I'm not satisfied.

For instance, consider TV. Most people seem to like watching TV, or at least watching some version of TV shows on their computers. I would submit that people really want to watch TV when they at least think about skipping their homework while they watch the newest episode of their favourite show. At any rate, once the homework or whatever other prioritized tasks they may have are finished, they watch the show. There's also a rarer sort of person who wants to want to watch TV, because so much enjoyment seems to be derived from it and it's generally what people do. It might not occur to these people to skip the homework in favour of the new show. In fact, even after finishing the homework, they might decide to finish up some other project before watching the show. And even once they're actually watching, they could plausibly get distracted by something else. It's not that the TV show isn't any good, but it isn't actually what they wanted.

I'm not actually sure exactly how they could've got what they wanted. When I catch myself doing things like that, I get frustrated because I'm not even sure exactly what it is I want. When I don't catch myself, I get frustrated because nothing seems to work the way it's supposed to. At least with the former, there's the possibility of doing something about it! Even if something is recognising that actually, you can't have everything you want.

So, vague goal-like entity set: start paying attention to how recursively I want things.