DSPRelated.com
Forums

Lagrange multipliers in fminsearch

Started by dhacademic January 27, 2011
Hi everyone,

I have a question about using Lagrange mulitpliers in Fminsearch.

For y=f(x) which subject to g(x)=c, a new function y=f(x)+lambda*(g(x)-c) is
constructed. Then I use "fminsearch" to minimize the new function. However,
it seems that the Lagrange multipliers does not work in the minimization. In
another word, the g(x)=c can not be achieved.

My input is shown below. Is there any problem in my calculation? Any
suggestion is appreciated!

Best,
Hao
% my function, where m and n are variables %
Y = k1 .* (m1) .* (n1) + k2 .* (m1) .* (n2) + k3 .* (m1) .* (n3) + k4 .*
(m1) .* (n4) + k5 .* (m2) .* (n1) + k6 .* (m2) .* (n2) + k7 .* (m2) .* (n3)
+ k8 .* (m2) .* (n4) + k9 .* (m3) .* (n1) + k10 .* (m3) .* (n2) + k11 .*
(m3) .* (n3) + k12 .* (m3) .* (n4) + k13 .* (m4) .* (n1) + k14 .* (m4) .*
(n2) + k15 .* (m4) .* (n3) + k16 .* (m4) .* (n4) + lambda1 .* ((m1) + (m2) +
(m3)) + lambda2 .* (1 - (n1) - (n2) - (n3) - (n4));
% part of my main.m file %
[sita,fval,exitflag,output] fminsearch('sd',initsita,optimset('MaxFunEvals',20000),data);