Re: Curl and Div problems
- To: mathgroup at smc.vnet.net
- Subject: [mg115535] Re: Curl and Div problems
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Thu, 13 Jan 2011 03:30:59 -0500 (EST)
- References: <igjr0p$928$1@smc.vnet.net>
sean k wrote: > I'm having problems with VectorAnalysis package. > > Within the documentation center, the package loads and works fine. > > But in a notebook, it seems to highlight Curl in red and neither Div > or Curl works properly. > > Needs["VectorAnalysis`"] > > {D[x^2 y, x] + D[ x z, y] + D[ x^2 y^3, z]} > > Div[{x^2 y, x z, x^2 y^3}] > > gives different answers. > > {2 x y} > 0 > > > Curl[{x^2 y, x z, x^2 y^3}] > > gives > > {0,0,0} > > > I'm on windows vista home edition, 64 bit, Mathematica 8.0. > > Does anyone else have this problem? > > I think you missed to define the coordinate-variables: Needs["VectorAnalysis`"] In:= Coordinates[] Out= {Xx,Yy,Zz} These are the default coordinates Mathematica uses after loading the package. You will change them to In:= SetCoordinates[Cartesian[x,y,z]] Out= Cartesian[x,y,z] In:= Coordinates[] Out= {x,y,z} Now it works: field={x^2 y,x z,x^2 y^3}; In:= Div[field] Out= 2x y In:= Curl[field] Out= {-x+3x^2 y^3,-2x y^3,-x^2+z} Curl shows up in red on my machine too, but works as it should. Seems to be a little bug, introduced in v.8 -- _________________________________________________________________ Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de