I want to put x as non negative decision variable in the following code, so how can I put this constraint in the code?
proc iml;
start fun(x)global(m,l,g);
sumf=0;
do i = 1 to 3;
sumf = sumf + (m*l)+ (g* k)**2 /(l+ x)**2;
end;return (sumf);finish fun;
start con(k) global(cl,l);
c=j(2,1,0);
sumc1=0; do i = 1 to 2;sumc1 = sumc1 + (cl1**2 *l/(l+x)**2);end;
c[1]= 10-sumc1;
c[2]=(max(l)/min(l))-(max(l)+x)/(min(l)+x);
return (c);
finish con;
k=j(1,1,0);
optn=j(1,11,.); optn[11]=0; optn[10]=2;
call nlpqn (rc, kres, "fun", k, optn) nlc="con";
... View more