Please post your complete program by copy and paste into your post , using the Preformatted text icon, (6th icon from left at top of posting box, not posting an image.

Dear Mark, thanks for your help! There has a question is that the energy is totally different from the results of max(Vz,0) in energy = max(Vz,0). The code I used is as following cvx_begin variable objective variables Z1(1,N) Vz(1,N-1) f(K,N) f_u(K,N) expression Ec expression energy energy = max(Vz,0); Ec = deta_t*G*sum(energy); minimize ( objective ) subject to deta_t.*P1.*sum(sum(assignment1))+deta_t*sum(sum(smallk*pow_p(f,3)))<= objective; theta_k <= (180/pi)*v_lb; f >= 0; f <= f_kmax; f_u >= 0; sum(f_u,1) <= ones(1,N)* f_umax; sum(f,2)+sum(f_u(:,2:N),2) >= input_data; for n = 2: N sum(assignment1(:,1:n-1).*r_lb(:,1:n-1),2) >= sum(f_u(:,2:n),2); end r_lb >= 0; for i = 1: N-1 %%（4-1=3 Z1(1,i+1) - Z1(1,i)==Vz(1,i)*deta_t; abs(Vz(1,i)) <= Vzmax; end Z1(1,1) == Z1(1,N); Hmin <= Z1; Z1 <= Hmax; cvx_end

The results of these two parts are

energy = 1.0e+06 *[4.2600 4.2600 4.2600 4.2600 4.2600 4.2600 4.2600 4.2600 4.2600 4.2600 ... 4.2600] A matrix of 39 columns per row