Physics[Vectors][diff] - differentiate expressions taking into account the geometrical relations between curvilinear unit vectors and coordinates of different types
diff(A, x1, x2, ...)
an algebraic expression
x1, x2, ...
names or functions representing the differentiation variables
optional, default value is true, to take into account the geometrical relation between curvilinear coordinates and unit vectors even after setting this option to false using Setup.
The diff command of Vectors is the same as the diff command of Physics, but for two additional things:
it will take into account the geometrical relation between cartesian, cylindrical and spherical coordinates, as well as the coordinate dependence of curvilinear unit vectors. Example: x=ρ⁢cos⁡φ, so diff(x, rho) returns cos⁡φ even when has(x, rho) returns false.
it will take into account any functional dependency of the geometrical coordinates and unit vectors found in the derivand. Example: when the derivand has x⁡t the formula used is x⁡t=ρ⁡t⁢cos⁡φ⁡t so diff(x(t), rho) (also diff(x(t), rho(t))) returns cos⁡φ⁡t.
Although taking into account relations between geometrical coordinates, unit vectors and their functional dependency, is natural when working with vectors, you can turn OFF these two differences between Physics[Vectors][diff] and Physics[diff] using the Setup command, entering Setup(geometricdifferentiation = false). In such a case you can still differentiate taking into account the geometrical relation between curvilinear coordinates unit vectors by passing the optional argument geometricdifferentiation.
The %diff is the inert form of diff, that is: it represents the same mathematical operation while holding the operation unperformed. To activate the operation use value.
The result of diff is always expressed in the coordinate system of the differentiation variable. When that is ambiguous (e.g. z may be cartesian or cylindrical), the ambiguity is resolved looking at the derivand, whether it is a cartesian or cylindrical vector, and when it is neither, then cartesian coordinates are used. The same approach is used when the differentiation variable is φ, that could be cylindrical or spherical.
In the derivand, the cylindrical and spherical coordinates and related unit vectors can have functional dependency, say as in ρ⁡t, or for a unit vector, _ρ⁡φ⁡t, and the differentiation variables can be names or functions, as it is the case when using the Physics[diff] command. This permits computing things for instance like ⅆⅆt_ρ⁡φ⁡t taking into account that ∂∂φ_ρ=_φ.
The computation of diff(A, q) is performed as follows.
If q does not belong to φ,r,ρ,θ,x,y,z (the geometrical coordinates - see conventions), then send the task to Physics[diff] returning Physics:−diff⁡a,q.
Otherwise, if A is a projected vector then
A is reprojected in the cartesian orthonormal basis (using ChangeBasis), where unit vectors are constant;
a change of variables if performed on the components of A (using dchange), in order to express A in the coordinate system to which q belongs;
the differentiation is performed using the standard Physics[diff];
the result is reprojected into the original orthonormal basis and returned.
If A is a non-projected vector or a scalar function, the task is restricted to steps 2. and 3. above.
For the conventions about the geometrical coordinates and vectors see Identify
The radial cylindrical unit vector
Note the difference when you change the order in which derivatives are computed in a 2nd order derivative
Curvilinear coordinates and related unit vectors can have functional dependency, and so can the differentiation variable. Consider for instance the radial unit vector ρ∧⁢ in cylindrical coordinates as a function of the polar angle φ which in turn is a function of t
The derivative with respect to φ⁡t takes into account the geometrical dependency of ρ∧⁢ with respect to φ, while keeping, in the result, the dependency with respect to t of the derivand
The derivative of ρ∧⁢⁡φ⁡t with respect to t uses the chain rule taking the result above into account, hence
You can turn OFF geometric differentiation using Setup
* Partial match of 'geom' against keyword 'geometricdifferentiation'
So now, for example, the differentiation above returns
and differentiating ρ∧⁢ with respect to x returns 0 instead of eq.(4)
You can still use geometric differentiation by passing the optional argument geometricdifferentiation
Identify, operations, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Physics/Vectors, Physics[diff]
The Physics[Vectors][diff] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
Download Help Document
What kind of issue would you like to report? (Optional)