# Coloumb Friction 1

Minimum-Time Control of Systems With Coloumb Friction: Near Global Optima Via Mixed Integer Linear Programming, Brian J. Driessen, Structural Dynamics Department, Sandia National Labs.

4. Numerical Examples

## Problem Formulation

Find u over t in [0; tF ] to minimize

subject to:

% Copyright (c) 2007-2008 by Tomlab Optimization Inc.


## Problem setup

toms t
toms tf

p = tomPhase('p', t, 0, tf, 60);
setPhase(p);

tomStates q qdot
tomControls u

% Initial guess
x0 = {tf == 1};

% Box constraints
cbox = {-2 <= collocate(u) <= 2
0.001 <= tf};

% Boundary constraints
cbnd = {initial({q == 0; qdot == 1}), final({q == -1, qdot == 0})};

% ODEs and path constraints
ceq = collocate({
dot(q)    == qdot
dot(qdot) == u-sign(qdot)});

objective = tf;


## Solve the problem

options = struct;
options.name = 'Coloumb Friction 1';
constr = {cbox, cbnd, ceq};
solution = ezsolve(objective, constr, x0, options);

t    = subs(collocate(p,t),solution);
q    = subs(collocate(p,q),solution);
qdot = subs(collocate(p,qdot),solution);
u    = subs(collocate(p,u),solution);

Problem type appears to be: lpcon
===== * * * =================================================================== * * *
TOMLAB - Tomlab Optimization Inc. Development license  999001. Valid to 2010-02-05
=====================================================================================
Problem: ---  1: Coloumb Friction 1             f_k       2.070229757725040400
sum(|constr|)      0.000000313431521247
f(x_k) + sum(|constr|)      2.070230071156561500
f(x_0)      1.000000000000000000

Solver: snopt.  EXIT=0.  INFORM=1.
SNOPT 7.2-5 NLP code
Optimality conditions satisfied

FuncEv    1 ConstrEv   20 ConJacEv   20 Iter   11 MinorIter  414
CPU time: 0.171875 sec. Elapsed time: 0.171000 sec.


## Plot result

subplot(2,1,1)
plot(t,q,'*-',t,qdot,'*-');
legend('q','qdot');
title('Coloumb Friction 1 state variables');

subplot(2,1,2)
plot(t,u,'+-');
legend('u');
title('Coloumb Friction 1 control');