nmacsai

205 Reputation

8 Badges

3 years, 205 days

MaplePrimes Activity


These are Posts that have been published by nmacsai

Major deficiency in Physics[Vectors]; Distinct sets of basis vectors are not recognized!

You can't define vectors in alternative bases like: {\hat{i}',\hat{j}',\hat{k}'} or {\hat{i}_{1},\hat{j}_{2},\hat{k}_{3}}.

This deficiency has been around for a while. I have found other posts regarding this problem.

The deficiency greatly reduces the allowable calculations with Physics[Vector].

Are there any plans to fix this?

Here is my example which shows this deficiency in more detail.

physics_vectors_and_multiple_unit_vectors.mw
 

restart

NULL

NULL

with(Physics[Vectors])

[`&x`, `+`, `.`, Assume, ChangeBasis, ChangeCoordinates, CompactDisplay, Component, Curl, DirectionalDiff, Divergence, Gradient, Identify, Laplacian, Nabla, Norm, ParametrizeCurve, ParametrizeSurface, ParametrizeVolume, Setup, Simplify, `^`, diff, int]

(1)

NULL

Crucial Deficiency in Physics[Vectors]

 

NULL

I can only guess the purpose of the Physics[Vectors] package from reviewing it's corresponding help documentation. My interpretation of the documentation leads me to believe that the package is best used for generating vector equation formulas in different coordinate bases of a SINGLE coordinate system.

 

This means one can easily generate position vector expressions such as:

 

r_ = _i*x+_j*y+_k*z

r_ = _i*x+_j*y+_k*z

(1.1)

Cylindrical Position Vector

 

The position vector in a cylindrical basis is given by:

 

r_ = ChangeBasis(rhs(r_ = _i*x+_j*y+_k*z), 2)

r_ = (x*cos(phi)+y*sin(phi))*_rho+(cos(phi)*y-sin(phi)*x)*_phi+z*_k

(1.1.1)

r_ = ChangeBasis(rhs(r_ = _i*x+_j*y+_k*z), 2, alsocomponents)

r_ = _k*z+_rho*rho

(1.1.2)

NULL

NULLNULLNULL

Spherical Position Vector

 

NULL

r_ = ChangeBasis(rhs(r_ = _i*x+_j*y+_k*z), 3)

r_ = (y*sin(phi)*sin(theta)+x*sin(theta)*cos(phi)+z*cos(theta))*_r+(y*sin(phi)*cos(theta)+x*cos(phi)*cos(theta)-z*sin(theta))*_theta+(cos(phi)*y-sin(phi)*x)*_phi

(1.2.1)

r_ = ChangeBasis(rhs(r_ = _i*x+_j*y+_k*z), 3, alsocomponents)

r_ = r*_r

(1.2.2)

NULL

NULL

As is known from the vector analysis of curvilinear coordinate systems the basis vectors can depend on the coordinates in question.

 

In cylindrical, the basis vectors are

 

_rho = ChangeBasis(_rho, 1)

_rho = _i*cos(phi)+sin(phi)*_j

(1.2)

_phi = ChangeBasis(_phi, 1)

_phi = -sin(phi)*_i+cos(phi)*_j

(1.3)

and in spherical, the basis vectors are

 

_r = ChangeBasis(_r, 1)

_r = sin(theta)*cos(phi)*_i+sin(theta)*sin(phi)*_j+cos(theta)*_k

(1.4)

_theta = ChangeBasis(_theta, 1)

_theta = cos(theta)*cos(phi)*_i+cos(theta)*sin(phi)*_j-sin(theta)*_k

(1.5)

_phi = ChangeBasis(_phi, 1)

_phi = -sin(phi)*_i+cos(phi)*_j

(1.6)

NULL

NULL

NULL

Example of this Deficiency using Biot-Savart Law

 

NULL

Biot-Savart law can be used to calculate a magnetic field due to a current carrying wire. The deficiency in question can be observed by explicity constructing the integrand in the Biot-Savart integral defined below.

NULL

NULL

NULL

In electrodynamics, quantum mechanics and applied mathematics, it is common practice to define a position of observation by a vector `#mover(mi("r"),mo("→"))` and a position of the source responsible for generating the field by a vector diff(`#mover(mi("r"),mo("→"))`(x), x).

 

It is just as common to define the difference in these vectors as

 

l_ = r_-(diff(r(x), x))*_

l_ = r_-`r'_`

(1.3.1)

and thus

 

dl_ = dr_-(diff(dr(x), x))*_

dl_ = dr_-`dr'_`

(1.3.2)

as found in the integrand of the Biot-Savart integral.

NULL

It suffices to consider `#mover(mi("l"),mo("→"))` = `#mover(mi("r"),mo("→"))`-`#mover(mi("r'"),mo("→"))` in a cylindrical basis for this argument.

 

The observation position is:

 

`#mover(mi("r"),mo("→"))` = rho*`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`+z*`#mover(mi("k"),mo("∧"))`

NULL

The source position is:

 

diff(`#mover(mi("r"),mo("→"))`(x), x) = (diff(z(x), x))*(diff(`#mover(mi("k"),mo("∧"))`(x), x))+(diff(rho(x), x))*(diff(`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`(x), x))

NULL

`#mover(mi("l"),mo("→"))` = `#mover(mi("r"),mo("→"))`-(diff(`#mover(mi("r"),mo("→"))`(x), x)) and `#mover(mi("r"),mo("→"))`-(diff(`#mover(mi("r"),mo("→"))`(x), x)) = z(x)*`#mover(mi("k"),mo("∧"))`-(diff(z(x), x))*(diff(`#mover(mi("k"),mo("∧"))`(x), x))+rho*`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`-(diff(rho(x), x))*(diff(`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`(x), x))

NULL

The deficiency in question arises because MAPLE cannot define multiple unit vectors in distinct bases such as {`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`, diff(`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`(x), x)} or {`#mscripts(mi("ρ",fontstyle = "normal"),mn("1"),none(),none(),mo("∧"),none(),none())`, `#mscripts(mi("ρ",fontstyle = "normal"),mn("2"),none(),none(),mo("∧"),none(),none())`}.  These pairs of unit vectors arise naturally, as shown above in Biot-Savart law.

NULL

If we look at `#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))` and  diff(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`(x), x) generally, they look like:

NULL

`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))` = `#mover(mi("i"),mo("∧"))`*cos(phi)+sin(phi)*`#mover(mi("j"),mo("∧"))`

NULL

diff(`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`(x), x) = (diff(`#mover(mi("i"),mo("∧"))`(x), x))*cos(diff(phi(x), x))+sin(diff(phi(x), x))*(diff(`#mover(mi("j"),mo("∧"))`(x), x))

NULL

If the bases vectors {`#mover(mi("i"),mo("∧"))`, `#mover(mi("j"),mo("∧"))`, `#mover(mi("k"),mo("∧"))`} and {diff(`#mover(mi("i"),mo("∧"))`(x), x), diff(`#mover(mi("j"),mo("∧"))`(x), x), diff(`#mover(mi("k"),mo("∧"))`(x), x)} are Cartesian and are not related related through rotations so that

NULL

"(i)*i' =(|i|)*|i'|*cos(0)=1"``NULL

NULL

"(j)*(j)' =(|j|)*|(j)'|*cos(0)=1"NULL

NULL

"(k)*(k)' =(|k|)*|(k)'|*cos(0)=1 "

NULL

and so,NULL

 

`#mover(mi("i"),mo("ˆ"))` = diff(`#mover(mi("i"),mo("ˆ"))`(x), x)

NULL

`#mover(mi("j"),mo("ˆ"))` = diff(`#mover(mi("j"),mo("ˆ"))`(x), x)

NULL

`#mover(mi("k"),mo("ˆ"))` = diff(`#mover(mi("k"),mo("ˆ"))`(x), x)

NULL

the radial unit vectors in cylindrical are then,

 

`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))` = `#mover(mi("i"),mo("∧"))`*cos(phi)+sin(phi)*`#mover(mi("j"),mo("∧"))`

NULL

diff(`#mover(mi("ρ",fontstyle = "normal"),mo("∧"))`(x), x) = `#mover(mi("i"),mo("∧"))`*cos(diff(phi(x), x))+sin(diff(phi(x), x))*`#mover(mi("j"),mo("∧"))`

NULL

In typical problems, the anglular location of the observation point, φ, is distinct from the angular location of the source, diff(phi(x), x) and so under this condition, `#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))` <> diff(`#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))`(x), x).

 

Consider the classic problem of the magnetic field due to a circular current carrying wire. Surely, the angular coordinate of one location of the current carrying wire  is different from the angular coordinate  of an observation point hovering above and off-axis on the other side of the current carrying wire. See figure below.

NULL

NULL

NULL

NULL

Therefore,

 

`#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))` <> diff(`#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))`(x), x)

NULL

NULL

What happens in MAPLE when you try to define a second distinct unit vector diff(`#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))`(x), x)?

NULL

One can easily find `#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))`.

NULL

_rho

_rho

(1.3.3)

NULL

NULLIf you try to define diff(`#mover(mi("&rho;",fontstyle = "normal"),mo("&and;"))`(x), x) ...

 

 

diff(_rho(x), x)

`_rho'`

(1.3.4)

So using a prime doesn't work.

NULL

You could try a numbered subscript...

`_&rho;__2`

_rho__2

(1.3.5)

but that doesn't work.

 

You could try an indexed unit vector...

NULL

_rho[2]

_rho[2]

(1.3.6)

which can be define but is not recognized by Physics[Vectors] since...

 

NULL

ChangeBasis(_rho[2], 1)

Error, (in Physics:-Vectors:-Identify) incorrect indexed use of a unit vector: _rho[2]

 

NULL

And so it's just not possible with the current implementation.

``

``

NULL

NULL


 

Download physics_vectors_and_multiple_unit_vectors.mw

 

 

Maple 2023: The colorbar option for contour plots does not work when used with the Explore command. See the example below.

No_colorbar_when_exploring_contour_plots.mw
 

Page 1 of 1