How to optimize a symbolic objective function subject to two constraints?

I am trying to find the maximum of: q*(M-c)*((L-p)*y+(x+y)*(.5*(L-n)*(k*(L+n+1)-2))+y*.5*k*(L-p)*(L+p+1)) subject to the following two constraints:
1) L:=floor(solve((L+p)/2-y*(Dn/L+M)-(1-k*L)*((2*k*(L)^2+(L)*(k*(2*n-1)-3)+n*(2*k*n+k-3))/(3*(k*(L+n)-2))-x*(Ds/L+M)-y*(Dn/L+M))-k*L*((2*(L)^2+2*(L)*n-L+2*n^2+n)/(3*(L+n))-y*(Ds/L+M))=0,L))
2) p:=floor(solve(p/2+1/2-(L+p)/2+y*(Dn/p+M))=0,p))
I really found the pdf at the bottom of this message helpful, but I still can't figure it out. I have tried just taking derivatives manually in Mupad, but since I can't find an analytical solution for L, this didn't get me very far. I also tried to use fmincon, but this function is thrown off by the fact that floor() is not a continuous function. Any help or even ideas would be greatly appreciated!

Answers (0)

Asked:

on 26 Nov 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!