If I am going to use ScalarPotential to denote the Potential of a conservative field, then adding just '2' to it won't make sense. Or maybe you mean something like ScalarPotential(2, 'MKS'). In this case, the overloaded operators will ensure that things like '2*scalar_potential' or 'scalar_potential1 + scalar_potential2' all get converted to another ScalarPotential instance. Or maybe using just a generic 'ScalarField' class should suffice as you say. In that case, even the magnetic vector potential could be denoted by an instance of 'Vector' (as per Prasoon's proposal) As you suggest, I will look into the current diffgeom module. By the way, I would appreciate it if you could answer my other query- about the association of coordinate variables for every Vector instance.
On Fri, May 31, 2013 at 7:08 PM, Stefan Krastanov < krastanov.ste...@gmail.com> wrote: > There is one issue with what you suggest. Maybe there is a nice solution, > but I do not see it. So here is my question: > > What if I want the superposition of two `ScalarPotential` fields? Or what > If I want to multiply a `ScalarPotential` by (say) 2. Or add 2 to the > `ScalarPotential`. > > By the way, both of you might find useful stuff in the `diffgeom` module. > The code is extremely short, so it will not be too hard to understand. I > would suggest that you play a bit with the already present implementation > of R3. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.