Equate - Maple Programming Help

Equate

convert a pair of rectangular objects into a list of equations

 Calling Sequence Equate(u, v)

Parameters

 u - list, Array, Matrix, Vector, or algebraic structure representing a vector of the Physics[Vectors] package v - list, Array, Matrix, Vector, or algebraic structure representing a vector of the Physics[Vectors] package

Description

 • The Equate(u,v) command receives the rectangular structures u and v, typically of type list, Array, Matrix or Vector, and returns a list of equations, where the left-hand sides of the equations are taken from u and the right-hand sides from the corresponding components of v. The two input objects, u and v, must have the same shapes and sizes, and if only one is an Array then its indices must start at 1.
 • Equate can also receive two algebraic structures u and v representing vectors of the Vectors subpackage of the Physics package, in which case the list of equations returned is constructed equating the components of u and v. When u and v are projected into different orthonormal basis, the second one is first reprojected onto the basis of the first one; then the components are equated.

Examples

 > $\mathrm{Equate}\left(\left[1,2\right],⟨a,b⟩\right)$
 $\left[{1}{=}{a}{,}{2}{=}{b}\right]$ (1)
 > $\mathrm{Equate}\left(⟨⟨1,2⟩|⟨3,4⟩|⟨5,6⟩⟩,\left[\left[a,b,c\right],\left[d,e,f\right]\right]\right)$
 $\left[{1}{=}{a}{,}{3}{=}{b}{,}{5}{=}{c}{,}{2}{=}{d}{,}{4}{=}{e}{,}{6}{=}{f}\right]$ (2)
 > $\mathrm{Equate}\left(⟨1,2,3⟩,⟨a|b|c⟩\right)$
 $\left[{1}{=}{a}{,}{2}{=}{b}{,}{3}{=}{c}\right]$ (3)
 > $\mathrm{Equate}\left(\mathrm{Array}\left(1..2,1..2,\left[\left[a,b\right],\left[c,d\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,2\right],\left[3,4\right]\right]\right)\right)$
 $\left[{a}{=}{1}{,}{b}{=}{2}{,}{c}{=}{3}{,}{d}{=}{4}\right]$ (4)
 > $\mathrm{Equate}\left(\mathrm{Vector}\left(3,\left[a,b,c\right]\right),\mathrm{Vector}\left(3,\left[1,2,3\right]\right)\right)$
 $\left[{a}{=}{1}{,}{b}{=}{2}{,}{c}{=}{3}\right]$ (5)
 > $\mathrm{Equate}\left(\mathrm{Vector}\left(3,\left[a,b,c\right]\right),⟨1,2,3⟩\right)$
 $\left[{a}{=}{1}{,}{b}{=}{2}{,}{c}{=}{3}\right]$ (6)
 > $\mathrm{Equate}\left(\mathrm{Matrix}\left(2,2,\left[\left[a,b\right],\left[c,d\right]\right]\right),⟨⟨1,2⟩|⟨3,4⟩⟩\right)$
 $\left[{a}{=}{1}{,}{b}{=}{3}{,}{c}{=}{2}{,}{d}{=}{4}\right]$ (7)
 > $\mathrm{Equate}\left(\mathrm{Array}\left(1..2,1..2,\left[\left[a,b\right],\left[c,d\right]\right]\right),⟨⟨1,2⟩|⟨3,4⟩⟩\right)$
 $\left[{a}{=}{1}{,}{b}{=}{3}{,}{c}{=}{2}{,}{d}{=}{4}\right]$ (8)

This is invalid because the dimensions do not match.

 > $\mathrm{Equate}\left(\left[\left[1,2\right],\left[3,4\right]\right],\mathrm{Array}\left(1..4,\left[a,b,c,d\right]\right)\right)$

This is invalid because the index origins do not match.

 > $\mathrm{Equate}\left(\mathrm{Array}\left(-2..1,\left[1,2,3,4\right]\right),\mathrm{Array}\left(1..4,\left[a,b,c,d\right]\right)\right)$

To handle vectors of the Vectors subpackage of Physics, first load Vectors

 > $\mathrm{with}\left(\mathrm{Physics}:-\mathrm{Vectors}\right)$
 $\left[{\mathrm{&x}}{,}{\mathrm{+}}{,}{\mathrm{.}}{,}{\mathrm{ChangeBasis}}{,}{\mathrm{ChangeCoordinates}}{,}{\mathrm{Component}}{,}{\mathrm{Curl}}{,}{\mathrm{DirectionalDiff}}{,}{\mathrm{Divergence}}{,}{\mathrm{Gradient}}{,}{\mathrm{Identify}}{,}{\mathrm{Laplacian}}{,}{\mathrm{Nabla}}{,}{\mathrm{Norm}}{,}{\mathrm{Setup}}{,}{\mathrm{diff}}\right]$ (9)

Equate the components of two vectors

 > $R≔x\mathrm{_i}+y\mathrm{_j}+z\mathrm{_k}$
 ${R}{:=}{\mathrm{_i}}{}{x}{+}{\mathrm{_j}}{}{y}{+}{\mathrm{_k}}{}{z}$ (10)
 > $V≔-z\mathrm{_i}+\left(y-x\right)\mathrm{_k}$
 ${V}{:=}{-}{z}{}{\mathrm{_i}}{+}\left({y}{-}{x}\right){}{\mathrm{_k}}$ (11)
 > $\mathrm{Equate}\left(R,V\right)$
 $\left[{x}{=}{-}{z}{,}{y}{=}{0}{,}{z}{=}{y}{-}{x}\right]$ (12)

When the two vectors are not projected onto the same orthonormal basis, the second one is reprojected onto the basis of the first one. In the following examples $C$ and $S$ are the same vector as $R$ but expressed in cylindrical and spherical coordinates and corresponding orthonormal bases (see Vectors)

 > $C≔\mathrm{ρ}\mathrm{_ρ}+z\mathrm{_k}$
 ${C}{:=}{\mathrm{_k}}{}{z}{+}{\mathrm{_ρ}}{}{\mathrm{ρ}}$ (13)
 > $S≔r\mathrm{_r}$
 ${S}{:=}{r}{}{\mathrm{_r}}$ (14)
 > $\mathrm{Equate}\left(R,C\right)$
 $\left[{x}{=}{\mathrm{ρ}}{}{\mathrm{cos}}{}\left({\mathrm{φ}}\right){,}{y}{=}{\mathrm{ρ}}{}{\mathrm{sin}}{}\left({\mathrm{φ}}\right){,}{z}{=}{z}\right]$ (15)
 > $\mathrm{Equate}\left(R,S\right)$
 $\left[{x}{=}{r}{}{\mathrm{sin}}{}\left({\mathrm{θ}}\right){}{\mathrm{cos}}{}\left({\mathrm{φ}}\right){,}{y}{=}{r}{}{\mathrm{sin}}{}\left({\mathrm{θ}}\right){}{\mathrm{sin}}{}\left({\mathrm{φ}}\right){,}{z}{=}{r}{}{\mathrm{cos}}{}\left({\mathrm{θ}}\right)\right]$ (16)