# computeConstraintIndices

Computes the indices of the individual constraint functions.

## Contents

- Syntax
- Description
- Input Arguments
- Output Arguments
- See Also

## Syntax

obj = computeConstraintIndices(obj,X,U)

## Description

To formulate the optimal control problem (OCP) in the generic form of a nonlinear programming problem, i.e., min f(y) s.t. lb <= g(y) <= ub, the equality and inequality constraints have to be lumped into a single vector-valued fuction. To, e.g., easily access the value of individual constraint functions, this function computes the indices of the entries storing the value of the respective constraint function. These indices are stored in the property idxCon - a structure with the following fields: .initState: initial state constraint (integer array of dimension [obj.nx,1]) .dynamics: dynamic feasibility (integer array of dimension [obj.nx,obj.N]) .bu: admissibility of the control inputs (integer array of dimension [U.dim,obj.N]) .bx: admissibility of the states (integer array of dimension [X.dim,obj.N+1]) .nIneqCon: number of inequality constraints (integer) .nEqCon: number of equality constraints (integer) .nCon: total number of constraints (integer)

## Input Arguments

obj | instance of class optimalControl
X | set of admissible states (class: polytope)
U | set of admissible control inputs (class:polytope)

## Output Arguments

obj | updated instance of class optimalControl

## See Also

`optimalControl`

© 2018-2026 I6 Technische Universität München `•` Website `•` License