evaluate

Purpose

Returns the optimal control action

Syntax

u = controller.evaluate(x0)
[u, feasible] = controller.evaluate(x0)
[U, feasible, openloop] = controller.evaluate(x0)

Description

u = controller.evaluate(x0) solves the MPC optimization problem using x0 as the initial condition and returns the first element of the optimal sequence of control inputs. If the problem is infeasible, u will be NaN.

[u, feasible] = controller.evaluate(x0) also returns the boolean feasibility flag.

[u, feasible, openloop] = controller.evaluate(x0) also returns the open-loop predictions of states, inputs and outputs in openloop.X, openloop.Y, and openloop.Y, respectively. Value of the optimal cost is returned in openloop.cost.

Input Arguments

x0

Initial state of the MPC optimization problem.

Class: double

Output Arguments

u

Optimal control action.

Class: double

feasible

True if the optimization problem was feasible, false otherwise.

Class: logical

openloop

Structure containing open-loop predictions and value of the optimal cost.

Class: struct


© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk