File: quapro.man

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (141 lines) | stat: -rw-r--r-- 3,885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
.TH quapro 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an 
.SH NAME
quapro - linear quadratic programming solver
.SH CALLING SEQUENCE
.nf
[x,lagr,f]=quapro(Q,p,C,b [,x0])
[x,lagr,f]=quapro(Q,p,C,b,ci,cs [,x0])
[x,lagr,f]=quapro(Q,p,C,b,ci,cs,me [,x0])
[x,lagr,f]=quapro(Q,p,C,b,ci,cs,me,x0 [,imp])
.fi
.SH PARAMETERS
.TP
Q
: real symmetric matrix (dimension \fVn x n\fR).
.TP
p 
: real (column) vector (dimension \fV n\fR)
.TP
C 
: real matrix (dimension \fV (me + md) x n\fR)
(If no constraints are given, you can set \fVC = []\fR)
.TP
b 
: RHS column vector (dimension \fV (me + md)\fR)
(If no constraints are given, you can set \fVb = []\fR)
.TP
ci 
: column vector of lower-bounds (dimension \fVn\fR).
If there are no lower bound constraints, put \fVci = []\fR.
If some components of \fVx\fR are bounded from below,
set the other (unconstrained) values of \fVci\fR to a very 
large negative  number (e.g. \fVci(j) = -(% eps)^(-1)\fR.
.TP
cs 
: column vector of upper-bounds. (Same remarks as above).
.TP
me 
: number of equality constraints (i.e. \fVC(1:me,:)*x = b(1:me)\fR)
.TP
x0 
: either an initial guess for \fVx\fR 
  or one of the character strings \fV'v'\fR or \fV'g'\fR.
If \fVx0='v'\fR the calculated initial feasible point is a vertex.
If \fVx0='g'\fR the calculated initial feasible point is arbitrary.
.TP
imp 
: verbose option (optional parameter)   (Try \fVimp=7,8,...\fR).
warning the message are output in the window where scilab has been
started.
.TP
x 
: optimal solution found.
.TP
f 
: optimal value of the cost function (i.e. \fVf=0.5*x'*Q*x+p'\fR).
.TP
lagr 
: vector of Lagrange multipliers. 
If lower and upper-bounds \fVci,cs\fR are provided, \fVlagr\fR has 
\fVn + me + md\fR components and \fVlagr(1:n)\fR is the Lagrange 
vector associated with the bound constraints and 
\fVlagr (n+1 : n + me + md)\fR is the Lagrange vector associated 
with the linear constraints.
(If an upper-bound (resp. lower-bound) constraint \fVi\fR is active 
\fVlagr(i)\fR is > 0 (resp. <0).
If no bounds are provided, \fVlagr\fR has only \fVme + md\fR components.
.SH DESCRIPTION
.Vb [x,lagr,f]=quapro(Q,p,C,b [,x0])
.LP
Minimize \fV0.5*x'*Q*x + p'*x\fR
.PP
under the constraint 
.nf
C*x <= b
.fi
.LP
.Vb [x,lagr,f]=quapro(Q,p,C,b,ci,cs [,x0])
.LP
Minimize \fV 0.5*x'*Q*x + p'*x \fR
.PP
under the constraints 
.nf
C*x <= b          ci <= x <= cs
.fi
.LP
.Vb [x,lagr,f]=quapro(Q,p,C,b,ci,cs,me [,x0])
.LP
Minimize \fV 0.5*x'*Q*x + p'*x \fR
.PP
under the constraints 
.nf
 C(j,:) x = b(j),  j=1,...,me
 C(j,:) x <= b(j), j=me+1,...,me+md
 ci <= x <= cs
.fi
.LP 
If no initial point is given the
program computes a feasible initial point
which is a vertex of the region of feasible points if
\fVx0='v'\fR.
.LP
If \fVx0='g'\fR, the program computes a feasible initial 
point which is not necessarily a vertex. This mode is
advisable when the quadratic form is positive
definite and there are  few constraints in
the problem or when there are large bounds
on the variables that are just security bounds and
very likely not active at the optimal solution. 
.LP
Note that \fVQ\fR is not necessarily non-negative, i.e.
\fVQ\fR may have negative eigenvalues.
.SH EXAMPLE
.nf
//Find x in R^6 such that:
//C1*x = b1 (3 equality constraints i.e me=3)
C1= [1,-1,1,0,3,1;
    -1,0,-3,-4,5,6;
     2,5,3,0,1,0];
b1=[1;2;3];
//C2*x <= b2 (2 inequality constraints)
C2=[0,1,0,1,2,-1;
    -1,0,2,1,1,0];
b2=[-1;2.5];
//with  x between ci and cs:
ci=[-1000;-10000;0;-1000;-1000;-1000];cs=[10000;100;1.5;100;100;1000];
//and minimize 0.5*x'*Q*x + p'*x with
p=[1;2;3;4;5;6]; Q=eye(6,6);
//No initial point is given;
C=[C1;C2] ; //
b=[b1;b2] ;  //
me=3;
[x,lagr,f]=quapro(Q,p,C,b,ci,cs,me)
//Only linear constraints (1 to 4) are active (lagr(1:6)=0):
[x,lagr,f]=quapro(Q,p,C,b,[],[],me)   //Same result as above
.fi
.SH SEE ALSO
linpro, optim
.SH AUTHOR
E. Casas, C. Pola Mendez