I need to find the minimum of a function $mj_1^2+mj_2^2$ where my $mj$ are constrained.
I wrote this expression:
ArgMin[
{mj1^2 + mj2^2, mj1 == (M1 + 1)*p1, p1 ∈ Integers,
mj2 == (M2 + 1)*p2, p2 ∈ Integers,
MemberQ[{mj1, mj2} , couplesm]}, {mj1, mj2}]
Indeed, my mj
's must be multiples of Mj + 1
, and they musn't be part of a list given by couplesm
.
When I evaluate it, I get the following message;
ArgMin::infeas: There are no values of {mj1, mj2} for which the constraints False are satisfied and the objective function mj1^2 + mj2^2 is real valued.
I even added p1
and p2
to the variables of minimization, but it still didn't work.
How can I find the minimum of: $mj_1^2+mj_2^2$, where $mj_i$ is a multiple of $M_i+1$ and where the pairs $(mj_1,mj_2)$ can't be inside of the list couplesm
?
Edit
I wrote the following and the code still doesn't work.
couplesm = {{0, 0}}
{{0, 0}}
ArgMin[
{mj1^2 + mj2^2,
IntegerQ[mj1/(M1 + 1)], IntegerQ[mj2/(M1 + 1)],
mj1 ∈ Integers, mj2 ∈ Integers,
Sequence @@ Table[{mj1, mj2} != couplesm[[i]], {i, 1, Length[couplesm]}]},
{mj1, mj2}]
ArgMin::infeas: There are no values of {mj1,mj2} for which the constraints False are satisfied and the objective function mj1^2+mj2^2 is real valued.
{Indeterminate, Indeterminate}
Comments
Post a Comment