AI Glossary / Mathematics and optimization / Intermediate

Legendre pseudospectral method

Definition

A Legendre pseudospectral method approximates continuous functions with polynomials associated with Legendre-based nodes and enforces governing equations at selected nodes. In optimal control, it converts a continuous trajectory problem into a finite-dimensional optimization problem. The Legendre-Gauss-Lobatto variant discussed here includes both endpoints; other Legendre-based node choices have different endpoint and discretization conventions.

What it means

A control problem asks how a changing input should guide a changing state while meeting dynamics, boundary conditions, and other requirements. Instead of treating every instant as an independent unknown, a pseudospectral transcription represents a trajectory through its values at carefully chosen nodes.
Polynomial interpolation links those values between nodes. A differentiation matrix converts the nodal values into derivatives of the interpolating polynomial. This creates algebraic constraints that an optimization solver can handle. The resulting discrete answer is an approximation that still needs checking against the original continuous problem.

How it works

Map the physical time interval to a reference interval, commonly [-1,1]. For degree N Legendre-Gauss-Lobatto interpolation, choose both endpoints and the N-1 interior zeros of the derivative of the degree-N Legendre polynomial. Construct Lagrange interpolation functions and their derivative matrix at these nodes.
Represent states and controls by nodal values, enforce scaled dynamics at the collocation points, impose boundary and sampled path constraints, and approximate integral costs with the matching quadrature weights. Solve the resulting constrained optimization problem. Refine or subdivide the discretization and check between-node behavior, especially when solutions are nonsmooth or close to constraint limits.

Three practical examples

  • A trajectory-design study can transcribe a continuous motion-planning problem into algebraic decision variables and constraints.
  • A process-control experiment can optimize a time-varying input while accounting for modeled dynamics and endpoint requirements.
  • A quantum-control research calculation can approximate pulse shapes and compare the resulting state transfer with a reference model.

Think of it this way

Think of describing a smooth drawn curve using a selected set of pins and a precisely defined interpolation rule, then checking the curve's slopes at those pins. The analogy is limited because the interpolant is a global polynomial and its behavior between pins is mathematically coupled. Satisfying checks at a few pins does not automatically prove every continuous constraint.

Worked example

Consider an original control problem on physical time t in [0,2]: minimize the integral of u(t)^2 subject to x_dot=u, x(0)=0, and x(2)=4. Use three Legendre-Gauss-Lobatto nodes on the reference interval: tau=-1,0,1. The time map t=tau+1 places them at t=0,1,2. Because the interval length is 2, the derivative scaling factor is 1.
For these nodes, the differentiation matrix has rows (-1.5,2,-0.5), (-0.5,0,0.5), and (0.5,-2,1.5). If the state values are X=(0,2,4), multiplying D by X gives (2,2,2). Choosing nodal controls U=(2,2,2) therefore satisfies the discrete dynamics.
The quadrature weights are (1/3,4/3,1/3). The discrete running cost is (1/3)(4)+(4/3)(4)+(1/3)(4)=8. The interpolated state is x(t)=2t and the control is u(t)=2, so the original differential equation and endpoint conditions hold everywhere, not only at the three nodes.
We can independently prove optimality for this particular continuous problem. The endpoint conditions require the integral of u over [0,2] to equal 4. By the Cauchy-Schwarz inequality, 4^2 is no greater than 2 times the integral of u^2. Thus every feasible control has cost at least 8. The constant control attains that bound, proving it is optimal here.
Compare another feasible trajectory, x(t)=t^2 with u(t)=2t. Its state values are (0,1,4), and applying D gives (0,2,4), exactly its nodal controls. The quadrature cost is zero plus (4/3)(4)+(1/3)(16)=32/3, approximately 10.666667. This matches the exact integral of 4t^2 from 0 to 2, and it exceeds 8.
The example is unusually simple: low-degree polynomials represent both candidates exactly, and the independent inequality supplies a global proof. For nonlinear dynamics and complicated constraints, a solver's successful termination on a small transcription does not provide the same conclusion. Additional continuous-time verification remains necessary.

Illustrative case study

In a fictional industrial-control study, Lake Avenue Engineering optimizes a smooth heating schedule using a Legendre-based transcription. The team reconstructs the proposed input, simulates the original dynamics independently, and checks temperature constraints on a finer time grid.
When a narrow constraint violation appears between collocation points, the analysts refine the discretization and review the constraint treatment. They do not conceal the violation behind the discrete solver's success message. This fictional case demonstrates validation practice, not a measured performance claim.

Common misconceptions and mistakes

Do not confuse Legendre-Gauss nodes, which are roots of a Legendre polynomial, with the interior Lobatto nodes, which are roots of its derivative. Endpoint conventions affect the algebraic formulation. Also retain the time-scaling factor when moving between the reference and physical intervals.
High-order interpolation is not automatically accurate for discontinuous controls or nonsmooth trajectories. Enforcing a path bound at nodes may miss an intermediate violation. Finally, an optimizer solving the transcription can find a local solution even when the continuous problem has other, better solutions.

Business use

For business use, the main advantage is a structured way to optimize dynamic decisions with relatively compact smooth representations. The required evidence includes the chosen node family, polynomial degree or mesh, solver status, reconstructed trajectory, and independent checks of dynamics and constraints. Compare accuracy at increasing resolution before relying on an apparent improvement in the objective. Model uncertainty should also remain separate from discretization error.

People also ask

Is this just a uniformly spaced time grid?

No. Legendre-based nodes are chosen through specific polynomial rules.

Does it automatically solve the continuous problem exactly?

No. Exactness in the worked example follows from its special polynomial structure and separate proof.

Can different Legendre node families be exchanged without changes?

No. Their endpoint treatment and related matrices must be handled consistently.

Check your understanding

Why is the constant control's cost 8 in the example?

Answer: Its squared magnitude is 4 over a time interval of length 2. Both exact integration and the stated quadrature therefore give 8.

Related terms

  • Collocation (remote sensing)
  • Trajectory optimization
  • Optimal control
  • Collocation
  • Legendre polynomial
  • Lagrange interpolation
  • Differentiation matrix
  • Gaussian quadrature
  • Nonlinear programming
  • Mesh refinement

Learn next

Change the terminal time from 2 to 4 while keeping x(0)=0 and x(4)=4. Derive the new constant optimal control, the physical-time scaling factor, and the minimum cost. Check that both the dynamics transcription and quadrature include that factor.

More in Mathematics and optimization

  • Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
  • Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
  • Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
  • Σ-algebra
  • Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
  • Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.

Sources

Primary research: Li, Ruths, and Stefanatos, A Pseudospectral Method for Optimal Control of Open Quantum Systems, method derivation: https://arxiv.org/abs/0908.2093 . The three-node control example and independent optimality proof are original.

Previous: Legal Extension Next: Leiden Community Detection

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer