GSoC 2012 Post 6
This has been a good week in terms of progress and clarity. In terms of completed code, I now have the entire suite of momenta functions working perfectly. The pull request that I linked to last week now has a series of commits. Several helpful comments were made in the PR; most of it had to with improving the readability of the docstrings and I’m extremely thankful for the time taken by everyone to review my work.
Onto the details of the commits now- I implemented methods to determine linear and angular momenta of both individual particles and rigidbodies. These are working well. As I said last week, I was having trouble figuring out how to deal with a system of bodies. Consequently, I was thrown off track for a bit where I tried to figure out how I would go about doing this without having to restructure the existing code. Sadly (when I think of the time I lost doing this but simultaneously glad that I figured it out eventually), the answer had been staring me in the face. Whenever anyone uses ‘mechanics’ to compute the equations of motion, they are required to set up a body list so all I had to do was tap into that. I ultimately wrote up a little procedure that computes both the momenta for a system of rigid bodies and/or particles. I then polished up the previous tests I had written and wrote some additional tests for the newer functionality. Overall, it was very satisfying to see the body of work that has been contributed, It will be a pretty useful tool when the time comes to implement the Newton-Euler method to determine the equations of motion, though I may not be the one to do it (at least not probably within this summer) as I plan to attack Lagrange’s method for equation derivation.
To that end, I spent some time this week trying to see how I would go about including Lagrange’s method. In my proposal, I have stated that the intention is to have Lagrange’s method for holonomic systems, but this is the more trivial case and is pretty well known to most dynamicists. I’m hoping that I can push the boundaries a little further and not be limited to just holonomic systems. The problem with the Lagrange approach is that it requires the determination of Lagrange multipliers whilst dealing with nonholonomic systems and this is not a method that is well documented in the classical textbooks. Finding material on this is a little tedious and I’m still uncertain about implementing this portion but I’m hopeful that it can be done.
So apart from the completion of code and a literature review on Lagrange, I have begun on a function to determine partial velocities and another for kinetic energies of particles and rigidbodies. These aren’t particularly hard but I’m constantly thinking of how I would go about using these functions when it comes to Lagrange’s equations of motion. (Another issue here is that there a couple ways to determine the equations of motion of holonomic systems even in Lagrange’s approach. One involves determining a Lagrangian and performing some operations on the Lagrangian and another approach involves determining just kinetic energies and generalized forces.) The coming week will lead to some clarity on that, it appears. I ill also be talking to my grad school advisor about this matter as I’m confident he will have more insight on this.
One thing that I have failed to talk about in my previous posts is the difficulty (read as ‘frustrations’) with using git. For someone with a pretty poor background in programming, the amount of jargon in python alone is hard to deal with. I remember when I was accustoming myself to git via the progit online book, it all seemed so easy. In the last few weeks, I have realized how much more harder it is to do the right things in the right order when you’re working on a real project and not on an example. Somwhow theory is always easier than practice. The frustrations that I had had lesser to with git and more to do with the fact that it was taking so long to master. But I took some solace after conversations with the other people in my lab who have worked on it when they said that it took them a while to get to grips with it. But nonetheless, I can see why it such an important tool. Over the last couple of weeks, I have gotten very familiar with not only the trivial aspects of making new branches and rebasing but also with the more powerful things like branching off of the right branches correctly and just in general better planning of projects. It was also also useful to learn that I could pull work from other people and collaborate on their work too.
One of the lessons that I have learned this week though is that I shouldn’t be worried about being a bit of a slow coder as everyone takes a while to get fast at things. What’s more important is to have ‘usable’ code. BUT I will be picking up the pace from here on, I believe. Python has definitely got me interested in programming like never before. All in all. a pretty good week, personally.