Why is ScalarPotential(2, 'MKS') any better than just 2?

Why do you need a subclass ScalarPotential? What advantages does it have
over just scalar field?

The detail about overloading the operators so it always returns scalar
potential seems good. _However_ I suspect that you are doing the same
mistake that I originally did with diffgeom. Given that there are
`BaseScalarFields` in `diffgeom`, can you guess why is there no
`ScalarField`? It is because this will duplicate the work - if anyway
scalar fields are build out of base scalar fields, why do we need a special
ScalarField object... Anyway, maybe I am wrong.

Concerning your other query: I agree, these objects should be per CoordSys,
not per Vector.


On 31 May 2013 17:17, Sachin Joglekar <srjoglekar...@gmail.com> wrote:

> 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.


Reply via email to