optim suggestion
Gianluca Antonelli
antonelli1970 at gmail.com
Fri Feb 11 11:07:22 CET 2011
Hi,
I would like to ask for advice to use the "optim" command for the
following optimization problem.
I need to find x that minimize
PHI*x = b
given some bound constraints on x, all its values are positive and
less than 1, some are null by definition.
The matrix PHI containts all 1 and zero except for the last row that
exhibits numbers of magnitude 1000
The vector b contains all numbers of magnitude 1 in correspondance to
the 1-0 of PHI except for the last row that contains a number of
magnitude 100000
I use the following code:
--------------
[f_opt, m_sol] = optim(costf,'b',m_min,m_max,.4*ones(m*n,1),imp=2);
function [f, g, ind] = costf(x, ind)
alpha = 0*1e-10;
W = eye(n*m,n*m);
Q = eye(m+1,m+1);
Q(m+1,m+1) = 1e-6;
f = (PHI*x - b)'*Q*(PHI*x - b) + alpha*x'*W*x;
g = 2*x'*(PHI'*Q*PHI+alpha*W)-2*b'*Q*PHI;
endfunction
---------
but I always receive error messages such as "linear search fail" or
similar.
Two questions:
a) any suggestion on the syntax/algorithm/etc.
b) the fact that some of the unknown are fixed with lower bound equal
to upper bound is a problem for the code?
thanks in advance,
g.
More information about the users
mailing list