![]() Also, if you were working with different functions in different coordinate systems, converting everything to Cartesian makes it possible to work with them all together. (Of course, with spherical and cylindrical coordinates, Mathematica is perfectly capable of graphing them "as-is", but that isn't true about other more esoteric coordinate systems. ![]() Which method you use depends on what you are trying to do. ![]() You can get a much nicer looking gradient by taking it directly in spherical:īut this gives you the gradient vector in terms of the unit vectors in the ρ, φ, and θ directions (and remember that the unit vectors in the φ and θ directions rotate, depending on what angle they are at, so they are not all parallel to each other). This gives you the gradient in terms of your standard i, j, and k unit vectors. Notice the liberal use of FullSimplify in this work it is used to automatically apply things like trig identities, etc. Also, notice that I am taking this opportunity to rename the variables so they fit the ones we are used to (though they still need to be entered in :įrom then on, you would treat this as a standard Cartesian function (admittedly ugly). The safe thing to do is to always specify the coordinate system when you perform a computation. Warning: The default coordinate system is now set to spherical until you change it again. Of course, a more interesting question is, how do these things work in other coordinate systems? Let's look at the gradient in spherical coordinates: Thus, it is extremely important that, before you start doing computations in any coordinate system using Mathematica's built-in functions, you are aware of what variables Mathematica is expecting (or you set them like you want them). Or, if you need to do a lot of work in Cartesian coordinates with your preferred variables, you could set the default coordinate system this way: Mathematica Programming » Functional Programming FixedPoint and Gradients Why is this here. The other way is to tell Mathematica to use our preferred variables: Personally, I find this a bit bizarre to try to read. That means that when we took the gradient above, it treated x, y, and z as constants. So, as far as Mathematica is concerned, the variables in this coordinate system are Xx, Yy, and Zz (strange but true). This gradient was taken in the default coordinate system (Cartesian), but it was taken with the Mathematica default variables for that coordinate system. ![]() So, what is going on? This goes back to the issue I mentioned in the introduction. The gradient of the given functions is certainly not the 0 vector. There are also built-in functions to find the gradient, divergence, and curl (among other things): We consider the dynamics of vector fields on three-manifolds which are con- strained to lie within a plane field, such as occurs in nonholonomic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |