From: Didi Cvet on 10 Sep 2009 06:14 Hi I am using fmincon to optimize this function by knot and param function J=objfun(knot, param, k, P) x=P(:,1); knot=sort(knot); param=sort(param); M=spcol(knot, k, param); Mplus=pinv(M); d=Mplus*P; C=spmak(knot, d'); % plot(P(:,1),P(:,2),'mo',d(:,1), d(:,2), 'rx') Cc=(fnval(C,param))'; hold on % plot(Cc(:,1), Cc(:,2), 'c*') err1=(Cc(:,1)-P(:,1)).^2+(Cc(:,2)-P(:,2)).^2; J=sum(err1); When I optimize by knot it's ok but when I start to optimize by param I get infeasible start point. By the way my start point is param0=linspace(a,b,n); where a and b are end points of the interval. As I know we get feasibility of the points by checking the constraints in the point (I'm not shure for this) but if this is true here is my confun: function [c ceq]=confun1(pm, kn, k, T) for i=1:length(pm) l(i)=kn(i)-pm(i)-1e-6; r(i)=pm(i)-kn(i+k)-1e-6; end c = [l'; r'; (diff(pm)-T+1e-6)'; (-diff(pm)+1e-6)']; ceq = [sum(diff(pm))-T]'; As a result of infeasible start point I get Hessian not udated so my optimization doesn't work. I have two questions: Why I get infeasible start point when my start point satisfy constraints? and what does it mean hessian not ubdated for the optimization? Thanks!
|
Pages: 1 Prev: 2D Phase Unwrapping Algorithms Next: Indexing in 3D matrix |