linfengYang / Dual-Consensus-ADMM-for-DC-OPF-CET

This study is using alternating direction method of multipliers (ADMM) approach for solving the direct current dynamic optimal power flow with carbon emission trading (DC-DOPF-CET) problem.
36 stars 11 forks source link

Compatibility with other versions of CPLEX and MATLAB #1

Open Vurgit opened 4 years ago

Vurgit commented 4 years ago

Thank you for your marvellous work, Prof Lin. Is the project compatible with other versions of CPLEX higher than 12.6.2 and MATLAB 2018b?What's more, is it also compatible with AC optimal power flow? Because I am going to do research on voltage and var optimization so DC OPF is not suitable.

luoshui3000 commented 4 years ago

This method is not applicable in AC-OPF problem resulting from non-convexity of AC power flow constraint. Although the AC power flow constraint can be relaxed to be convex semi-definite (SD) constraint or sec-ond-order cone (SOC) constraint [38], our method is also not applicable because the resulted SD and SOC constraints are not separable. [38] Y. L. Xu, J. F. Hu, W. Gu, W. C. Su and W. X. Liu, “Real-Time Distributed Control of Battery Energy Storage Systems for Security Constrained DC-OPF,” IEEE Trans. on Smart Grid, vol. 9, no. 3, pp. 1580-1589, May, 2018.

luoshui3000 commented 4 years ago

Every version of Cplex only support specific version of MATLAB. Otherwise, it may be cause some unknown problems.

Vurgit commented 4 years ago

Thank you for your reply Mr Luo, is it possible for me to download a CPLEX version corresponding to MATLAB R2018b to run the code correctly? Or it would be a bit troublesome to get another version. It can be seen that the nodal power balance constraints in your paper is based on the matrix of DC power flow calculation, in which the matrix of P-θ is linear and remains constant during iterations of power flow calc. It seems that the fast decoupled(or PQ decoupled) method has a similar form with DC power flow for it just adds the V-Q matrix and P-θ and V-Q matrix are actually totally decoupled and remains constant during iteration (linear actually). Is it possible to apply to your method to cases like this?

luoshui3000 commented 4 years ago

In my opinion, the code can run correctly with the latest Cplex version.

luoshui3000 commented 4 years ago

Theoretically, our method can effectively solve DC-DOPF problem with complex constraints (i.e., CET, DR), as long as these constraints are convex and separable.

ruyidao commented 2 years ago

I'm very confused. How can I get the picture of the result with MATLAB? I hope to get your reply.

luoshui3000 commented 2 years ago

Do you mean how to get the picture such as Fig. 7 in the article? If you want to get the result of Fig. 7 in the article, you need to make changes yourself based on the program uploaded in GitHub.

ruyidao commented 2 years ago

Yes,I want to get something like Fig. 7, but the program will fail, and maybe I'm using it the wrong way

luoshui3000 commented 2 years ago

You need to make changes as the following: The \rho corresponding to the x-axis in Fig. 7 for \rho = 0.1:0.02:0.9
the program currently upload in the Github end

luoshui3000 commented 2 years ago

function [ ] = DCOPF_ADMM( ) for \rho = 0.1:0.02:0.9 FileName = 'SCUC_dat/DDOPF118.txt'; type_of_pf = 'DC'; %The type of optimal power flow. .......... .......... the program currently uploaded in the Github .......... end

ruyidao commented 2 years ago

Do you mean I need to put ‘for \rho = 0.1:0.02:0.9’ in between?

luoshui3000 commented 2 years ago

Yes, This is just an example. The value of \rho is set according to the range of \rho in the picture.

ruyidao commented 2 years ago

THANKYOU Mr luo. If I want to output a graph, could I simply use 'plot (rou,k)', but that doesn't seem to output a graph.

luoshui3000 commented 2 years ago

According to the output data, I use the software Origin to draw the picture.

luoshui3000 commented 2 years ago

%An example of drawing pictures in Matlab is as follows: function [ ] = PrintImpact1( ) out_figure =1;

if out_figure == 1 x1 = [0.11,0.14,0.17]; y1 = [1288,1030,4000]; y2 = [1474,1170,950];

close all;
hold on;
plot(x1,y1,'-kv','MarkerSize',6,'LineWidth',2);
plot(x1,y2,'-ro','MarkerSize',6,'LineWidth',2);
xlabel('{\itρ}','FontSize',14);
ylabel('Iteration','FontSize',14);
legh = legend('30-bus,Case 1,After reduction','30-bus,Case 1,Reduce before');
set(legh,'FontSize',14);
set(gca,'XTick',[0.1:0.1:1],'XMinorTick','on') 
set(gca,'YTick',[250:250:4250],'YMinorTick','on') 

% grid on; % set(gca,'GridLineStyle','--','GridColor','k','GridAlpha',1); grid minor; set(gca,'MinorGridLineStyle',':','MinorGridColor','k','MinorGridAlpha',1); end

end

ruyidao commented 2 years ago

OK, I see, thank you Mr. Luo. I am a senior undergraduate student, and my graduation project is related to this. However, my matlab foundation is very weak and I am very anxious now. If possible, can I get some pointers from you?

ruyidao commented 2 years ago

Mr Luo, can I ask how to get the data of the node voltage after iteration?

luoshui3000 commented 2 years ago

The formulation and data in our article are used for the direct current optimal power flow (DC-OPF) problem. Therefore, there is no data of node voltage. This method is not applicable in alternating current optimal power flow(AC-OPF) problem resulting from non-convexity of AC power.