GSoC Proposal

178 views
Skip to first unread message

Sachin Joglekar

unread,
Mar 7, 2013, 1:58:24 PM3/7/13
to sy...@googlegroups.com
Hello everyone.
Sometime back, I had started working on a sub-module for sympy.physics on electrodynamics after getting a go-ahead from the mailing list. I did some work, but then could not complete it because of my other work commitments and coursework. It is obvious that building such a module from scratch will require some careful planning and development.
Considering the usefulness of sympy.physics.mechanics, something like sympy.physics.electrical or sympy.physics.electromagnetism would be a good addition to SymPy's existing physics module. 
The work I have done as of now can be seen at

I understand its just the tip of the iceberg, if I have to build a complete architecture for my idea. That is why, on encouragement from @asmeurer and @certik, I want to formally propose development of this module over the summer as a part of GSOC-2013. I plan to implement all basic concepts of electromagnetism like conservative fields, electro-magnetic interactions,dipoles, laws like Beer-Lambert's , etc. and if possible, move on to relativistic electromagnetism.

@moorepants, @gilbertgede, @hazelnusse, since you people have worked on the physics module before, I would like your take on this.

Jason Moore

unread,
Mar 7, 2013, 2:48:17 PM3/7/13
to sy...@googlegroups.com
Sachin,

It sounds like a great idea. Once you start writing up your proposal I can comment more. My understanding of electromagnetism is only from some electrical courses I did as an undergrad, so won't know much about the details. But if you can put your ideas into some paragraphs it will be easier to make some comments and suggestions.

I'm happy to support and help this package and it's integration with the mechanics package.


--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Stefan Krastanov

unread,
Mar 7, 2013, 2:50:40 PM3/7/13
to sy...@googlegroups.com
If I get the idea (which may not be the case), you will have to do a
lot of work on vector calculus for this to be useful in general. Do
you have any plans in that direction?

There is a module on which I worked last summer that is tangentially
concerned (diffgeom for differential geometry), which may be of use /
may be extended as part of the project.

If, on the other hand, I misunderstood, could you provide example
sympy session of what the suggested module would be able to do?

My worry is that the examples that you suggested are special cases
that may not be useful in general. For instance the Beer-Lambert's law
is just an exponential dampening which does not need it's dedicated
function unless it has some nice api to be coupled in more complex
problems.

Sachin Joglekar

unread,
Mar 7, 2013, 3:01:50 PM3/7/13
to sy...@googlegroups.com
@moorepants, I would be brushing up on my concepts on electromagnetism till summer so that I can work on this better. By the time I draft my proposal, I will have a good idea about how I would go about this exactly. From what I see, I would have to start pretty basic, like implementation of fields themselves, their own relations, their effect on mechanics of charged particles, etc. Based on my knowledge, a lot of vector calculus would be required in this module so I will definitely have to look at your work, @Stefan. I will start working on my proposal in one or two weeks time. I would like your inputs on it so that it seems plausible and concrete.

Aaron Meurer

unread,
Mar 7, 2013, 4:57:08 PM3/7/13
to sy...@googlegroups.com
Great. You may want to write your proposal on the wiki (see how other
students have done this in the previous years). This will make it easy
for us to review. Otherwise, if you upload a document as an
attachment to the mailing list, or just post it to the mailing list,
it can be hard to keep track of what it the latest version and so on
and so forth.

Aaron Meurer

Sachin Joglekar

unread,
Mar 8, 2013, 1:31:09 PM3/8/13
to sy...@googlegroups.com
I quite like Stefan's idea of a good API to the electrodynamics module, once I am done building the infrastructure needed. How about something like a sandbox?
I could do something like

S = new SandBox()
S.add(ElectricField1)
S.add(MagneticField1)
S.add(ChargedParticle1)

In this case, ChargedParticle1's velocities and accelerations would be affected by the presence of ElectricField1 and MagneticField1, and would thus vary with respect to time and position.I could try and also implement something like

ElectricField.changeVector(5 * R.x)
S.updateComponents()

Ofcourse the actual API would be much more detailed than this one, but the idea would be something similar. We could also add current-carrying wires along lines/curves, dipoles, charged bodies, etc.

Sachin Joglekar

unread,
Mar 9, 2013, 2:38:15 AM3/9/13
to sy...@googlegroups.com
@moorepants, would like your input on the API idea. I want to finalize my entire project idea before I start with my proposal.
@asmeurer, do you think I could get a mentor on this, considering no work has been done in sympy in this direction till now?

Aaron Meurer

unread,
Mar 9, 2013, 1:29:37 PM3/9/13
to sy...@googlegroups.com
We probably can. Several of the mentors are physicists. I wouldn't worry too much about it. If we like the project, we'll find someone to mentor it. 

Aaron Meurer 


On Saturday, March 9, 2013, Sachin Joglekar wrote:
@moorepants, would like your input on the API idea. I want to finalize my entire project idea before I start with my proposal.
@asmeurer, do you think I could get a mentor on this, considering no work has been done in sympy in this direction till now?

--

Jason Moore

unread,
Mar 10, 2013, 2:08:08 PM3/10/13
to sy...@googlegroups.com
Sachin,

The api you've suggested is a nice goal. We have a similar goal for the mechanics module. i.e. we'd like to have a "world/system" class and add rigid bodies to it, then define those bodies' relationships and finally generate the equations of motion for that world/system. We started by creating the basic functionality for defining systems in a rigorous mathematical fashion and only now are we ready to write this next layer. I'd suggest thinking more about the core of the code that would be needed to implement your more generic api. It has taken us three motivated GSoC students just to get the core mostly to where it needs to be, so you may need to scope your project to several smaller interconnected goals than shooting for that grand final api (though it should be considered so that you design the core functionality with it in mind).


On Fri, Mar 8, 2013 at 11:38 PM, Sachin Joglekar <srjogl...@gmail.com> wrote:
@moorepants, would like your input on the API idea. I want to finalize my entire project idea before I start with my proposal.
@asmeurer, do you think I could get a mentor on this, considering no work has been done in sympy in this direction till now?

--

Sachin Joglekar

unread,
Mar 10, 2013, 2:18:34 PM3/10/13
to sy...@googlegroups.com
Well, I have to agree with you. For any branch of physics, a sandbox world for it is a long way to go.
From what I see, even the development of a comprehensive ElectroMagneticField would take considerable thought and planning, especially considering the implementation of concepts like time and space varying fields, flux, potentials, current densities etc. After that, I plan to create classes for simple electromagnetic bodies like magnets, particle charges, dipoles and wires. Defining the interactions and the mechanics of these bodies with the EM fields would be the next phase.
Please let me know if you have any suggestions/ inputs regarding these ideas.
 

Stefan Krastanov

unread,
Mar 10, 2013, 2:19:33 PM3/10/13
to sy...@googlegroups.com
There might be serious issues with this approach. Most of sympy tries
to have selfcontained objects. This is quite important because of
(among other things):

- having consistent hashes and __eq__ behavior
- actually rebuilding these objects on tree traversal

The `mechanics` module uses the approach that you suggested
successfully, however I do not think it was ever discussed whether it
is a good style within sympy as a whole. It certainly clashes with the
style of the rest of the codebase.

For the mechanics module itself this is not a problem, however if you
are going to extend it to other modules more thought should be given
to it.

A way to refactor this would be for the "world" object to be an
argument for the "entities within the world" objects. Like for
instance the relation between hilbert spaces and kets in quantum or
between manifold and field in diffgeom.

Sachin Joglekar

unread,
Mar 10, 2013, 2:27:33 PM3/10/13
to sy...@googlegroups.com
@Stefan, that could be a good way to do it, maintaining the consistency with the rest of sympy's architecture. We could have something like
p = ChargedParticle('P', 3)   (where 3 is the charge possessed by the particle)
p.set_pos(O, R*x)
p.addtoWorld(world1)

The last line could update the kinematics of p according to the objects linked to world1, while those objects would themselves also undergo changes if necessary. However, keeping track of the ReferenceFrames would become something of an issue.
In any case, addition of the 'world' concept, though distant atleast for my project, would be a very powerful simulation tool for sympy users.

Gilbert Gede

unread,
Mar 10, 2013, 5:16:30 PM3/10/13
to sy...@googlegroups.com
This is a good discussion. As Jason mentioned, us mechanics people have been discussing a bigger "world" environment lately. Specifically, we've been trying to understand where analytical formulations fit in a world of numerical simulation. Unfortunately, and unsurprisingly, we haven't made much definite progress...

Two things I would recommend are:
1) Writing out electrodynamics problems by hand, and identifying the parts that are mathematical objects (e.g., objects you do algebraic operations on) and the parts that are abstract concepts that make the math easier. For mechanics, an example would be Vectors (which you can add/sub/mul/etc) and ReferenceFrame (which stores information making Vector operations easier).
2) Figuring out "real-world" use cases. We've been trying to do this, as seen here: http://www.pydy.org/roadmap.

Doing these might help you understand where to draw the line between things that go in a symbolic library (SymPy) and an external library. I feel happy with what is in mechanics now (in terms of functionality), and most likely additional (significant) functionality we add will be outside of SymPy.

Also, what references/texts do you use for electrodynamics?

-Gilbert

Sachin Joglekar

unread,
Mar 11, 2013, 1:51:45 AM3/11/13
to sy...@googlegroups.com
@gilbertgede, thanks for your input, especially the idea of writing out basic electrodynamics problems in 'programming mode' to understand what classes and infrastructure I would need, to build the core of sympy.physics.electromagnetism. If possible for you, please have a look at the concepts that I have mentioned in this thread, which I plan to implement and give your suggestions. Considering your level of understanding of the physics module, you could better judge the feasibility of the concepts. 
As for the reference texts, I plan to implement electrostatics and magnetostatics based on Prof J Norbury's text 'Classical Electrodynamics for Undergraduates' and 'Electromagnetic Field theory' by Bo Thide. These are the texts that I plan to study and understand before summer. I would prefer to take inspiration for electrodynamics(classical and relativistic) from Griffith's book 'Introduction to electrodynamics'.

Sachin Joglekar

unread,
Apr 4, 2013, 11:43:08 AM4/4/13
to sy...@googlegroups.com
Hello everyone. Sorry about being out of touch for some time now. I have worked on my project idea to quite some extent and I am done with the first draft of the API I plan to implement. I have put up my proposal on the wiki, the link is-

I have tried to be as clear about my goals and theory as possible, but I would like reviews of the SymPy community for the same.
Aaron, Jason, Stefan, Gilbert I would like your suggestions for my proposal so that I can get it fine tuned by April 22.

Sachin Joglekar

unread,
Apr 9, 2013, 12:25:18 AM4/9/13
to sy...@googlegroups.com
I don't mean to bug you guys, but since my project idea is new and not in the current list of ideas for SymPy, I would like some general inputs from the community about my proposal. Could somebody from sympy.physics or the potential mentors please review it? And Aaron, does it meet the Application Template needs?

Aaron Meurer

unread,
Apr 9, 2013, 12:57:10 AM4/9/13
to sy...@googlegroups.com
The application template is more of a guide than a strict template.
The main things that I am a stickler about are the metadata type
things at the top (various usernames, and also the list of
contributions), because that is information that is difficult for me
to find on my own. But it looks like you've done an OK job with that.
I guess you should also include your Google Code username.

I didn't read the full proposal yet, because I'm busy with homework,
and I don't really know the physics anyway.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy?hl=en-US.

Sachin Joglekar

unread,
Apr 9, 2013, 1:10:53 AM4/9/13
to sy...@googlegroups.com
Google Code username will be what I will get after registering on Google Melange if I am not wrong? Are students allowed to do that now?


You received this message because you are subscribed to a topic in the Google Groups "sympy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sympy/GA6glbpjTXM/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to sympy+un...@googlegroups.com.

Aaron Meurer

unread,
Apr 9, 2013, 1:23:15 AM4/9/13
to sy...@googlegroups.com
No, that's your username on the Google Code issue tracker.

Aaron Meurer

On Mon, Apr 8, 2013 at 11:10 PM, Sachin Joglekar

Sachin Joglekar

unread,
Apr 9, 2013, 1:28:17 AM4/9/13
to sy...@googlegroups.com
Oh. Its the same as my email then. I will add it nonetheless.

Aaron Meurer

unread,
Apr 9, 2013, 2:02:28 AM4/9/13
to sy...@googlegroups.com
Yes, please do. Last year there were about 25 proposals. It's
impossible for me to maintain a mental mapping of {real name, GitHub
username, Google Code username, IRC nickname, google-melange link_id}
for 25 people (and by the way, it's even harder when one or more of
them are completely different from the others).

Aaron Meurer

On Mon, Apr 8, 2013 at 11:28 PM, Sachin Joglekar
Reply all
Reply to author
Forward
0 new messages