Vector analysis in mathematica

Click For Summary
SUMMARY

The discussion centers on performing vector analysis using Mathematica 6, specifically with the VectorAnalysis package. The user successfully utilizes the Grad operator but encounters issues with the Cross and Dot products, which return the input instead of the expected results. The user resolves the problem by explicitly defining vector components but seeks a more efficient method for handling vector operations with named variables like Xx, Yy, and Zz.

PREREQUISITES
  • Familiarity with Mathematica 6 and its syntax
  • Understanding of vector analysis concepts such as gradient, cross product, and dot product
  • Knowledge of coordinate systems, particularly Cartesian coordinates
  • Experience with loading and using packages in Mathematica
NEXT STEPS
  • Explore the VectorAnalysis documentation in Mathematica 6 for advanced vector operations
  • Learn about the use of named variables in Mathematica for vector representation
  • Investigate alternative methods for vector calculations, such as using the CrossProduct function correctly
  • Study examples of vector analysis in Mathematica to understand best practices
USEFUL FOR

Mathematica users, students in physics or engineering, and anyone interested in vector analysis and computational mathematics.

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:
Physics 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:

Similar threads

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