GSoC, Week 12

Well, this past week was the final “full” week of the 2011 Google Summer of Code. The ‘soft’ pencils down date is Monday.

This week, I mostly rewrote interfaces to some functions and classes. I should probably go back through previous blog posts and update those to show how they are different, so if anyone comes across this in the future, there won’t be example code which doesn’t work. I also tried to finish up the documentation this week. I decided a little late in the week to add another page, a “advanced/future interfaces” page, to describe how some functions/classes have different interfaces (and their advantages/disadvantages) as well as some discussed extensions to the current interface (that probably won’t be implemented right now). Some of these things were: more ways to access basis vectors, more printing options, and more ways to initialize the Kane object. Like I said, I don’t think I’ll be able to implement these now. I think I’ll try and do those three things this Fall though.

I also went through an example of bringing non-contributing forces into evidence (I discussed this topic a little in last week’s blog post). With the changes to the Kane interface it has ended up working out quite nicely. I put some code for this into the examples section, so hopefully it will be relatively easy for others to figure out. I didn’t make as much progress as I’d like with the code output function, but I think it can do an adequate job at the moment. I also spent most of a day rebasing all of my code of the latest master. I’m not sure what I did wrong, but somehow, I managed to get double commits again, so I took care of this. I think it might have been how I branched, rebased on one branch, then merged? It took some time to sort out.

I see there being two more things to do. The first is updating the images I have in the documentation; they’re all hand-drawn and of low quality. I plan on spending a little time this weekend on that, as well as Monday. The other thing is updating my pull request, getting others to look at it, and making necessary changes (and hopefully during this time, I’ll be able to check out other people’s pull requests and help them). Working with the pull request will probably take longer than updating the images…

Anyways, this is the last required blog post, but I think I’ll do at least one more as part of the Summer of Code, to wrap things up, and maybe introduce one more example.

Advertisements

GSoC, Week 11

Well, it looks like there is a little over 1 full week left. This week’s post probably won’t be too long. I have a list of the last few things left to work on. The last few (big) pieces are: finishing code output, making sure you can bring non-contributing forces into evidence, and documentation work.

Finishing the code output is fairly straight forward; there needs to be some thought given to: output quantities, time to write to file, correct use of cse(), and C code output. I already have code which writes to a file MATLAB or SciPy code for numerical integration, with an option to use cse() on the expressions. Using cse() makes it take longer to generate the code, but the code can execute significantly faster (especially with the bike, where there are a few hundred “common sub-expressions”). Writing to a file unfortunately seems to cost a similar amount of time as printing to the screen; in the case of the bike, a few minutes. There also needs to be some though of how to handle output quantities. When numerically integrating equations of motion, it’s common to look at things like total energy, or a body’s angular momentum, etc. A nice, clean way to work these into the integration would be ideal. There is also the issue of dealing with things like matrices as part of the code output; one might want to output a matrix for doing animations. Deciding on how to accept a matrix and format it for output also needs to be done.

One of the advantages of Kane’s Method is that “non-contributing forces” do not come into the equations of motion. Non-contributing forces are things like normal forces, contact (but not friction forces) such as pinned or rolling connections, along with some others. Unfortunately, this can also be a disadvantage of Kane’s Method; frequently one wants to know the value of these forces, in cases like: checking that normal forces do not go negative, calculating friction forces, joint constraint forces, etc. There is a way of using Kane’s Method which involves introducing “auxiliary speeds” and “fictitious forces”; the auxiliary speeds are defined as zero, additional equations are introduced, and then the forces are solved for (in terms of the “real” speeds).  I need to go through this to make sure my code is compatible with it; additionally, I’ve never done this for a system with non-holonomic constraints though, so I’ll have to check this out too.

Finally I’m finishing up the documentation. I have to go through and check docstring and doctest coverage; for some functions I don’t know if a doctest makes sense, such as generating a file from the code output, and I’m not sure what to do here, so I’ll have to look into this. Also, I have to finish the sphinx-documentation; most of it is done, but I need to go through and make sure I’ve covered some of the newer things I’ve added.

I hope by the end of next week to sort out my branches; right now they’re a little messy; I want to make them a little more organized. I’m planning on going back to having just a pydy branch, and a pydy pull branch. I’ll just work with the pydy-pull brach this time. Previously I made that branch, continued development on pydy, but also made corrections to pydy-pul in request to people’s comments. With development “stopping”, I think that will make things a bit less confusing by just working with issues on the pydy-pull branch.