Skip to content

GSoC 2012 Post 6

June 23, 2012

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.


From → Uncategorized

  1. Angadh,

    Gilbert must have partial velocities alread implemented. It may be wrapped up in his Kane class. My suggestion would be to find Gilbert’s code, extract what he has into independent functions and/or classes, then set up Kane and your upcoming Lagrange to make use of the generic partial velocity functionality.


  2. Yeah, don’t worry about git difficulties. Literally everybody has difficulty with it (or with whatever VCS they learned first). I think the problem is that it’s a new kind of abstraction for most people. For me, there was about a couple of months or so until I hit a point where it all “clicked”. At that point, I really understood exactly what was happening with everything. From then on, if I want to do anything with git, I just have to think of what I want to do, and what commands will get me that result.

    So my best advice is to try to understand the abstraction of git, not so much the commands. Understand what a commit is and how it works in relation to other commits. Then, when you realize what simple actions the various commands do, you should get the whole picture.

    And one last piece of advice: ignore anything you read about the staging area. That is an advanced feature that is too often presented early on as if it weren’t. It will only serve to confuse you. Once you understand everything else, you can learn what that is and how it can be helpful to you.

    • angadhn permalink

      Yeah. Progit has been an extremely useful resource, but I guess I was trying to fill my head with too much by going through a lot of it continuously and often found myself returning to it (still do actually). Also, it’s easy to feel like you’re getting a hang of things following his examples but it I guess I found my self in a soup when it came to a ‘real world’ application of it.
      I will admit that I was trying to program (pun intended) myself into following a sequence of git commands. I thought that might be the failsafe way but like you said I’m better off figuring out what I really need to do. Rebasing interactively has been the new thing that I have struggled to get my head around but I know with repetitions I will understand it better.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: