I'm new to mathematica, so please be forbearing with me :D
I would like to use NMaximize together with domain restriction (where the domain is a custom domain).
I've got an example:
dom = {1, 2, 3, 4};
NMaximize[{UP[fl, a, p], UA[fl, a, p] >= resutil,
D[UAS[fl, a, p], X[a]] == D[DA[a], a], MemberQ[dom, a] == True}, {a,
p}]
I would like to maximize UP(.), subject to the given constraints (including that the result for a is a member of dom).
The maximization works fine if I set the constraint to a \[Element] Integers
:
NMaximize[{UP[fl, a, p], UA[fl, a, p] >= resutil,
D[UAS[fl, a, p], X[a]] == D[DA[a], a], a \[Element] Integers}, {a,
p}]
Is there a way to include such a constraint into NMaximize?
Thank you very much for your help :)
Integers
with addingUP>0&&UP<5
in the curly brackets? $\endgroup$dom
is a small list in fact, what's the trouble with brute-force enumeration? $\endgroup$dom
is not necessarily a small list. Anyhow, even ifdom
were a small list,p
can take any value (i.e., there are a lot possible combinations ofa
andp
) $\endgroup$