I am having trouble with maximizing a function I am interested in. Below is the code I am using.
NMaximize[{(p^2)^alpha + ((c - p)^2)^alpha + (1 - (c - p)^2 - p^2)^alpha,
{c/2 - Sqrt[2 - c^2]/2 < p, p < c/2 + Sqrt[2 - c^2]/2, c == 1.2, alpha == 0.7}}, {p}]
I get the following error:
NMaximize::bcons: "The following constraints are not valid: {alpha == 0.7, c == 1.2, c/2 - Sqrt[2 - c^2]/2 < p, p < c/2 + Sqrt[2 - c^2]/2}. Constraints should be equalities, inequalities, or domain specifications involving the variables."
Why is this happening?
c = 1.2; alpha = 0.7; NMaximize[ {(p^2)^alpha + ((c - p)^2)^alpha + (1 - (c - p)^2 - p^2)^ alpha, {c/2 - Sqrt[2 - c^2]/2 < p, p < c/2 + Sqrt[2 - c^2]/2}}, {p}]
$\endgroup$Plot[(p^2)^alpha + ((c - p)^2)^alpha + (1 - (c - p)^2 - p^2)^alpha, {p, 0, 1}]
$\endgroup$