Jacobian matrices: from joint rates to robot tip velocity

Read a Jacobian by its rows and columns, calculate a two-link arm's tip velocity, and compare a local prediction with a finite move. Includes singularities and the multivariate chain rule.

By 13 min read

What you will learn

  • Identify the output and input associated with each Jacobian entry.
  • Calculate a planar arm's instantaneous tip velocity from joint rates.
  • Compare a local linear prediction with a finite step through nonlinear kinematics.
  • Relate rank, singular configurations, and null-space joint rates.
  • Connect matrix composition to the chain rule and scalar loss gradients.

Before you start

A robot's joints can turn at steady rates while its tip changes direction. The arm's current posture determines how those joint rates combine into tip velocity.

A Jacobian matrix describes that local relationship. We will calculate one for an ideal two-link arm, inspect its columns, and check why a zero instantaneous velocity can still lead to movement over a finite interval.

Put outputs in rows and inputs in columns

Let a differentiable function f take n inputs and return m outputs. Its Jacobian has m rows and n columns. Entry Jᵢⱼ is the partial derivative of output fᵢ with respect to input qⱼ, evaluated at the current input q.

Jᵢⱼ(q) = ∂fᵢ/∂qⱼ
Δf ≈ J(q) Δq

Read a row to see how all inputs affect one output. Read a column to see how one input affects every output. A three-coordinate position driven by four joints has a 3 × 4 position Jacobian; it does not need to be square. Lancaster's linear algebra notes define this output-by-input arrangement.

Differentiability makes the matrix a valid first-order approximation. The remainder, divided by the length of Δq, tends to zero as Δq shrinks. Having partial derivatives at a point alone does not establish that property; the partial-derivatives lesson explains the distinction.

Define the two-link arm and its coordinates

Fix the shoulder at the world origin. World x points right, world y points up, and positive angles turn counterclockwise. Both ideal links have length 1 meter.

  • q₁ measures the shoulder angle from world +x.
  • q₂ measures the elbow angle relative to the first link.
  • The second link's world angle is q₁ + q₂.

All vectors here use that fixed world frame. Review coordinate frames if the difference between a relative joint angle and a world direction is unfamiliar.

The tip position p = (x, y) follows from adding the two link vectors:

x = L₁ cos q₁ + L₂ cos(q₁ + q₂)
y = L₁ sin q₁ + L₂ sin(q₁ + q₂)
L₁ = L₂ = 1 m

This is forward kinematics: joint angles determine position. The angle controls display degrees, but the formulas and derivatives use radians. The model keeps the base fixed and has no explicit time dependence beyond the changing joint angles.

The product of exponentials lesson derives a full tip pose from the arm's joint axes and home configuration. Its position agrees with these trigonometric equations, and its rotation block also tracks the tool's orientation.

Differentiate the tip position

Differentiate both outputs with respect to each joint angle. For compact notation, write s₁ = sin q₁, c₁ = cos q₁, s₁₂ = sin(q₁ + q₂), and c₁₂ = cos(q₁ + q₂).

J =
[−L₁s₁ − L₂s₁₂, −L₂s₁₂;
L₁c₁ + L₂c₁₂, L₂c₁₂]

The first column describes turning the shoulder while holding q₂ fixed. Both links move. The second describes turning the elbow while holding q₁ fixed, so only the second link contributes.

Each column gives the tip velocity produced by 1 rad/s at its joint, with the other joint stopped. Multiplying a column by its actual joint rate gives that joint's contribution to the total velocity. MIT's manipulation notes derive the same two-link translational Jacobian.

Entries have units m/rad; multiplying by rad/s gives m/s. Radians are dimensionless in SI, but retaining “rad” here helps prevent a degrees-versus-radians mistake. Differentiating with respect to an angle measured in degrees would introduce a factor of π/180.

Work through a velocity calculation

Set q₁ = 0 and q₂ = π/2 radians, so the tip is at (1, 1) m. The first link points right and the second points up.

J = [−1, −1; 1, 0] m/rad
q̇ = (0.5, −0.5) rad/s
ṗ = Jq̇ = (0, 0.5) m/s

The shoulder contributes 0.5(−1, 1) = (−0.5, 0.5) m/s. The elbow contributes −0.5(−1, 0) = (0.5, 0) m/s. Their horizontal components cancel, leaving upward velocity.

The equation ṗ = J(q)q̇ is the chain rule along the motion q(t). For this differentiable model, it is an exact instantaneous relationship. OpenStax develops this chain rule by summing each partial derivative times its input's time derivative.

Change the posture and joint rates

The experiment starts with the worked example. One plot shows arm geometry and step positions in meters. The other adds joint contributions in meters per second.

Interactive experiment

Map joint rates to tip velocity

Two ideal 1 m links move in a fixed world xy plane. q₁ turns from world +x; q₂ turns relative to link 1. Positive angles turn counterclockwise.

0°
90°
0.50
-0.50
0.20 s

All derivatives use radians. The exact step holds the selected joint rates constant for the selected duration, then evaluates the nonlinear position. The linear prediction uses the initial velocity for that whole interval.

Arm and step positions (m)

Arm and step positions (m)World x points right and y points up. Amber dot: current tip (1.000, 1.000) m. Open square: linear prediction (1.000, 1.100) m. Filled green square: exact step (0.995, 1.100) m. Each link is 1 m. Positions can overlap; the readouts retain their values.-2-2022xy
World x points right and y points up. Amber dot: current tip (1.000, 1.000) m. Open square: linear prediction (1.000, 1.100) m. Filled green square: exact step (0.995, 1.100) m. Each link is 1 m. Positions can overlap; the readouts retain their values.

Velocity contributions (m/s)

Velocity contributions (m/s)Blue dashed arrow: shoulder contribution (-0.500, 0.500) m/s. Green dotted arrow: elbow contribution (0.500, 0.000) m/s. Amber solid arrow: their sum (0.000, 0.500) m/s. Arrows start at the velocity origin; zero contributions have no arrow.-1-1011vₓvᵧ
Blue dashed arrow: shoulder contribution (-0.500, 0.500) m/s. Green dotted arrow: elbow contribution (0.500, 0.000) m/s. Amber solid arrow: their sum (0.000, 0.500) m/s. Arrows start at the velocity origin; zero contributions have no arrow.

Each plot uses equal x and y scales. The position and velocity plots have different units and adjust their ranges independently to keep every result visible.

Position Jacobian J (m/rad)
World outputq₁ columnq₂ column
x-1.000-1.000
y1.0000.000
Tip position (m)
(1.000, 1.000)
Shoulder contribution (m/s)
(-0.500, 0.500)
Elbow contribution (m/s)
(0.500, 0.000)
Tip velocity (m/s)
(0.000, 0.500)
Tip speed (m/s)
0.500
Position Jacobian rank
2 of 2
Jacobian determinant (m²/rad²)
1.000
Step duration (s)
0.20
Joint angle change (rad)
(0.100, -0.100)
Linear step prediction (m)
(1.000, 1.100)
Exact step position (m)
(0.995, 1.100)
Step error (m)
0.004999

The two-row position Jacobian has rank 2 at this configuration. The linear step approximates the nonlinear step; shortening the interval tests the local nature of that approximation.

Rank follows the exact straight or folded configurations in this bounded arm model. It is not a numerical-rank threshold. Step error is the Euclidean distance between exact and predicted tip positions. Values are rounded for display. This position Jacobian omits tool orientation, and the model omits collisions, joint limits, forces, and motor dynamics.

Change only a joint rate first. The Jacobian stays fixed because the posture has not changed; its column receives a different multiplier. Then change an angle and watch the matrix itself change.

Choose Straight arm or Folded arm to see the position Jacobian's rank fall from 2 to 1. The Straight-arm null motion preset uses rates (0.5, −1) rad/s, which cancel the tip's initial velocity. Its finite-step result still moves inward.

Both plots keep equal horizontal and vertical scales. They use separate units and adjust their ranges independently. Numeric readouts distinguish points that nearly overlap in the drawing.

This experiment evaluates chosen rates; it does not solve for rates that reach a target. Its ideal geometry omits collisions, joint limits, motor dynamics, and compliance.

Separate instantaneous velocity from a finite move

For a finite input change, predict the next position with:

p_linear = f(q) + J(q)Δq
Δq = q̇ Δt
p_exact = f(q + Δq)

Here exact means direct evaluation of the nonlinear arm model, with floating-point arithmetic. The comparison holds the selected joint rates constant throughout Δt. The linear prediction freezes the Jacobian at the starting posture.

When a rate depends on the changing state, you need a model for its evolution over time. The ordinary differential equations lesson starts with a rate equation and an initial condition, then compares a full solution with repeated local steps.

For the default rates and Δt = 0.2 s, the angle change is (0.1, −0.1) radians. The second link's absolute angle stays π/2, so direct evaluation gives p_exact = (cos 0.1, 1 + sin 0.1) meters.

The linear prediction is (1, 1.1) m. The exact position is approximately (0.995004, 1.099833) m, an error of 0.004999 m in Euclidean distance.

At Δt = 0.1 s, the error falls to about 0.001250 m. This smooth arm model has second-order local error: for fixed rates and sufficiently small intervals, halving the interval reduces the leading error by a factor of four. Zero duration gives no angle change and no step error.

Find the directions a singular arm loses

The determinant of this position Jacobian is L₁L₂ sin q₂. With positive link lengths, the columns become dependent when the arm is straight or folded: q₂ = 0 or ±π in the controls' range.

At q₁ = q₂ = 0, the matrix is J = [0, 0; 2, 1] m/rad. Every joint-rate pair produces zero horizontal velocity and vertical velocity 2q̇₁ + q̇₂. The position Jacobian has rank 1.

At q₁ = 0, q₂ = π, the equal-length links fold the tip back to the shoulder. The matrix is J = [0, 0; 0, −1] m/rad, also rank 1. Turning the shoulder alone rotates the folded links while leaving their coincident tip fixed.

Modern Robotics describes singularities through a loss of achievable instantaneous velocity directions. Rank concerns the chosen output: this lesson tracks two position coordinates. It does not include tool orientation or constitute a complete spatial-twist Jacobian.

For the straight arm, (0.5, −1) lies in J's null space. Holding these rates for 0.2 s changes the angles to (0.1, −0.2), giving tip position (2 cos 0.1, 0) ≈ (1.990008, 0) m. Zero initial velocity does not guarantee a stationary tip over the interval.

The rank and null-space lesson explains the underlying linear map. A pseudoinverse can select rates for a local least-squares velocity task, but it cannot create a velocity outside J's column space. Close to a singularity, some requested velocities require large rates; physical rate limits still apply.

Compose Jacobians and recover a scalar gradient

Suppose f maps n inputs to m intermediate values, and g maps those values to k outputs. If both maps are differentiable at the relevant points, their Jacobians compose in the same order as the local linear maps:

J_(g∘f)(q) = J_g(f(q)) J_f(q)
(k × n) = (k × m)(m × n)

Evaluate the outer derivative at f(q). Multiplying derivatives from unrelated points gives the wrong local map. Lancaster states the matrix form of this multivariate chain rule.

For a scalar loss ℓ(p), its Jacobian is a single row. Writing the gradient as a column in ordinary Euclidean coordinates gives J_ℓ = (∇ₚℓ)ᵀ. The gradient with respect to joint coordinates is therefore ∇_q(ℓ∘f) = J_fᵀ ∇ₚℓ.

For example, use squared position error ℓ(p) = ½‖p − p_target‖², with target (1, 2) m. At the default tip (1, 1), the position gradient is (0, −1). Multiplying by Jᵀ gives the joint-coordinate gradient (−1, 0), in m²/rad.

The current rates (0.5, −0.5) give an instantaneous loss rate of −0.5 m²/s. You get the same answer from either gradient: (0, −1) · (0, 0.5) or (−1, 0) · (0.5, −0.5).

This transpose multiplication also appears when differentiating a scalar machine-learning loss through intermediate features. The gradient lesson explains why claims about steepest directions require a stated coordinate scaling and metric. A Euclidean gradient in joint coordinates does not by itself choose the safest or lowest-energy robot motion.

Check the calculation in Python

This Python 3 example uses only the standard library. It applies the same one-meter link model and holds the supplied joint rates constant during each step. Changing duration does not change the initial velocity.

from math import cos, sin, pi, hypot

def position(q):
    a, b = q
    return (cos(a) + cos(a + b), sin(a) + sin(a + b))

def jacobian(q):
    a, b = q
    return ((-sin(a) - sin(a + b), -sin(a + b)),
            (cos(a) + cos(a + b), cos(a + b)))

def multiply(matrix, vector):
    return tuple(sum(a * b for a, b in zip(row, vector))
                 for row in matrix)

def show(values):
    return "(" + ", ".join(
        f"{0.0 if abs(value) < 0.0000005 else value:.6f}"
        for value in values
    ) + ")"

q, rates = (0, pi / 2), (0.5, -0.5)
start = position(q)
velocity = multiply(jacobian(q), rates)
print("Initial tip:", show(start))
print("Tip velocity:", show(velocity))
for dt in (0.2, 0.1, 0.0):
    change = tuple(rate * dt for rate in rates)
    predicted = tuple(p + v * dt for p, v in zip(start, velocity))
    exact = position(tuple(a + d for a, d in zip(q, change)))
    error = hypot(*(a - b for a, b in zip(exact, predicted)))
    print(f"dt={dt:.1f}: exact={show(exact)}, error={error:.6f}")

straight_q, null_rates = (0, 0), (0.5, -1)
null_velocity = multiply(jacobian(straight_q), null_rates)
null_next = position(tuple(0.2 * rate for rate in null_rates))
print("Null initial velocity:", show(null_velocity))
print("Null finite-step tip:", show(null_next))

Expected output:

Initial tip: (1.000000, 1.000000)
Tip velocity: (0.000000, 0.500000)
dt=0.2: exact=(0.995004, 1.099833), error=0.004999
dt=0.1: exact=(0.998750, 1.049979), error=0.001250
dt=0.0: exact=(1.000000, 1.000000), error=0.000000
Null initial velocity: (0.000000, 0.000000)
Null finite-step tip: (1.990008, 0.000000)

The final two lines expose the local nature of the null-space statement. The initial Jacobian describes the derivative at the starting posture. Reusing one null vector through a finite change does not ensure it stays in the changing Jacobian's null space.

Try it yourself

Exercise 1. At q = (0, π/2), use joint rates (0.25, 0.5) rad/s. Find the tip velocity and the linear prediction after 0.1 s. Is that prediction an exact finite tip position?

Show the velocity and step solution

The Jacobian is [−1, −1; 1, 0] m/rad. Its product with (0.25, 0.5) gives velocity (−0.75, 0.25) m/s. Starting at (1, 1) m, the linear prediction is (0.925, 1.025) m.

The joint-angle change is (0.025, 0.05) radians. Direct evaluation gives (cos 0.025 − sin 0.075, sin 0.025 + cos 0.075) ≈ (0.924758, 1.022186) m. The linear prediction approximates that nonlinear finite step.

Exercise 2. For dimensionless inputs, let f(u, v) = (u² + v, uv) and g(x, y) = x + 2y. Find the Jacobian of g∘f at (u, v) = (1, 2), then check it by differentiating the composite directly.

Show the composed Jacobian solution

The intermediate point is f(1, 2) = (3, 2). At (1, 2), the inner Jacobian is J_f = [2, 1; 2, 1]. The outer Jacobian is J_g = [1, 2], so J_(g∘f) = [1, 2][2, 1; 2, 1] = [6, 3].

Direct substitution gives g(f(u, v)) = u² + v + 2uv. Its partial derivatives are 2u + 2v and 1 + 2u, which evaluate to 6 and 3. The Jacobian is a 1 × 2 row; the corresponding Euclidean gradient is the column (6, 3)ᵀ.

Sources and further study