MTSOS: calling MTSOS

MTSOS can either be called from within MATLAB or as a standard C function.

MATLAB

[b u v fx iterate timed] = MTSOS(S,flags,parameters)

Inputs

Sa ptimes (n+1) matrix, representing S, the path the vehicle must traverse, evaluated at the discretization points theta_i
flags modifies behavior; does not need to be set
flags.display0: default, no information printed
1: very limited information reported (iteration number, current residual, kappa decrement); most useful for tracking progress of a large problem
flags..kappa 1: default, used for a barrier method
0: use a fixed value of kappa defined in parameter.kappa
flags.timer0: default, reports no timing
1: reports timing values for development purposes, not useful for the general user
parameters problem and algorithm specific information, consisting of several required and many optional parameters
parameters.initial_velocity REQUIRED: initial generalized speed of the vehicle, as defined in Minimum-Time Speed Optimization Along a Fixed Path
parameters.U_size REQUIRED: r, the number of control inputs to the vehicle
parameters.alpha default, 0.01: back tracking line search parameter as defined in Convex Optimization S 9.2; alpha in (0,0.5)
parameters.beta default, 0.75: back tracking line search parameter as defined in Convex Optimization S 9.2; beta in (0,1)
parameters.epsilon default, 0.1: the accuracy desired from the algorithm; epsilon > 0
parameters.initial_b a length n+1 vector of initial b values for the algorithm to use (instead of its heuristic — make b small)
parameters.intial_u an r times n matrix of initial u values for the algorithm to use (instead of setting all controls to zero)
parameters.kappa default, 0.1: initial value of kappa; kappa < 0
parameters.MAX_ITERATIONS default, 100: the maximum iterations the interior point method performs before the algorithm exits
parameters.variables a vector of data available in the dynamics and barrier functions (in the test file: mass of the vehicle and maximum force that can be applied)

Outputs

b a length n+1 vector of the optimal b values as defined in Minimum-Time Speed Optimization Along a Fixed Path
u an r times n matrix of the control inputs required for optimal traversal of the trajectory
v a length n(1+p) vector of the dual variables associated with the equality constraints; entries correspond to the A matrix of Minimum-Time Speed Optimization Along a Fixed Path
fx the optimal traverse time of the path
timed a field for the returning of internal timing for development, not useful to the general user

C

int so_MTSOS(problem_params* p_params, algorithm_flags* flags,

algorithm_params* a_params, optional_params* o_params,
double** p_b, double** p_u, double** p_v, double* pfx,
double** p_timers, int* piterations)

Inputs

problem_params a structure of REQUIRED problem data with attributes given below
double initial_velocity initial generalized speed of the vehicle, as defined in Minimum-Time Speed Optimization Along a Fixed Path
double* S a length p(n+1) array, representing S, the path the vehicle must traverse, evaulated at discretization points theta_i, concatenated
int S_length n+1, the number of points in S
int State_size p, the number of states of the vehicle
int U_size r, the number of control inputs to the vehicle
algorithm_flags a structure containing several flags to modify algorithm behavior
int display 0 : default, no information is reported
1: very limited information is reported (iteration number, current residual, kappa decrement); most useful for tracking progress of a large problem
int kappa 1 : default, used for a barrier method
0 : use a fixed value of kappa defined in algorithm_params.kappa
int timer 0 : default, reports no timing
1 : reports timing values for development purposes, not useful for the general user
algorithm_params a structure of parameters to change the algorithm from its default values; pass in NULL to use the default values
double alpha default, 0.01: back tracking line search parameter as defined in Convex Optimization S 9.2; alpha in (0.0.5)
double beta default, 0.75: back tracking line search parameter as defined in Convex Optimization S 9.2; beta in (0,1)
double epsilon default, 0.1: the accuracy desired from the algorithm; epsilon > 0
double kappa default, 0.1: initial value of kappa; kappa > 0
int MAX_ITERATIONS default, 100: the maximum iterations the interior point method performs before the algorithm exits
optional_params a structure of optional information for the algorithm
double* initial_b a length n+1 array of initial b values for the algorithm to use (instead of its heuristic — make b small)
double* intial_u a length r times n array of initial u values for the algorithm to use (instead of setting all controls to zero), concatenated
double* variables an array of data available in the dynamics and barrier functions (in the test file: mass of the vehicle and the maximum force that can be applied)
int variables_length the length of the array in variables

Outputs

Pass in the necessary pointers and references and MTSOS will allocate the pointers and populate them. The user is responsible for freeing these arrays.

RETURN int 1 : everything ran smoothly
0 : an error occurred
double** p_b a length n+1 array of the optimal b values as defined in Minimum-Time Speed Optimization Along a Fixed Path
double** p_u a length r times n array of the optimal controls u, representing an r times n matrix in column first order
double** p_v a length n(p+1) array of the dual variables corresponding to the equality constraints represented by the matrix A as defined in Minimum-Time Speed Optimization Along a Fixed Path
double* pfx optimal time to traverse the path (a reference to a double)
double** p_timers timing data useful for development, but not of interest to most users
int* piterations the number of iterations of the interior point method required to reach the solution (a reference to an int)