@Sachin, here are some of the answers you sought.
>1. How do you plan to implement Gauss' theorem (divergence) and Stoke's
fundamental theorem of curl? I >am not talking about the actual
implementation here, I would like to have an idea about the API of the
>functions/methods that you plan to implement. I know this is a bit early
for such questions maybe, but I would >appreciate it if you clarify this
before I upload my proposal. Just a pointer this one.
I have not quite gotten to the point where I would think about integration
of vector fields. Right now, I am still trying to finalize an idea for
implementing a Vector class. I am pretty clear about how it will be
implemented; just some more fine tuning remains. As I had mentioned before,
I'll be taking up the idea for reference frames and world coordinate system
next; only after that, I'll move on to standard vector calculus operations.
However, in the meantime, I can think of a few things regarding your query.
Clearly, the integration for vector fields is going to be implemented in a
fundamentally different way; in the Vector class at least. This class will
convert the integrals into integrals over scalar functions and those can be
further evaluated by SymPy calculus core. Anyway, I think that we will have
an Integral class that we can use to represent integration over vector
field type integrands. Now, in this Integral class, we can implement the
basic theorems (Gauss, Stokes). So, we can have something like:
>>> x, y, z = symbols('x y z')
>>> c = CoordSys(basis_var='e', dim=3, type='rect')
>>> field = Vector( (y**2 + x, x**2 - y, x*y*z), (x, y, z), coord=c)
>>> integral = field.integrate( <values describing integral type - line,
surface, vol etc and ranges>)
# this is very rough and sketchy yet
>>> integral.convert_gauss()
Vector.Integral
So, the last line returns a new Vector.Integral object with changed
parameters - volume integral changers to surface for example. Again I'd
like to emphasize this: I have not gotten to thinking about this part in
detail. So, what I wrote above was just something that I though of quickly
and there is no reason to believe that this is what things would finally
look like.
And of course, since I haven't made this part concrete yet, I think I can
accommodate your demands without much difficulty.
Coming to point #2, yes, we will have a gradient function that can be used
to return the grad of a vector field. For the Vector API: I have given
thought to how vector fields will work internally. But, there's no API
design as of yet. Give me a two-three days and I'll post the APIs for
CoordSys (coordinate system) and the Vector class (which depends on a
coordinate system) here.
#3. Yes. I mentioned it in my last post. And as Raoul said, we can also
have a few more useful coordinate systems implemented too.
#4. Time-dependent fields. Ah now that is something I haven't really
thought about. But, as I see it, this shouldn't pose too many problems. We
can just have one more variable, say t, that we can use in definition of
vector fields. Just that this variable will not be differentiated with
respect to the coordinates. So I think that the Vector API will be such
that this will be automatically taken care of without needing to meddle
with the Vector class itself.
I hope that those answers were satisfactory for the time being. Also, I
again apologize for the slow pace; March has proven to be specially busy.
We have some holidays next week here in India so hopefully, I'll make some
good progress in that time.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.