# computeVariableIndices

computes the indices of the entries storing, e.g., the generator scaling factors in the vector of optimization variables.

## Contents

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

## Syntax

idxVars = computeVariableIndices(obj,id,id_redVar,nGenR,nGenTermReg,nGenCtrl,nGenU,nGenReduce,nGenErr)

## Description

To formulate the polynomial program in [1, Eq. (19)] in the generic form of a nonlinear programming problem, i.e., min f(y) s.t. g(y) <= 0, h(y) = 0, the variables must be lumped together into a single vector y. To, e.g., easily extract the generator scaling factors from the optimal solution, this function computes the indices of the entries of y storing the corresponding variable. These indices are stored in the struct idxVars. They need to be recomputed in every iteration since the number of reduced generators and, thus, the number of variables might change in between iterations.

## Input Arguments

obj | instance of class computeTermRegNonlinSysPolyApproach
id | struct storing the polynomial zonotope ids for parameterized reachability analysis
id_redVar | set of indices indicating reducing generators with variable length (in the optimization variables)
nGenR | number of dependent generators of the parameterized reachable set (scalar)
nGenTermReg | number of generators of the terminal region (scalar)
nGenCtrl | number of generators of the controller template (scalar)
nGenU | number of generators of the set of admissible control inputs (scalar)
nGenReduce | number of reduced generators (parameterized order; reduction) (scalar)
nGenErr | number of independent generators of the parameterized reachable set (scalar)

## Output Arguments

idxVars | struct storing the indices of the optimization variables

## See Also

@computeTermRegNonlinSysPolyApproach/optimizeRCIpoly

## References

[1] L. Schäfer and M. Althoff, "Computing Robust Control Invariant Sets of Nonlinear Systems Using Polynomial Controller Synthesis," American Control Conference, 2024, pp. 4162-4169.

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