Tuesday, July 16, 2013

GSoC Report Week 4

Week four is over, and it has been an exhaustive week. I had been working parallely on two instances of project, which are equally relevant.
One is to write a complete extended illustrative example, which involved simulating a three link conical pendulum.
The current work on this problem can be checked here:


The problem is a quick implementation of the whole project, and a very naive one. It has some dirty code, and some hacks, which would need addressing during the implementations in the actual project.

The example is in a stable state, and I have been able to produce static visualizations. With a small change in Javascripts. It can be readily converted to animations.
I have created some instances of classes, according API, with only basic functionality, which has helped in bringing the illustrative example(three link conical pendulum) to life.
The python part of the example is complete, as I have been able to create the JSON file containing the simulation data from the problem.
As far as javascript part is concerned, Only thing left is to animate the visualization by properly reading the simulation data from the JSON object and applying it to the static visualizations.
The simulation data is being stored in the form of a (4 by 4) transformation matrices, which are then mapped to a visualization frame.
the frame will be calling the animation matrices from the javascript side and render them.

There has been certain issues on converting the symbolic transformation matrices to the numpy, or numerical matrices. I tried using lambdify, but ran into some problems.It seems that lambdify doesnt work properly with the time dependent symbols, i.e it works fine on symbols like:
'a', but fails on 'a(t)'.

Right now for the example I am using SymPy's evalf method, with substitutions for the symbols.
But it is not considered as efficient as lambdify, so I need to figure out the way to resolve the problem.

The other part which I am working is to write the unittests for the project. It is getting a bit delayed,
and I am two or three days behind the stipulated timeline. I am hoping to cover it up in the coming two weeks, before the midterm evaluations.
The tests seems to be coming much easier, once I have done the three link pendulum example.
The example has helped me a lot in determining how different classes should be working, so I am a little more confident on the implementations.
It is also because I have already implemented the basic functionality of nearly all classes, I just need to flesh them out, provide some more functionality to them, and they would be ready to be merged into the  master.

In a nutshell, this week has been  a little exhaustive, but now I feel running towards my milestone at a much better pace.

Cheers

1 comment:

  1. Tarun,

    Are you using SymPy master for your development? Or some previous version? If you use SymPy master I think the lambdify will work fine due to this merged PR: https://github.com/sympy/sympy/pull/1920. If it doesn't work then you should report an issue so we can work on fixing it.

    ReplyDelete