[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sqp, objective and equality constraint gradients ?
From: |
Dupuis |
Subject: |
sqp, objective and equality constraint gradients ? |
Date: |
Thu, 10 Sep 2009 09:05:52 -0700 (PDT) |
Hello,
I have troubles getting sqp to work. Problem is defined as finding points on
an ellipse verifying some optimum condition.
objective: f =@(x) -prod(x);
gradient: fg = @(x) -[x(2); x(1)];
equality: ce = @(x) (x-center).'*M*(x-center) - level
gradient: ceg = @(x) 2*M*(x-center)
where x is a (2, 1) vector, center is a (2, 1) vector with the center
coordinates, M is symetric, positive definite and level the sum of square of
the distances between each point and the two ellipse defining points.
The call is as follows:
1) find some good candidate by trying a few points, let's call it xinit
2) lb = .95*xinit; ub = 1.05*xinit %# define a five percent search interval
3) [xopt, obj, info, iter, nf, lambda] = sqp(xinit, {f fg}, {ce ceg}, [],
lb, ub);
The problems are at line 343 and 377
F = feval (ce_grd, x);
C = feval (ci_grd, x);
A = [F; C];
F is supposed to be (n, 1); while C is (2*n, n): they are not compatible ...
I tried transposing F or padding F with zeroes : if line 343 succeeds, the
code fails elsewhere, f.i. in line 377: t4 = norm (lambda .* con) which
expects lambda (rows(F), 1) and con (= [ce; ci]) to be the same dimensions.
Could someone please tell me the expected dimensions of the various
gradients ?
Regards
Pascal
--
View this message in context:
http://www.nabble.com/sqp%2C-objective-and-equality-constraint-gradients---tp25385728p25385728.html
Sent from the Octave - General mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- sqp, objective and equality constraint gradients ?,
Dupuis <=