Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
This works, but finds a local maximum. For example, if the constraints are 0<=x<=1 && x==2,y==1 it finds 1, not 2. I have been using rule = NMaximize[{x,0<=x<=1 && x==2,y==1},{x,y}] and x/.rule to good effect so far.