project

Purpose

Compute the projection of the point onto this set.

Syntax

s = S.project(x)
s = project(S, x)

Description

Compute the projection of the point x onto this set. The projection problem can be also explained as finding the closest point y from the set S to the given point x.

Input Arguments

S

A convex set described as YSet object.

Class: YSet

x

A point given as vector. Note that for YSet with symmetric matrix variable, the point x must be given as vector with symmetric terms.

Class: double

Output Arguments

s

The output structure with the information about the projected point and the exit status from the optimization.

Class: struct

s.exitflag

Exit status from the optimization, i.e. an integer value that informs if the result was feasible (1), or otherwise (different from 1).

Class: double

s.how

A string that informs if the result was feasible ('ok'), or if any problem appeared through optimization.

Class: char

s.x

Projected point that lies inside the set S.

Class: double

s.dist

The distance between the projected point and the given point x.

Class: double

Example(s)

Example 1

Create a set S in 2D as follows.
x = sdpvar(2,1);

F = [x'*x-2*x<=1];

S = YSet(x,F);
Compute the projection of the point v=[-0.5; 1.5].
v = [-0.5; 1.5];

s = S.project(v);
 The computed extreme point is lying the edge of the set and it is obviously the point [0;1] We can plot the set and the points s.x, v. 
 S.plot; hold on; text(s.x(1),s.x(2),'\bf x'); axis([-1 1.5 -0.5 2]); text(v(1),v(2),'\bf x');
Plotting...
26 of 40

../../../../../../fig/mpt/modules/geometry/sets/@YSet/project_img_1.png

The computed distance must be
 norm(s.x-v) 
ans =

         0.707106781189978

which equals the computed distance
 s.dist 
ans =

         0.707106781189978

See Also

contains, extreme, shoot


© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch

© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch