Re: Curl
- To: mathgroup at smc.vnet.net
- Subject: [mg30652] Re: Curl
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Mon, 3 Sep 2001 20:32:27 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <9msos5$plr$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, sorry for the delay -- a was on a conference. It was not clear what do you wish. For a n-dimesional vector field CurlN[f_List, x_List] := Module[{index, run, n = Length[x]}, index = {Sequence @@ Table[Unique[], {n - 2}], k, j}; run = {#, n} & /@ Drop[index, -2]; Table[ Sum[Signature[index]* D[f\[LeftDoubleBracket]j\[RightDoubleBracket], x\[LeftDoubleBracket]k\[RightDoubleBracket]], {k, n}, {j, n}], Evaluate[Sequence @@ run]] ] Should work. The sign is corrected by the order of k and j in index. Because the definition is \partial_{x_k} f_{j} k must be the first index in the index list. I mixed up the post-notation in D[f_j,x_k] where k come on the second position. Regards Jens Emilio Martin-Serrano Sobrino wrote: > > Hi, > > After the Jens-Peer's replay to the Carlo Gabrieli's posting > on (Generalize) Curl, I tried the Jens's implementation without > success and asked the group for valid examples. Since I did not get any > answer, I insisted myself by introducing some minor modifications into the > Jens's code. You can see the modifications by comparing both programs CurlN > (in the posting) and CurlN1 in this one. > > The fact is that I could not put CurlN to work and that my modification > (CurlN1) works well for the example below (for n==3) as you can easily see. > > In[1]:= epsilon[index__Integer] := Signature[{index}] > dpos[i_,n_]:= Table[If[k==i,1,0],{k,n}] > > CurlN1[f_List, x_List, n_Integer] := > Module[{index, run}, > index = {Sequence @@ Table[Unique[], {n - 2}], j, k}; > run = {#, n} & /@ Drop[index, -2]; > Table[ > Sum[(-epsilon[Sequence @@ index]) D[f[[j]],x[[k]]] dpos[j, n], {j, n}, > {k, n}], > Evaluate[Sequence @@ run] > ]] > In[2]:= curl=CurlN1[{x z^3,-2x^2 y z, 2y z^4},{x,y,z},3] > > In[3]:= Apply[Plus,#]&/@curl > . > > Any way, I could not check whether CurlN and CurlN1 are semantically > equivalents or not. But It seems that there is some semantic difference, as > for the minus sign in "(-)epsilon". The lack of this minus sign in CurlN > generates an inverted pattern of signs in the results I got in my tests. > > I would appreciate any comment on this. > > Regards > > Emilio > > ------------------------------------------------------------------ > This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of SchlumbergerSema. > If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. > ------------------------------------------------------------------