Hey,
I'm new, so sorry if I somehow messed up by posting in the wrong place. Anyway, onto my question: I defined two functions
\[Beta][w_, x_] :=
Piecewise[{{0,
w < 150 && x < 150}, {1/
3, (w < 150 && 150 <= x < 300) || (150 <= w < 300 &&
x < 150)}, {1/
2, (w < 150 && x >= 300) || (x < 150 && w >= 300)}, {2/
3, (150 <= w < 300 && 150 <= x < 300)}, {5/
6, (150 <= w < 300 && x >= 300 ) || (150 <= x < 300 &&
w >= 300 )}, {1, w >= 300 && x >= 300}}]
and
\[Gamma][w_, x_, y_] :=
Piecewise[{{0,
w < 150 && x < 150 && y < 150}, {1/
3, (150 <= w < 300 && x < 150 && y < 150) || (150 <= x < 300 &&
w < 150 && y < 150) || (150 <= y < 300 && w < 150 &&
x < 150)}, {1/
2, (w >= 300 && x < 150 && y < 150 ) || (x >= 300 && w < 150 &&
y < 150 ) || (y >= 300 && x < 150 && w < 150 )}, {2/
3, (150 <= w < 300 && 150 <= x < 300 &&
y < 150) || (150 <= w < 300 && 150 <= y < 300 &&
x < 150) || (150 <= y < 300 && 150 <= x < 300 && w < 150)}, {5/
6, (w >= 300 && 150 <= x < 300 && y < 150) || (w >= 300 &&
150 <= y < 300 && x < 150) || (x >= 300 && 150 <= w < 300 &&
y < 150) || (x >= 300 && 150 <= y < 300 &&
w < 150) || (y >= 300 && 150 <= w < 300 &&
x < 150) || (y >= 300 && 150 <= x < 300 &&
w < 150)}, {1, (w >= 150 && x >= 150 && y >= 150) || (w < 150 &&
x >= 300 && y >= 300) || (x < 150 && w >= 300 &&
y >= 300) || (y < 150 && x >= 300 && w >= 300)}}]
and then use them along with a third piecewise function in one variable
\[Alpha][w_] :=
Piecewise[{{0, w < 150}, {1/3, 150 <= w < 300}, {1/2, w >= 300}}]
The piecewise functions themselves all work, but I get an error when evaluating:
NMinimize[{w + x + y + z,
w + \[Alpha][w] x + \[Beta][w, x] y + \[Gamma][w, x, y] z >= 1/3 &&
w \[Element] PositiveIntegers && x \[Element] PositiveIntegers &&
y \[Element] PositiveIntegers &&
z \[Element] PositiveIntegers }, {w, x, y, z}]
Can anyone tell me why this doesn't work and if there is some way to do this correctly? Thank you very much!