shoot

Purpose

Maximize along a given ray within the polyhedron.

Syntax

s = P.shoot(r, x0)
s = shoot(P, r, x0)

Description

Computes the solution to the optimization problem:

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/shoot4.png

The problem can be explained as to find the point that lies along the line given by the ray r which starts from the point x0 such that it still lies inside the set ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/shoot1.png. Typically, the solution of this set is the point that lies on the boundary of the set, or can be Inf if the set is unbounded.

Input Arguments

P

Polyhedron in any format

Class: Polyhedron

dir

Vector of size P.Dim

Class: double

x0

Vector of size P.Dim

Class: double

Default: Vector of all zeros

Output Arguments

ret

Optimal solution

Class: struct

ret.alpha

Maximum length of ray, [] if ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/shoot2.png is empty, Inf if unbounded.
ret.exitflag

Integer value informing about the termination status of the above optimization problem.

Class: double

Allowed values:

  • mptopt.OK
  • mptopt.INFEASIBLE
  • mptopt.UNBOUNDED
  • mptopt.ERR

ret.x

Extreme point of ray : ../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/shoot3.png

Example(s)

Example 1

Create polyhedron:
P = ExamplePoly.randHrep;
Choose direction and shoot:
r = randn(P.Dim,1); r = r/norm(r);

s = P.shoot(r);
Plot the result
P.plot; hold on; pplot([0 0;r'*s.alpha],'linewidth',3,'color','k');

../../../../../../fig/mpt/modules/geometry/sets/@Polyhedron/shoot_img_1.png

See Also

extreme


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