Linear Algebra and Robot Modeling: 1 Basic Kinematic Equations
Linear Algebra and Robot Modeling: 1 Basic Kinematic Equations
Nathan Ratliff
Abstract
Linear algebra is fundamental to robot modeling, control, and opti-
mization. This document reviews some of the basic kinematic equations
and uses them to motivate an SVD-centric geometric perspective on linear
algebra. This perspective illuminates the underlying structure and be-
havior of linear maps and simplifies analysis, especially for reduced rank
matrices. We later review some properties of multidimensional quadratic
forms that are central to optimal control. Most of this material should
already be familiar to the reader; this document explores some specifics
and offers a potentially unique intuition oriented perspective.
1
1.1 Interpreting time derivatives
Whenever an equation uses time derivatives, such as q̇, there is an implicit
assumption that q is really a trajectory q : [0, T ] → Rd . The time derivatives
d d
give the position q = q(t), velocity q̇ = dt q(t), and acceleration q̈ = dt q̇(t) of
the trajectory at some time t.
Thus, the equation ẋ = Jφ q̇ relates how the velocity q̇ in the system’s
configuration space relates to the velocity of the point on the end-effector in
Cartesian space. Concretely, using our manipulator example, it tells us how
joint velocities (the rate at which each joint is changing over time) relate to the
finger tip’s velocity (the rate at which the Cartesian dimensions of the fingertip
are changing over time). The implicit assumption here is always that the system
is moving along some trajectory q(t), and that that trajectory gives us the time
variable that allows us to address questions of how the system evolves over time.
Now given that q refers implicitly to an underlying trajectory, we can now
interpret what J˙φ means. As the system moves along its trajectory from q(t)
to a point dt in the future q(t + dt), the associated Jacobian changes slightly as
well since it’s a non-constant function of t. J˙φ gives explicitly the rate at which
the Jacobian is changing with time:
1
J˙φ = lim Jφ (q(t + ∆t)) − Jφ (q(t)) (2)
∆t→0 ∆t
2
δq are known as co-tangent vectors. The former generalizes tangents to curves
across a manifold, and the latter generalizes gradients of scalar functions defined
on the manifold.
Within robotics, rigor is often secondary to physical intuition, so definitions
and manipulations of these ideas are less stringent. The bottom line is that q̇
always refers to a time derivative of an underlying trajectory, whereas δq will
simply denote a perturbation (small movement of) the point q in space with no
notion of time.
We’ll often use δq to also represent a finite-sized perturbation away from
some approximation point q, which lets us write the first-order Taylor expansion
of a scalar function c : C → R as
between points in the domain and range. Every domain point x has an corresponding range
point y and vice versa under the bijection.
3
Usually, the row and column spaces are defined as the space spanning the
rows and the space spanning the columns. Those definitions, though true, aren’t
very insightful. This section shows that the SVD provides a nice geometric
view of what these spaces are and how the linear map operates on them. This
decomposition gives geometric insight into the fundamental nature of linear
algebra.
Let A ∈ Rm×n be a matrix representing a linear map from Rn to Rm .
We know from what is sometimes referred to as the fundamental theorem of
linear algebra that A has a Singular Value Decomposition (SVD) of the form
A = U SV T , where U and V are orthogonal matrices and S ∈ Rm×n is a
diagonal matrix of singular values σ1 , . . . , σk . We don’t assume that A is full
rank, so k may be less than both m and n. Since S is a non-square diagonal
matrix with only k ≤ m, n nonzero entries, we can better reveal its structure by
writing it as
Σ 0 I
S= = Σ I 0 (7)
0 0 0
where the columns with the subscript ⊥ are the ones annihilated by the zeros
and the columns with the subscript//are those that remain. This decomposition
allows us to rewrite the SVD as
T
Σ 0 V//
A = U// U⊥ (9)
0 0 V⊥T
T
I I
= U// U⊥ Σ V// V⊥ (10)
0 0
= U//ΣV//T . (11)
It’s fairly easy to show that, in terms of this decomposition, span(V//) is the
column space, span(V⊥ ) is the right null space, span(U//) is the row space, and
span(U⊥ ) is the left null space (which we’ll see below is the null space of the
natural generalized inverse).
The last expression in Equation 11, known as the thin SVD, reveals the
fundamental structure of any (possibly reduced rank) matrix. Some, depending
on background, find it more insightful to view that expression as
k
X
A = U//ΣV//T = σi ui viT , (12)
i=1
4
Geometrically, this expression says that all rank k matrices are simultane-
ously a correspondence between a k-dimensional orthogonal basis in the domain
space BV = {vi }ki=1 and a k-dimensional orthogonal basis in the range space
BU = {ui }ki=1 with a rule for how vectors should be stretched or compressed (or
reflected when σi < 0) along those dimensions. (We refer to these bases below
as simply the matrices V// and U//, respectively.)
It’s useful to think about
P each term in the expansion in relation to its corre-
sponding endomorphism 3 i σi ui uTi . Each term of this endomorphism acts on
a vector x to find its component (uTi x)ui along the basis element ui and stretch
it by σi . Since each basis element is orthogonal to all others, this endomorphism
simply stretches, compresses, and/or reflects the vector independently along the
given basis directions.
Equation 12, therefore, shows that all matrices have this fundamental be-
havior. Except in this case, when the domain and range spaces differ, we need
to both decompose the vector x in terms of the domain basis and simultaneously
map that decomposition onto the corresponding basis of the range space. Once
that connection between the (sub)spaces is established the matrix can apply its
underlying operation defined by its singular values σi .
The following equivalent expressions illustrate the underlying behavior of
the linear map from multiple perspectives:
A = U//ΣV//T = U//V//T V//ΣV//T = U//ΣU//T U//V//T , (13)
| {z } | {z }
Stretch then map Map then stretch
Each gives a subtly different way of thinking about how the matrix A operates.
The first says that we can think of A physically as a stretching/squishing of the
domain space space followed by an incompressible mapping between orthogonal
bases (simply mapping each domain basis element to its corresponding range
basis element), whereas the second says we can equivalently view A as first
a mapping between basis elements followed by a stretching of the space. It’s
natural then to think of A’s action holistically as simply an association be-
tween the two k-dimensional subspaces defined by U//V//T and a corresponding
stretching/squishing/reflection of that unified space.
represent those dimensions, so simply by the basic structure of a linear map, di-
mensions orthogonal to the fundamental k dimensional subspaces are removed.
3 An endomorphism is a mapping from a space back onto the same space.
4 More explicitly, the operator V//V//T projects a vector onto the space span(V//), and V⊥ V⊥T
projects onto span(V⊥ ), so we can always decompose a domain vector x as x = V//V//T x +
5
In other words, the mapping between the subspaces is bijective, and any com-
ponents orthogonal to those spaces cannot be represented by the linear map.
Thus, if A = U//ΣV//T is the forward map implementing a forward mapping
between fundamental spaces and removing any domain element orthogonal to
the column space then it reasons to say that the opposite mapping procedure
which implements the inverse of that bijection between fundamental space and
removes any component orthogonal to the row space is a natural generalized
inverse for this map. This generalized inverse is given explicitly by the map
It’s straightforward to show that A† gives the exact inverse on the bijection be-
tween the fundamental k-dimensional subspaces, but any component orthogonal
to V// is removed. This expression is exactly the Moore-Penrose pseudoinverse:
Ax = b
fully for the entire space of valid solutions is straightforward using this decom-
position as we show here:
Ax = b
⇒ U//ΣV//T x = b
⇒ V//T x = Σ−1 U//T b. (16)
h i
Ax = U//ΣV//T V//V//T x + V⊥ V⊥T x
= U//ΣV//T x,
6
x can always be decomposed as a linear combination of the columns V// and a
linear combination of the columns V⊥ as in x = V//α + V⊥ β, where α and β
are the associated coefficients. Doing so shows that the left hand side of the
expression in Equation 16 reduces to
z(β) = x0 + V⊥ β (19)
7
should take the coefficients in range basis U//, shrink them by inverse factors σ1i ,
and apply them to domain basis V//. Thus (as we derived above), if the forward
map is A = U//ΣV//T , the inverse map between fundamental spaces must be
A† = V//Σ−1 U//T (specifically, U//T finds the components in the k-dimensional
orthogonal basis for span(U//), Σ−1 scales those components, and V// applies the
resulting components directly to the k orthogonal basis elements of span(V//)).
Given this intuition, we’re now equipped to simply write down the full linear
space solution to the system directly:
x∗ = V//Σ−1 U//T b + V⊥ β (20)
for any β ∈ Rk .
Note that this argument can also be used to solve, in the least squares
sense, the system when b doesn’t actually lie within span(U//). In this case, we
just need to find which element of span(V//) gets mapped onto the orthogonal
projection of b onto span(U//), which is just the point defined by the coordinates
of b in basis U//. Considering only these coordinates, the above argument still
unfolds in the same way and the solution doesn’t change. In other words, we
can use a geometric argument to show that that Equation 20 also solves the
least squares problem.
8
3. Conditioning: Fixing one variable gives a quadratic over the
others. If Q(x, u) is a joint quadratic defined over both x and u, fixing on
of the variables, say x at a particular value xt , gives a quadratic function
Q(xt , u) = Q
e x (u) over the remaining variables u.
t