A field that does not exist is referenced ‘log-valid’。
出错 cvx_remap>@(x)remap_str.(x) (line 99)
remapper = @(y) any( remap_big( cellfun( @(x)remap_str.(x), y ), : ), 1 );
出错 cvx_remap>@(y)any(remap_big(cellfun(@(x)remap_str.(x),y),:),1) (line 99)
remapper = @(y) any( remap_big( cellfun( @(x)remap_str.(x), y ), : ), 1 );
出错 cvx_remap (line 146)
r = remapper( varargin );
出错 cvx/pow_cvx (line 13)
remap_x2 = cvx_remap( ‘log-valid’ ) & ~remap_x1;
出错 cvx/pow_pos (line 15)
y = pow_cvx( x, p, ‘pow_pos’ );
出错 ceshi2 (line 26)
KFC=pow_pos(Kfc,4);
Where KFC is a function containing a variable PFC
What is the output of cvx_verson
Perhaps there is a bug. or a messed up installation.
Can you show us your complete program? If you insert the “statement”
Kfc`
just prior to the statement producing the error, what is the output?
This is my complete program. Please see how to solve the error?
cvx_begin
variable Pfc;
variable Pbat;
SOCbat=0.7;
SOCbat_opt=0.7;
SOCbat_max=0.8;
SOCbat_min=0.4;
SOCuc=0.7;
if SOCbat>=SOCbat_min && SOCbat<=SOCbat_max
Kbat=(1-2*(SOCbat-SOCbat_opt)/(SOCbat_max-SOCbat_min))^8;
else
Kbat=(1-2*(SOCbat-SOCbat_opt)/(SOCbat_max-SOCbat_min))^16;
end
Nfc_opt=0.7;
Nfc_max=0.8;
Nfc_min=0.6;
Pfc_rating=10000;
Nfc=Pfc/Pfc_rating;
Kfc=(1-2*(Nfc-Nfc_opt)/(Nfc_max-Nfc_min));
KFC=pow_pos(Kfc,4);
k=0.5;
t=1.2;
p=0.4;
Cfcave=0.02;
Pfcave=6400;
Ndisch=0.95;
Ndischave=0.95;
Nch=0.95;
Nchave=0.95;
BAT=(Pbat*Ndischave*Nch*Cfcave)/Pfcave;
f=2;
gc=70;
cz=200;
a=0.5;
I=1;
r=8.314;
T=358.15;
e=1.7707;
Vfc=380;
F=96487;
Ifc=Pfc/Vfc;
FC=1.2*f*gc*Ifc/(2*F);
A1=[1,0];A2=[-1,0];A3=[0,1];A4=[0,-1];
b1=(1);b2=(-0.4);b3=(20000);b4=(0);
m=[SOCbat;Pfc];
t1=0.004;
minimize (-Kbat*BAT-KFC*FC-t1*(log(-(A3*m-b3)*(-A4*m+b4)))) %-Kbat*BAT-Kfc*FC-t2*(log(-(A3*m-b3)*(-A4*m+b4)))
subject to
SOCbat<=1;
-SOCbat<=-0.4;
Pfc<=20000;
-Pfc<=0;
Pbat<=10000;
-Pbat<=0;
Pbat+Pfc==ccc(i,:);
cvx_end
ccc is my mat input pfile。
CVX 3.0beta is riddled with bugs. Please remove all vestiges of CVX 3.0beta from the MATLAB path, and install CVX 2.2.
The objective function is not in compliance with CVX’s rules. Have you verified that it is convex? Please carefully read the following:
thanks very much ,but also has a matter which:
Disciplined convex programming error:
Cannot perform the operation: {convex} .* {real affine}
How to solve it? please !
The problem should be KFC * FC of the objective function
Did you read the 2nd paragraph of my previous post, along with the link in that post?
I read it and reinstalled the cvx2.2 version. The current error is that CVX cannot perform real affine * convert. How can I modify it? How to solve this?
Your problem needs to be be convex.