---
kind: concept
slug: direct-collocation
title: Direct collocation
summary: >-
  Turns a continuous-time vehicle model into algebraic constraints by approximating the state inside each sampling period with polynomials that meet the model at a few collocation points. One reuse-licensed card covers it so far: a tractor-trailer NMPC that uses three points per 0.1 s period. The node placement and the constraint form are not stated, so no variants can be compared yet.
tags: [optimal-control, discretization, mpc, nonlinear-programming]
papers: ["2606.31889"]
related: [model-predictive-control, time-optimal-control]
status: draft
updated_at: 2026-10-19
---

## Overview

Direct collocation is a way to discretise a continuous-time model inside an optimisation. Between sampling instants the state is represented by polynomials, and the model's dynamics are enforced at a set of collocation points within each period [arxiv:2606.31889 §4] [arxiv:2606.31889 §5]. The paper uses it in a nonlinear model predictive controller, where the finite-horizon problem is solved at every sampling instant [arxiv:2606.31889 §3] [arxiv:2606.31889 §4].

The only source on this page is one paper, and it uses collocation as a means to an end. It does not study collocation itself. Three points are used per sampling period [arxiv:2606.31889 §5]. The paper names Gauss–Legendre points as one way to obtain such polynomials, but it does not say which node placement its own runs used [arxiv:2606.31889 §4]. The paper also does not state the form of the collocation constraints beyond the model equations it discretises [arxiv:2606.31889 §2] [arxiv:2606.31889 §4].

## Variants

### Collocation inside a receding-horizon NMPC

The model is a nonlinear kinematic model with six states and three inputs [arxiv:2606.31889 §2]. Each sampling period of 0.1 s is discretised with three collocation points, and the horizon is 6 s [arxiv:2606.31889 §5]. The controller solves the finite-horizon problem at each step, applies only the first input and repeats [arxiv:2606.31889 §3] [arxiv:2606.31889 §4]. The card for this paper: [Tractor-trailer path tracking with NMPC](/papers/2606.31889).

The reported results are author-reported and come from simulation only, with no field or hardware test [arxiv:2606.31889 §5]. They show the trailer position error staying below 16 cm along x once moving and below 12 cm along y in headland turns [arxiv:2606.31889 §5.2]. The same paper reports violent oscillation in the inputs in the trailer-controlled case, which the authors propose to damp with filters whose constants are not given [arxiv:2606.31889 §5.2]. These numbers describe the whole controller, not the collocation step alone, so they do not show what collocation contributes.

No other variant is covered by a card on this wiki. Other collocation schemes, such as different node placements or different polynomial orders, are not described by any source here.

## When to use which

There is one variant and one source, so this section cannot rank approaches. The constraints that the source does fix are these:

| Situation | Use | Why |
|---|---|---|
| Nonlinear model, short horizon, a few seconds, sampling period around 0.1 s | Collocation inside NMPC, three points per period | This is the only configuration reported, with simulation results only [arxiv:2606.31889 §5] |
| Need a node placement or polynomial order with known properties | Not answered here | The source names Gauss–Legendre points but does not evaluate them [arxiv:2606.31889 §4] |
| Need real-time performance on embedded hardware | Not answered here | The solve times are not stated, and the timing platform was a desktop-class CPU [arxiv:2606.31889 §5] |

## Implementation sketch

The receding-horizon loop below follows the paper's controller. The collocation step is shown as a call, because the paper does not give the form of its constraints. An implementer needs the original paper's equations or a further source before writing that step.

```pseudocode
# Receding-horizon NMPC with collocation  [arxiv:2606.31889 §3] [§4]
# Input:  model F(x, u), sampling period T_s = 0.1 s, horizon N  [§5]
# Output: first input of each solved problem, applied in turn

def control_step(state, previous_input, reference):
    # Discretise F over one sampling period with three collocation points  [§4] [§5]
    # The paper does not state the constraint form; this call is a placeholder
    constraints = collocate(F, T_s, points=3)
    # Solve the finite-horizon problem with the cost of eq. 19  [§4]
    # Cost: quadratic in the trailer position error and the inputs  [§4]
    inputs = solve_nmpc(state, reference, previous_input, constraints, N)
    # Apply only the first input and re-solve at the next period  [§3]
    return inputs[0]
```

## Contradictions

None known. The page rests on one source, and that source does not report a conflicting result for collocation.

## Papers

- [Tractor-trailer path tracking with NMPC](/papers/2606.31889): uses three-point collocation inside a nonlinear MPC for a tractor-trailer, with simulation results only.
