# costfunctionFmincon

objective function for the optimal control problems if solved with FMINCON

## Contents

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

## Syntax

[c, ceq] = costfunctionFmincon(y, nx, N, xf, Q, R)

## Description

This function implements the objective function for the optimal control problem, for the case that the optimal control problems are solved with Matlab build-in function FMINCON

## Input Arguments

y | Parameter vector for the optimization problem (y = [x,u])
nx | Number of system states x
N | Number of time steps for the optimal control problem
xf | desired final state at the end of the optimal control problem
Q | weighting matrix for the system states (dimension: [nx,nx])
R | weighting matris for the control inputs (dimension: [nu,nu])

## Output Arguments

cost | value of the objective function

## See Also

`convexInterpolationControl`, `optimalControlFmincon`

## References

- [1] Schuermann et al. (2017), Convex interpolation control with formal guarantees for disturbed and constrained nonlinear systems

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