Concave - invaild

      cvx_begin
       variables Ps Pd R R1
       maximize ((1-t).*(R+R1)./CCCmax - t.*(Ps+Pd+Pc.*2)./Emax)
       subject to        
          Ps>0
          Ps<=Pmax
          Pd>0
          Pd<Pmax

10: R<=log((1-r).Ps.(1-x).hsr+N0.(1-x-x.*hrr.*s.r))/log(2)-log((1-r).(1-ks.*kr).Ps1.(1-x-x.*s.*r.*hrr).*hsr+(1-r).*s.*r.*Ps1.*hsr.*hrr.x+N0.(1-x-x.*s.*r.hrr))/log(2)-((1-r).(1-ks.kr).(1-x-x.*s.*r.*hrr).*hsr+(1-r).*s.*r.*hsr.*hrr.x)./((1-r).(1-ks.*kr).Ps1.(1-x-x.*s.*r.*hrr).*hsr+(1-r).*s.*r.*Ps1.*hsr.*hrr.x+N0.(1-x-x.*s.*r.hrr)).(Ps-Ps1)
R<=log(s.*r.*Ps.*hsr.*hrd.x+N0.(1-x-x.*s.*r.*hrr))/log(2)-log(s.*r.*Ps1.*hsr.*hrd.x.(1-kr.kd)+N0.(1-x-x.*s.*r.*hrr))/log(2)-s.*r.*hsr.*hrd.x.(1-kr.*kd)./(s.*r.*Ps1.*hsr.*hrd.x.(1-kr.kd)+N0.(1-x-x.*s.*r.hrr)).(Ps-Ps1)
R>=Cmin
10 is fault.
Disciplined convex programming error:
Illegal operation: {concave} - {invalid}

Check to see whether any of the input data is NaN. If you run CVX in a loop ans use optimal values from one problem as inputs to the next, the input data can be NaN if the previous problem was not solved to optimality, in which case the “optimal” variable values are populated with NaN.

Or maybe log of a negative or complex number.

‘‘log of a negative’’ leads to break the while