Simple Semester Start

After trudging through my first week of classes, I finally feel like I’m prepped and ready to discuss what has happened to me since the new year and my thoughts on my last semester of study at Michigan State University. I knew that this time would come eventually, but it just feels harder than I had imagined, for numerous reasons that may become known through this post. First, though, let’s talk academics…

AST 410 – Astrophysics Senior Thesis
Work on my thesis went somewhat smoothly over break, with a lot of simulation runs to get a better feel for how long full net calculations would talk, adjusting initial parameters, and writing two auxiliary Python scripts for the projects (a short timing procedure and a data graph creator). I also looked up a handful of articles on the subject of computational nucleosynthesis, primarily to refine my data for densities, temperatures, and times, especially since I have started using non-constant parameters for those quantities. Of course, I still need to talk to my advisor for the first time this semester, but that will most likely come later this week or early next, once I read a few more papers and run some more simulations.

KIN 102K – Tae Kwon Do I
My fabled final credit to get two degrees, this class is my first and only fun course at MSU. Before this, I was taking 16-18 credits a semester of all academics, but as a second semester senior with not much else on my plate (and only having 149 total credits before this), I added it midway through last semester. While we’ve only had one real class (past syllabus day), and we haven’t started doing any actual Tae Kwon Do, I know that I’ll like this class and I know it will be amazing. I’m also glad that this will help kick-start my working out, since that usually falls by the wayside when classes get tough.

MTH 415 – Applied Linear Algebra
Based on what we’ve covered so far, what I remember from Linear Algebra I two years ago, and what was covered in Numerical Analysis last semester, this may be my easiest class this semester. Of course, with the schedule that I happened to wrangle up, that’s not saying much. I’m not worried at all.

MTH 442 – Partial Differential Equations
While ODEs were covered in Calc II for me, I don’t really remember it. My only exposure to PDEs has been through my two Quantum courses, but there is was basically just knowing which of two memorized solutions to use in the problem. From what we’ve done in class so far, this shouldn’t be too tough, but I’ll definitely need to keep an eye on it to make sure things don’t move forward too quickly.

PHY 451 – Advanced Laboratory
After a small mix-up that I’m rectifying in a few hours, this class will be interesting to say the least. I’ll only be doing two labs the entire semester, with the same partner, with each lab taking about six weeks (for a total of twelve lab sessions each), both culminating in a journal-like paper. So, based on that, it should just be a less monotonous and Physics-related version of my Bio II lab. Again, I haven’t started the actual lab yet since syllabus week was in full swing, so I don’t know how that will go. I do know that I will be consistently ten to fifteen minutes late every Wednesday to the recitation session, since Tae Kwon Do ends ten minutes before it out at IM West.

PHY 492 – Nuclear and Elementary Particle Physics
The other half of my senior Physics requirement, this seminar will be loads better than last semester’s, if only for the different professor. The material is insanely interesting, the book is pretty well written, plus I’m actually going to care about it this time around. A similar structure with exams and papers, this shouldn’t have too much work strapped on to my load. I mean, just look at that awesome cover! How can a class with that book not be completely epic?

I will also, once more, be leading Briggs Physics labs. With the expected shift of schedules right before classes started, I didn’t know exactly where I’d end up, but thankfully I know now. I have one lab on Tuesday at 1500, one on Thursday at 1130, and my office hours retained their same time slot (2000-2200 Wednesdays). Plus, I’ll actually be able to make it to the weekly meetings, which is good enough for me!

I’m still playing Quidditch, which I’m really excited about. If the little time I spent on the team last year was any indication, this is going to be an awesome spring season. I’m going to be trying out for the travel team, since I obviously missed those tryouts in the fall, which will be held in three weeks’ time. I’m a little nervous, but that may just be because I always get nervous before things like that. Hopefully with intramural practices starting back up this week, plus a scrimmage next Sunday, those feelings of nervousness will subside.

I’ve started learning C++, having bought a textbook geared toward giving an overview of the language specifically for computational physics purposes. It’s not that bad so far, but I did hit a rut in chapter nine with a ton of new topics (in the language) that I need to digest individually before I move on. Past that, I’m still using Fortran and Python, so I should be ready for whatever I may need to use in grad school.

Speaking of post-graduation activities, all of my applications are officially done, so now I’m just in the waiting game to see if I get in any where. If I don’t, I’m also in the middle of the application process for Teach for America, having gone through the initial steps. I also have a phone interview this Thursday, plus I need to complete an online writing assignment soon, but past that it will be interesting to see what happens with that. My final application, which right now is just talk, is sending off my information to SpaceX to see if I can get a spot on one of their programming teams. While I don’t have all of the academic credentials for the job, and I may not even know the language that they write their software in, hopefully they see past those superficial measures. Of course, at this point everything is just waiting around for things to fall into place.

I think that should be good for now. In other news, it’s almost been a year since my MDRS mission, I’m still playing guitar, I had a great time at a bar crawl on Saturday, and I did not deserve to lose in Spoons tonight.

Advertisements

Book Review: Packing for Mars (Roach)

I got Mary Roach’s most recent book for Christmas from my parents, alongside Stephen Hawking’s A Brief History of Time (which I just started reading today). This was the first time I’ve read one of her books, although a friend of mine did read Bonk and really enjoyed it, plus I’ve only heard praise for her writing. It just came as a bonus that she released one centered on space flight, and I started reading the book midday on Christmas. Spoiler alert: I really enjoyed it!

==================================================
Packing for Mars: The Curious Science of Like in the Void by Mary Roach (2010)
Purchase it on Amazon.com

Initial Thoughts: Like I already mentioned, this was my first time reading one of Roach’s books, but based on what I knew of her and her work, I wasn’t worried that I wouldn’t enjoy the book or that she would do a poor job covering the era of human (and monkey and dog and mice…) activity in space. I took the book up to my room, lied down on my bed, and cracked open the cover, eager to start reading.

Like most things, I avoid reviews of books or movies, favoring instead what my friends and family think about it. That’s part of the reason why I write these anyway, to give a different perspective on the work as opposed to the newspaper reviewers who almost definitely do not share my tastes. I mean, Tron: Legacy was rated pretty low, but it’s one of my favorite movies (expect a review for that at some point as well)! Anyway, back to the book…

The Premise: This book covers space flight in a way that usually isn’t encountered. Instead of focusing on launches and missions and extraordinary events, Roach instead looks at the behind-the-scenes aspects, the things that you either wouldn’t immediately think about when someone mentions “space travel,” or things that you’d never think of, like paying people to stay in bed for months to simulate the deterioration of bone mass during an extended stay aboard the ISS or a future long-duration mission to Mars or a nearby asteroid.

In saying that, there are still the aspects usually associated with more standard books on the topic: quotes from Apollo 13 Commander Jim Lovell, visits to Johnson Space Center in Houston, discussions about Mir while in Russia, etc. There’s also a unique insight into things that we know happen, like the astronaut selection process (JAXA, the Japanese equivalent to NASA, documents the dinner containers of their astronaut hopefuls–locked within an isolation chamber–after the meal, but they don’t tell the candidates this beforehand). As someone who knows a fair bit about space, it was great seeing another side to my childhood (and present-day) heroes as well as getting the additional information that comes from her research.

Of course, like her other books, this isn’t a dry science tome meant to bore you. Mary Roach is hilarious! It first hit me on the first page of the book, in the forward/introduction section aptly titled “Countdown” when she discusses the problem with astronauts when compared to machinery:

A solar cell or a thruster nozzle is stable and undemanding. It does not excrete or panic or fall in love with the mission commander.

Even the sentence right before it is golden, juxtaposing irradiated beef tacos with fuel consumption of launching rockets. That sense of humor is present on every page, even in a subdued manner in the more serious or somber sections of the book, like when she meets the widowed husband of one of the astronauts killed during the 2003 Columbia disaster.

The book’s short 300-some pages are packed with information, with something new on every page, and Roach’s humor causes you to blow through the pages like nothing. The first break I took was around page 80, with my stomach telling me it needed food, and loudly. I very easily could have read the book in a single sitting, and I’d enjoy it!

Final Thoughts: With the end of the book came the last solidification that Roach is a great author. While only one of her other three books really interests me (yep, the one about sex), I will probably end up reading all of them, just to learn something new and read more of her hilarious writing. Plus, I’d be learning something new, which is always high on my priority list, and truly enjoying it. Likewise, even if you don’t have an interest in space travel (and if you don’t, you’ve been following the wrong blog!), I suggest you pick up this book. You won’t be disappointed in the slightest!

Transformers: Dark of the Moon [Trailer Review]

If you haven’t yet seen the trailer, watch it HERE. It’s essential if you want to know what I’m talking about.

Let me first admit that, after the first Transformers, I wasn’t really interested in the story line anymore. Part of it was that, having vanquished their foe, I felt that any sequel would just be to rake in some more cash. Part of it was the fact that everyone suddenly was in love with Megan Fox, especially the adolescent boys that I watched over at camp. Part of it was this parody from Robot Chicken (slightly NSFW at beginning an the end). Yes, I did see the second one once it came out on DVD, and it was a pretty cool story, but nothing more. I don’t plan on seeing the third any time soon, even before watching the trailer.

Well, after taking a break from studying for finals, I left my room to see my two roommates watching the first Transformers, so I sat down and watching the ending fight sequence (I came in pretty late into that, so it was really just the last five minutes of the movie). After, I decided to finally watch the trailer for the upcoming se-sequel, Dark of the Moon, just to see what it was all about.

As a space, and science, fanatic, I couldn’t have been more appalled. Just look at the screen capture which shows the Command and Service Module Columbia on the way to the Moon (about 0:08). Notice that it’s just the CSM, no Lunar Module Eagle, no S-IVB third stage for trans-lunar injection. One of those needs to be shown for it to remain factually accurate: either the LEM is still inside the third stage of the Saturn V (which of course would require them to be slightly closer to the Earth, but prospective’s tough), or the CSM/LEM should be separated and heading to the Moon on their own. Seconds later (0:10, the absolute next scene), the missing LEM is magically shown docked with the CSM, in orbit around the Moon. I mean, I know that the general public is pretty stupid, but even they should be able to notice a missing spacecraft magically appear from one scene to the next. If I actually cared about seeing the movie, I’d hope they change that, or have a smoother transition when showing that part of the story.

The other gripe comes when the astronauts are on the Moon, after they’ve landed and uttered those famous phrases (and at this point, I’m getting pretty happy, since they’re using some of the actual footage from the mission, as well as the actual transmissions between the spacecraft, astronauts, and Mission Control back on Earth). I’ll ignore fake-Neil Armstrong’s really giant leap (0:32), where he leaps from the bottom rung onto the lunar surface, instead of first standing down on the footpad and placing his foot into the regolith, since it was obviously chosen for the “one giant leap” message in Armstrong’s famous words and, again, the general public doesn’t really know about it.

No, the somewhat larger gripe I have with the trailer, past the magic LEM, is when NASA decides to cut transmissions to the Earth to perform their “secret mission on the surface” (starting around 0:44). First, I laughed a little at having Tom Virtue, the Dad from Even Stevens, an old Disney show I watched that also starred Shia LeBeouf, working in Mission Control. Then I tried to figure out what was happening when they fed through the “loss of signal” report from Walter Cronkite (0:54), since they were already on the Moon and that transmission came when the CSM/LEM first passed behind the Moon while both were still in orbit. Then I realized the stunt they were trying to pull.

Most people who look at the Moon know that the same side always faces us. I mean, you can just tell by looking up and comparing the dark mare to what you remember of it as a full moon and determine that it’s not really rotating (Well, it is rotating, but since it is tidally locked with the Earth, it doesn’t appear to be rotating from our perspective. If you do a coordinate transformation to a rotating reference frame centered on the Earth, the only “rotational” motion of the Moon comes from its libration, but we can effectively ignore that). In doing so, if the astronauts landed on the near side, which they did, their transmissions would not be cut out until they launched from the surface to rendezvous with the orbiting CSM. That means that their transmissions could not be cut while still on the surface, not while the astronauts are still picking up rocks. It also means that the twenty-one minutes quoted makes even less sense, since the physical moon would have to be rotating around for that to happen at the same (more or less) speed that the CSM is orbiting. This also means that the shadows on the Moon should be swaying and moving, which is not so.

So, to recap: We have a complete disregard for the orbital mechanics of the Moon, which most people are intuitively away of; a disregard for the actual equipment required to get to the Moon, which is only slightly less unforgivable; a slight change in one of the greatest moments in human history, which is understandable for dramatic purposes; and the smearing of a historical event.

Honestly, if the lunar landings need to be messed with for the purpose of the story (unless it’s alternate history, where you have to mess with the past), you’re reaching too hard without knowing where your hand will fall. Good bye, Transformers, and good riddance.

NaNoWriMo 2010 | Looking Back

Well, it being a few days into December, I finally feel like I have the time to discuss what happened or didn’t happen during my first National Novel Writing Month endeavor. It was a long month, especially with all of my schoolwork included in my workload, but at the same time it seemed to fly by so quickly, probably also due to the schoolwork that was taking up time, the holidays, and Harry Potter.

My writing break-down through November

I can break down my month of writing into four different sections, based on how much I wrote, when I wrote it, and what else was happening at the time, as detailed below.

Week 1 – Sprint
Going into the month, I already knew I had two exams a week after the start, so I planned on writing as much as I could before the weekend, which would be spent studying, so that I wouldn’t fall far behind. And that’s exactly what I did, writing a little over 17,000–a third of the novel–in five days, with over 16,000 of that coming in the first four. I was well ahead of the curve at that point, and would be even after taking a few days to study, which was exactly what I wanted.

Week 2 – Slow and Steady
Once I got past those two exams, I did still have two more to worry about, but since they were spread out, I didn’t completely stop my writing as much as I had previously. This week started with the first write-in at Wanderer’s Teahouse, a nice little new place on Grand River, which was organized by our fearless Municipal Liason and attended by a fair number of local writers. I took a couple days off from writing, mostly because of work or doing homework, but tried to write in smaller chunks over longer periods of time. I had figured out what was going on in the story, and at that point the characters that I had created were really carrying the story, with me just there to move my fingers.

Weeks 3 and 4 – There’s other days besides Mondays?
Since my first write-in was so successful, I decided that I would continue to go back every week to work there for a few hours, knocking out at least 5k in each session. I did, however, get really caught up in schoolwork, since I had somewhat ben neglecting it over the past two weeks, plus I was sort of running out of things to write that fit with the story. Not that I didn’t know what would happen next, but that I was having serious doubts that the story would be finished short of the target 50k. So, I took it much more slowly, giving my mind time away from writing just to think (or not think) about the story. I only spent two days during these two weeks writing, both at write-ins, which caused me to encounter my first dip below the “suggested word count” line.

November 29-30 – I need to finish!
I entered the last two days about 11,000 short of the finish, which meant that I would need to average a higher word count than I had during my first week sprints to get that last punctuation mark down before midnight. I went to Wanderer’s on Monday for the last write-in (which had somewhat fallen apart due to lack of attendance and reserved space), sat down and wrote, then moved to Holmes to pick up some snacks and write some more. When I finished that first day’s writing (at around 0130 on Tuesday…), I had pecked out 8,500 words. Still, that meant that I had three thousand to go, and my fears set in: my story was more or less finished. So, on Tuesday, after teaching my lab, I stayed in Holmes and wrote out a few closing chapters, bringing the saga to an emotional end (both happy and somewhat depressing) for the main characters that had remained alive, and by 2030 I had passed the 50k mark with a few hours to spare!

Closing Thoughts
First, what a rush! Looking back, I wrote a 50k-word novel in fourteen days (with some of my days spilling over into midnight on the next, but we’ll just count those as one), meaning I averaged around 3,500 per day. Of course, since I still took the full month to write it, the average is really half that, but that’s more a semantics argument than anything else. What this means is that, even with schoolwork, writing not every day, taking huge breaks, running out of story, and figuring it out as you go, you can still get a novel out of nothing, just with a few sore fingers, eyes, back, and a lack of sleep.

I met a few very interesting people while doing this, plus found out that two of my friends were doing the same thing at various points during the month (ignoring my roommate who I had started this journey with). Next year, if I plan on doing this around whatever I may be doing, my writing will definitely be a little more consistent, and I’ll probably spend October planning out what I’m writing (all I had done for this one was think, plus write down the names of two main characters, once of which was a computer), just so the end goes more smoothly and it feels like I’m taking things a little more seriously.

So, what next for the novel I named Evolution? Well, if I want to try to publish it, it will take a lot of work, especially in the closing quarter of it, the addition of a few scenes, and some more fleshing out of the characters. In other words, close to a full re-write, the plague of Moonshot and Moonshot: Origins (since I never really named that prequel officially…). I haven’t decided if that’s what I want to do, or scrap it and simply write a new story, so for now it will sit on my hard drive with those failed stories (totaling 101,000 words), right next to my only other finished work of longer fiction, No Exit (bring my total finished word count to 66,000), until I decide what to do.

But I’ll leave that decision for next year. For now, I’m taking a well-deserved break!

NaNoWriMo Preparations

EDIT 11.30.2010 1938 EST | I’ve won! Expect a reflection post within the next handful of days.

For those of you who don’t know about National Novel Writing Month (NaNoWriMo), just imagine that what I’m doing isn’t part of an international “contest.”

With October coming to an end, I have quite a few things to look forward two: the end of my second exam season, the end of the semester, Thanksgiving, Halloween, a weekend. November also brings with it a new challenge, especially around my already challenging life, this year: NaNoWriMo. I’ve been writing long fiction on-and-off for five or six years, but I’ve never really finished anything meaningful (aside from No Exit [PDF]). I’ve always wanted to, but I would get sidetracked by homework, editing what I’ve written, life.

Not this year. This year, I’m officially signed up for NaNoWriMo (check out my profile HERE), a month-long sprint to write a 50,000-word novel in thirty days. Crazy? You bet, but if life was always boring then it isn’t really doing much for you anyway. I’ve known about the “contest” (I quote that, since it really is just a contest against yourself and the calendar) for a few years, but never signed up since other obligations always got in the way, or I felt that they would during November. This time, I don’t care, since I’ve basically finished my grad school applications, I only have fourteen credits, and I have a ton of free time that I just waste. Why not put those lost hours per day to use doing something productive?

I’m taking a slightly different approach than my previous failed novel attempts (and the same approach I took with No Exit) in that I’m not planning anything out beforehand. Well, almost anything, since I have two main characters more-or-less fleshed out and a general idea of how the novel will start (and end, in some regards), so I’m not going into it completely blind. I also have a few ideas for some encounters, just because I think it be cool to write those events. Other than that, I’m letting my frantic typing carry the story through the 2,592,000 available seconds.

For those of you also planning on pecking out 50k words this November and want a writing buddy though the interwebs, add ME as a buddy. You can also find some basic info about my planned novel there as well and track my progress. Also, since I plan on having my only writing be for the novel (and homework…), I won’t be posting here until December. I do plan on having a daily word-count posted on my Twitter account every day of November, plus whatever else I decide to include, so follow me there if you’re interested.

See you in December!

netJina and Grad School Applications

This past Monday, I had my most recent meeting with Doc Brown about my Astrophysics senior thesis, which went well for a handful of reasons. From now on, what I’m doing for the research will actually be relevant for the final project. No more will I simply be just reading and learning things to get up to speed; I’ve actually started programming for the final project! But, before I get ahead of myself, let’s go over what happened:

gfortran was fixed…
After e-mailing my advisor to set up the meeting, he told me to grab the most recently updated files through the svn, read through them quickly, then compile them to make sure things worked right (just a ./clean and ./make_all to do everything). So, that’s what I did, but I got an error return during the make. I e-mailed him back soon after, and he said that I just needed to update my compiler (I think I was using gfortran 4.2 or 4.3), which I then set out to do. Note that this is all happening on Saturday, which I was thankful that he sent responses so quickly. For the next four hours, I scoured the interblags trying to download and install gfortran 4.6, the most recently released version. Nothing worked, and I got so frustrated that I decided to re-use my startup disk and clear out the bad files that had invariably started to litter my laptop. Come Sunday afternoon, I bit the bullet and stuck with gfortran 4.5 and hoped it would be fine. Thankfully, I could compile files again (something I had lost during the fiasco the day before), but I was getting a different error message back.

So, come the meeting on Monday, Doc Brown checked the error return and figured it out (he was actually using gfortran 4.4, so I didn’t necessarily need to waste all of that time on Saturday). The was actually an “error” in the ./clean command, since one of the directories wasn’t getting cleaned properly. I put that in quotes since it wasn’t an error, really; the command just didn’t clean that directory since the programmer didn’t want to have that directory cleaned. With that, frustration number one was gone, and I felt grateful that it both worked and that it wasn’t my fault it wasn’t working before.

…I’m actually writing the driver program now…
Once the world was in order, and the test (right) was successful, we started talking about the meat of the project: programming the driver program to run through the r-process! We went through the test_burn.f file just so he could explain a few weird points, I asked questions and understood what was going on, then we discussed a bunch of things related to the project. I’ll be writing two/three tester programs first, just to include the weaklib routines and try out a few different starting values, but my final project will be largely similar to the programs I’m writing now. He also pointed me toward a paper from a few years back to read during my programming to determine some start values and get an overview of an actual application of what I’m doing.

…and I have one reference letter lined up!
Finally, once things were said and done, and I was well-informed on my next steps in my senior thesis, I asked the question that was in the back of my mind for the last month or two: would you be able to write a reference letter for my grad school applications for me? Almost immediately he responded yes, which was a great confidence boost and an amazing way to start the week off. I just had to send him some files (statement of purpose, c.v., etc.) to help him write it, which I compiled and sent out earlier today. I’m just glad that I have one letter set, so I just need two more (I’ve e-mailed one prospect, and I’m going to try to catch one of the others tomorrow or Monday, but if not he’ll get an e-mail as well).

The meeting couldn’t have gone better, at least for the point I am right now. I’m just glad that one stressor has been removed from my life, so things should go much more smoothly now…

Prime Python Philanthropy

With each passing day, I realize that I love programming more an more. Part of it comes from the fact that every line of code is a little puzzle: how it interacts with other lines, itself, variables, functions elsewhere in the code, etc. Getting everything to work together is such an accomplishment, something akin to (at least for me) finishing a race, winning a game, or doing well on an exam. I take almost any opportunity to program, even if it’s just a few short lines to decide what to eat for dinner.

Recently, I’ve been helping a few of my friends with their Python homework for CSE 231. I never took the course, my roommate took it last semester, but we both just like flexing our programming muscles every now and again. We are both in a programming course right now (him in CSE 232, me in MTH 451), but just going back and writing little Python programs is always fun. Today, I wrote a short bit of code that added two binary numbers via string manipulation: completely unnecessary in the real world, but fun to program in its own right.

Of course, my own programming homework is always more difficult than what the CSE 231 homework is. This week, for instance, we needed to write three functions to solve a system of linear equations using three different Gaussian elimination schemes (no pivoting, partial pivoting, and scaled partial pivoting). My first stab at it did not go well, since I started with the actual numerical solving schemes than tackling the machinery underneath. After fusing around for a while, I scrapped it and started fresh, first writing basic matrix manipulation functions (switch rows, multiply row by a constant, etc.), then gradually moved up to actually solving the equations.

# Matrix manipulation functions
def exchange_rows(A, i, j):
  A[i], A[j] = A[j], A[i]
  return A

def multiply_row(A, i, mult):
  for q in xrange(len(A[i])):
    A[i][q] = A[i][q]*mult
  return A

def add_rows(A, i, j):
  for q in xrange(len(A[i])):
    A[j][q] = A[j][q] + A[i][q]
  return A

# Pivot Checking
def check_pivot(A, i):
  if A[i][i] == 0:
    A = exchange_rows(A, i, i+1)
  else:
    pass
  return A

# Generic entry elimination functions
def forward_substitution(A, i):
  A = multiply_row(A, i, 1/float(A[i][i]))
  for q in xrange(i+1, len(A)):
    if A[q][i] != 0:
      mult = -1.0*float(A[q][i])
      A = multiply_row(A, i, mult)
      A = add_rows(A, i, q)
      A = multiply_row(A, i, 1.0/mult)
    else:
      pass
  return A

def backward_substitution(A, i):
  for q in xrange(i, 0, -1):
    if A[q-1][i] != 0:
      mult = -1.0*float(A[q-1][i])
      A = multiply_row(A, i, mult)
      A = add_rows(A, i, q-1)
      A = multiply_row(A, i, 1.0/mult)
    else:
      pass
  return A

# Three solver methods
def gauss_np(A):
  for index in xrange(len(A)):
    A = check_pivot(A, index)
    A = forward_substitution(A, index)
  for index in xrange(len(A)-1, -1, -1):
    A = backward_substitution(A, index)
  return A

def gauss_pp(A):
  startrow = 0
  for index in xrange(startrow, len(A)):
    maxindex = 0
    maxvalue = 1
    for i in xrange(index, len(A)):
      if A[i][index] > maxvalue:
        maxindex = i
        maxvalue = A[i][index]
    A = exchange_rows(A, index, maxindex)
    A = forward_substitution(A, index)
    startrow += 1
  for index in xrange(len(A)-1, -1, -1):
    A = backward_substitution(A, index)
  return A

def gauss_spp(A):
  list = []
  for j in xrange(len(A)):
    maxvalue = -1000
    for i in xrange(len(A[0])-1):
      if A[j][i] > maxvalue:
        maxvalue = A[j][i]
    list.append(maxvalue)
  for index in xrange(len(A)):
    temp = list
    for i in xrange(len(temp)):
      temp[i] = abs(A[i][index]) / float(temp[i])
    max = 0
    ind = i
    for i in xrange(index, len(temp)):
      if temp[i] > max:
        max = temp[i]
        ind = i
    temp[index], temp[i] = temp[i], temp[index]
    A = exchange_rows(A, index, i)
    A = forward_substitution(A, index)
  for index in xrange(len(A)-1, -1, -1):
    A = backward_substitution(A, index)
  return A

# Main function commands
def grab_input():
  A = input("Input Matrix A: ")
  b = input("Input Vector b: ")
  option = raw_input("(1-Gaussian, no pivot : 2-Gaussian, partial pivot : Gaussian, scaled partial pivot)\nSelect Solving Method: ")
  if len(b) != len(A[0]):
    print "Matrix/Vector dimensions mismatched."
    A = "1"
  return A, b, option

def prep_matrix(A, b):
  for q in xrange(len(A)):
    A[q].append(b[q])
  return A

def solve_function(A, option):
  if option == "1":
    A = gauss_np(A)
  elif option == "2":
    A = gauss_pp(A)
  elif option == "3":
    A = gauss_spp(A)
  return A

def grab_solution(A):
  x = []
  for q in xrange(len(A)):
    x.append(A[q][-1])
  return x

def main():
  A, b, option = grab_input()
  A = prep_matrix(A, b)
  A = solve_function(A, option)
  x = grab_solution(A)
  print x

if __name__ == "__main__":
  main()

For the solver functions, I wrote gauss_np(), then gauss_pp(), then gauss_spp(). You can kind of tell that order since the latter ones are way less elegant than the rest of the code. I guess that happens after fusing with the program for a few hours straight, but at the same time I enjoyed trying to track down those little bugs and index errors and what-not that crept in while typing the commands.

It’s a scavenger hunt, academic contest, tabletop puzzle, and basketball game all rolled into one!