Simple arithmetic operations

From Robotics
Jump to: navigation, search
← Back: Unit vectors Overview: Vector algebra Next: Dot product

Review.png

There are exercises as selftest for this article.

Matlab.png

You can use MATLAB for the content of this article.

Addition and subtraction of vectors

Vectoralgebra addition substraction.png

Vectors can be added graphically as well as computationally. Using the graphical method, one of the vectors is shifted such that its startpoint is positioned at the endpoint of the other vector. The resulting vector is called sum vector. The sum vector starts at the startpoint the one vector and ends at the endpoint of the shifted vector (see figure on the right). For the computational addition the single components are added


\vec{\mathbf{a}} + \vec{\mathbf{b}} =
\begin{bmatrix} a_x\\a_y\\a_z \end{bmatrix} +
\begin{bmatrix} b_x\\b_y\\b_z \end{bmatrix} =
\begin{bmatrix} a_x+b_x\\a_y+b_y\\a_z+b_z \end{bmatrix}

Both the graphical and the computational addition show, that the commutative law holds:


\vec{\mathbf{a}}+\vec{\mathbf{b}} = \vec{\mathbf{b}}+\vec{\mathbf{a}}

The resulting vector of the substraction of vectors is called difference vector. Because it holds that \vec{\mathbf{a}}-\vec{\mathbf{b}} = \vec{\mathbf{a}}+(-\vec{\mathbf{b}}) the two vectors can just be added after inverting the direction of the second vector (see figure on the right). For the computational method the components are substracted:


\vec{\mathbf{a}} - \vec{\mathbf{b}} =
\begin{bmatrix} a_x\\a_y\\a_z \end{bmatrix} -
\begin{bmatrix} b_x\\b_y\\b_z \end{bmatrix} =
\begin{bmatrix} a_x-b_x\\a_y-b_y\\a_z-b_z \end{bmatrix}

If more than two vectors are added or substracted the same relations hold. Using the graphical method for example, all the vectors are stringed together.

Multiplication of vectors with scalars

Vectoralgebra multiplication scalar.png

The multiplication of a vector \vec{\textbf{a}} with a positive real scalar \lambda results in a new vector whose direction suits the direction of the initial vector. A negative \lambda leads to a vector with opposite direction. In both cases the length of the new vector changes with the factor |\lambda|. This is obvious because each component of the vector is multiplied with the scalar:


\lambda \begin{bmatrix} a_x\\a_y\\a_z \end{bmatrix} = \begin{bmatrix} \lambda a_x\\ \lambda  a_y\\ \lambda  a_z \end{bmatrix}
\Rightarrow |\lambda \vec{\textbf{a}}| = |\lambda| |\vec{\textbf{a}}|

Multiplication with a scalar \lambda = 0 results in the zero vector \vec{\mathbf{0}} with magnitude 0 and undefined direction.

Example: Movement of a robotMatlab.png see MATLAB code

Consider a robot at the current position p_0 relative to a coordinate system K and the corresponding position vector \vec{p_0} (see figure). The robot's velocity is described by the vector \vec{v} in units per second and assumed as static. The position p_1 after time t should be determined. So the velocity vector \vec{v} has to be multiplied by the scalar value t and added to the current position vector \vec{p_0}:


\vec{p_1}=\vec{p_0}+t\cdot\vec{v}
Movementofrobotexample.png

Assuming the following initial position vector and the velocity vector


\vec{p_0}=\left[\begin{array}{c}
1\\
3\\
2
\end{array}\right], \quad
\vec{v}=\left[\begin{array}{c}
2\\
0.5\\
1
\end{array}\right]

and a time of two seconds, the final position is calculated by adding twice the velocity vector to the initial position vector (see figure):


\vec{p_1}=\vec{p_0}+t\cdot\vec{v}=
\left[\begin{array}{c}
1\\
3\\
2
\end{array}\right]+
2\cdot
\left[\begin{array}{c}
2\\
0.5\\
1
\end{array}\right]=
\left[\begin{array}{c}
1\\
3\\
2
\end{array}\right]+
\left[\begin{array}{c}
4\\
1\\
2
\end{array}\right]=
\left[\begin{array}{c}
5\\
4\\
4
\end{array}\right]

Multimedial educational material

Multimedia.png

http://demonstrations.wolfram.com/VectorsIn3D/ Applet: Vector addition in three-dimensional space (free CDF-Player of Wolfram required)

http://demonstrations.wolfram.com/3DVectorDecomposition/ Applet: Vector addition in in three-dimensional space with three vectors (free CDF-Player required)

http://demonstrations.wolfram.com/SumOfTwoVectors/ Applet: Vector addition in cartesian coordinates (free CDF-Player of Wolfram required)

Helpful links

Link.png

http://hyperphysics.phy-astr.gsu.edu/hbase/vect.html General introduction to vector operations

Literature

  • Manfred Albach, Grundlagen der Elektrotechnik 1: Erfahrungssätze, Bauelemente, Gleichstromschaltungen, 3. Edition (Pearson Studium, 2011)