Re: vector derivatives
- To: mathgroup at smc.vnet.net
- Subject: [mg70325] Re: [mg70289] vector derivatives
- From: "Chris Chiasson" <chris at chiasson.name>
- Date: Fri, 13 Oct 2006 01:30:10 -0400 (EDT)
- References: <200610120936.FAA04558@smc.vnet.net>
the tensorial package can help with tensors and linear algebra...
it seems like you need to use something like Outer if you want
pairwise operations
I can't really read the notation you are using in the first part of your email
it might be easier for you to define a module that will, say,
caluclate the (vector) force given a potential function and two
(vector) positions
then you could use Outer to calculate the force on each particle due
to its interaction with all the other particles when given a list of
(vector) particle coordinates
you could use superposition to (vector) sum up all the forces
On 10/12/06, rych <rychphd at gmail.com> wrote:
> I have (n) particles {ri} (ri- radius-vectors) with pairwise
> interaction potential (u) depending on the distance only
> (|rij|=|ri-rj|) (in d=3 Euclidean space). I'd like Mathematica to find
> the force, f_i and higher partial derivatives of the potential energy
> U:
> U = 0.5 \sum_i,j u(|rij|)
> -fk= \nabla_k U= \sum_j u`(|rkj|) rkj/|rkj|
> \nabla . \nablaU = \sum_i,j u``(|rij|)+(d-1)u`(|rij|)/|rij|
> and so on.
>
> And I'd like to have the results in that compact form. I start writing
> an exersise like this in Mathematica, - not pretty at all and the
> output is far from what I want.
> r1 = {a1, b1, c1}; r2 = {a2, b2, c2};
> l[r12_List] := Sqrt[r12 . r12]
> u[r1_List, r2_List] := l[r1 - r2]^n
> D[l[r1 - r2], r1]
> D[u[r1, r2], r1]
>
> What is the proper way of doing such a task in Mathematica (and in
> mathematics)? If the Tensorial package is the way to go, I don't mind
> learning it, metric tensors, differential forms and such.
> Thanks
> Igor
>
>
--
http://chris.chiasson.name/
- References:
- vector derivatives
- From: "rych" <rychphd@gmail.com>
- vector derivatives