PROPT Coloumb Friction 2

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the PROPT Manual. See PROPT Manual.

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; t_F ] to minimize


subject to:


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

Problem setup

toms t
toms t_f

p = tomPhase('p', t, 0, t_f, 40, [], 'gauss');
setPhase(p);

tomStates q1 q1dot q2 q2dot
tomControls u1 u2

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

% Box constraints
cbox = {1.8 <= t_f <= 4
    -4  <= collocate(u1) <= 4
    -4  <= collocate(u2) <= 4};

% Boundary constraints
cbnd = {initial({q1 == 0; q1dot == -1
    q2 == 0; q2dot == -2})
    final({q1 == 1; q1dot == 0
    q2 == 2; q2dot == 0})};

k1 = 0.95; k2 = 0.85;
m1 = 1.1;  m2 = 1.2;
mmu = 1;

% ODEs and path constraints
ceq = collocate({dot(q1) == q1dot
    m1*dot(q1dot) == (-k1-k2)*q1+k2*q2-mmu*sign(q1dot)+u1
    dot(q2)       == q2dot
    m2*dot(q2dot) == k2*q1-k2*q2-mmu*sign(q2dot)+u2});

% Objective
objective = t_f;

Solve the problem

options = struct;
options.name = 'Coloumb Friction 2';
solution = ezsolve(objective, {cbox, cbnd, ceq}, x0, options);
t     = subs(collocate(t),solution);
q1    = subs(collocate(q1),solution);
q2    = subs(collocate(q2),solution);
q1dot = subs(collocate(q1dot),solution);
q2dot = subs(collocate(q2dot),solution);
u1    = subs(collocate(u1),solution);
u2    = subs(collocate(u2),solution);
q1dot_f = q1dot(end);
q2dot_f = q2dot(end);
Problem type appears to be: lpcon
Time for symbolic processing: 0.17558 seconds
Starting numeric solver
===== * * * =================================================================== * * *
TOMLAB - TOMLAB Development license  999007. Valid to 2011-12-31
=====================================================================================
Problem: ---  1: Coloumb Friction 2             f_k       2.125397251986161700
                                       sum(|constr|)      0.000006640472891742
                              f(x_k) + sum(|constr|)      2.125403892459053300
                                              f(x_0)      1.800000000000000000

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

FuncEv    1 ConstrEv   33 ConJacEv   32 Iter   27 MinorIter  388
CPU time: 0.187201 sec. Elapsed time: 0.186000 sec. 

Plot result

subplot(2,1,1)
plot(t,q1,'*-',t,q2,'*-');
legend('q1','q2');
title(sprintf('Coloumb Friction 2, q1dot_f = %g, q2dot_f = %g',q1dot_f,q2dot_f));

subplot(2,1,2)
plot(t,u1,'+-',t,u2,'+-');
legend('u1','u2');
title('Coloumb Friction 2 controls');

ColoumbFriction2 01.png