From: Ozge Taskan on 11 Apr 2010 11:50 Hi, I am pretty new at Matlab. I am dealing with a problem with has one constraint and I try to solve the problem by using lagrangian relaxation method. However at first I try to get a result for my subproblem. My model is (not in matlab form): Min over i (sum(h(i).s(i))) over i (sum(m(i)/sum(m))* beta(si)) >= beta0 0<=s I try to solve this with function f = myfun(s) h=[100 200 300]; m=[1 2 3]; u=[100 100 100]; beta0=0.98; s0=[0 0 0]; f =sum(h.*s)+sum(u.*(beta0-sum((m.*poisscdf(s-1,100))./sum(m(1:3))))); >>lb=[0 0 0]; >>A=[]; >>b=[]; >>Aeq=[]; >>beq=[]; >>s = fmincon(@myfun,s0,A,b,Aeq,beq,lb,ub) however I cannot get a solution other than zeros. However I expect that it should assign values to s to minimize. If you help me, I would be very glad. Best regards, Ozge
|
Pages: 1 Prev: Learn using Data structures Next: following functions correct otr wrong? |