Question: problem in optimization

i have an optimization problem, i want to maximize an expression using assumption, what should i do?


 

restart:with(Optimization):

M1:=Matrix((1,4),[sqrt(p),0,0,sqrt(1-p)]);

M1 := Matrix(1, 4, {(1, 1) = p^(1/2), (1, 2) = 0, (1, 3) = 0, (1, 4) = (1-p)^(1/2)})

(1)

M2:=Matrix((1,4),[cos(theta[1])*cos(theta[2]),exp(I*phi[1])*sin(theta[1])*cos(theta[2]),exp(I*phi[2])*sin(theta[2])*cos(theta[1]),exp(I*(phi[1]+phi[2]))*sin(theta[1])*sin(theta[2])])^+;

M2 := Matrix(4, 1, {(1, 1) = cos(theta[1])*cos(theta[2]), (2, 1) = exp(I*phi[1])*sin(theta[1])*cos(theta[2]), (3, 1) = exp(I*phi[2])*sin(theta[2])*cos(theta[1]), (4, 1) = exp(I*(phi[1]+phi[2]))*sin(theta[1])*sin(theta[2])})

(2)

#Real:=rhs(op(op(2,Re(M1.M2))));

PP:=Re(M1.M2)(1,1);

Re(p^(1/2)*cos(theta[1])*cos(theta[2])+(1-p)^(1/2)*exp(I*(phi[1]+phi[2]))*sin(theta[1])*sin(theta[2]))

(3)

maximize(PP) assuming 0<p ,p<1;

Error, (in assuming) when calling 'maximize'. Received: 'invalid input: `minimize/continuous` expects its 2nd argument, yFP, to be of type {name, list(name)}, but received `theta[1]` = -infinity'

 

 


 

Download optimize.mw

Please Wait...