Vector analysis in mathematica

Click For Summary
The user is attempting vector analysis in Mathematica 6, using the VectorAnalysis package and Cartesian coordinates. While the grad operator functions correctly, other operations like Cross and Dot return the input instead of the expected results. The user initially misused the Cross function but still faced issues even after correcting it. They found a workaround by specifying vector components explicitly but are seeking a more efficient method. The discussion highlights a potential misunderstanding of how Mathematica handles vector operations with variable names.
big-ted
Messages
4
Reaction score
0
Hi all,

I'm trying to do some vector analysis in Mathematica 6. I have the vector analysis package loaded via: << VectorAnalysis`

I'm working in the default cartesian coordinate system, but just to be on the safe side I have set: SetCoordinates[Cartesian]

The grad operator seems to work ok, as in the example in the help file:

Grad[2 Xx^2 + Yy]
gives
{4 Xx, 1, 0}

But anything else seems to just return the input. Eg:

Cross[Xx,Yy]
gives
Xx\[Cross]Yy

But I know this should be Zz!

Same for Dot, Curl etc. I'm not too experienced with Mathematica. Hopefully someone can point out a simple mistake I'm making!

Thanks in advance!
 
Last edited:
Mathematics news on Phys.org
Cross is not defined
try
CrossProduct[Xx,Yy]
 
Whoops, that was just a mistake in my copying code over to the forum. I had it as CrossProduct. Still no dice.

I managed to do what I needed to do by specifying all the components explicitly. Ie:
x = {1,0,0}; etc.

It seems there should be a better way of doing this though, else what would even be the purpose of Mathematica recognising the variable names Xx, Yy, Zz as "special"?
 
Last edited:
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
659
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
6
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K