0

I am trying to use the cvx model to solve an optimization problem; here is my code:

    cvx_begin
    variable R(total_v,2)
    for eth=1:total_e
        i=1;
        for vth=1:total_v
            for lth=1:2
                u(i)=R(vth,lth)*lamda(vth)*bm*p_miss(x(vth))*I_lve(vth,lth,eth)/de(eth);
                i=i+1;
            end
        end
        f(eth)=3*(sum(u))^3;
    end
    F=sum(f);
    minimize(F)
    subject to
        for i=1:total_v
            for j=1:2
                R(i,j)>=0&&R(i,j)<=1
            end
        end
        for i=1:total_v
            sum(R(i,:))==1
        end
cvx_end  

The R is variable, and others have already been set. The error messages are:

Undefined function or variable 'op'.

Error in cvx/power>power_p (line 104) cvx_dcp_error( errs, op );

Error in cvx_binary_op (line 107) z = p.funcs{vu(1)}( vec(x), vec(y), varargin{:} );

Error in cvx/power (line 31) z = cvx_binary_op( BP, x, y );

Error in cvx/mpower (line 11) z = power( x, y, '^' );

Error in test_1 (line 75) f(eth)=3*(sum(u))^3;

So, can anyone tell what is/are the problems in my code?

Rody Oldenhuis
  • 37,726
  • 7
  • 50
  • 96

1 Answers1

0

CVX is trying to tell you that something is wrong with your target function but for some reason it fails in the process.
In any case, the problem is that your target function is non-convex. CVX only work for convex programming and 3*(sum(u))^3 is not convex. For more information take a look here.

ThP
  • 2,312
  • 4
  • 19
  • 25