# optimalControlFmincon

Solve optimal control problem with FMINCON

## Contents

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

## Syntax

[u,x] = optimalControlFmincon(system,xf,x0,h,Q,R,steps,horizon,Opts)

## Description

This function solves an optimal control problem using a multiple shooting algorithm and FMINCON

## Input Arguments

system | object containing the system dynamics (class:; nonlinearSys)
xf | desired final state at the end of the control process (dimension: [nx, 1])
x0 | initial state (dimension: [nx, 1])
h | length of one timestep of the corner trajectories during which the control input is constant
Q | weighting matrix for the final state of the optimal control problem (dimension: [nx,nx])
R | weighting matrix for the input term of the optimal control problem (dimension: [nu,nu])
steps | number of intermediate timesteps of the corner trajectories during one timestep of the center trajectory
lenHorizon | length of the optimization horizon in center trajectory time steps
Opts | structure containing user defined options for the algorithm

## Output Arguments

u | optimal control input (dimension: [nu,steps*horizon])
x | resulting state trajectories (dimension: [nx,steps*horizon])

## See Also

`convexInterpolationControl`, `writeFminconFiles`

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