I need a code for this question or link for example. I cant found any example in Matwork for CVX. I attached below the question to ensure everyone know exactly what i searching for..

4 vues (au cours des 30 derniers jours)
The question is: Consider a power system with three generators. The operating cost functions are C1(PG1) = 5 + PG12, C2(PG2) = 5 + PG2 + 0.5PG22, C3(PG3) = 3 + 2PG3 + 3PG32. (1) The power generation limits of the generators are 0 ≤ PG1 ≤ 8, 0 ≤ PG2 ≤ 9, 0 ≤ PG3 ≤ 10. (2) Use CVX to solve the economic dispatch problem described by (1) and (2). What are the optimal power output levels of the generators? The problem here is how to use CVX? I already install CVX in Matlab. Please help me with the code or any useful link for example. Thank you in advance.
  2 commentaires
Yangyadatta Tripathy
Yangyadatta Tripathy le 6 Juil 2022
Modifié(e) : Yangyadatta Tripathy le 6 Juil 2022
I have formulated a similar problem. Do check it out. You've not mentioned the Load-Generation balance constraint. You can reformulate the problem accordingly.
clc
n=3;
a(1:n)=[1 3 2]; % Cost Coefficients
b(1:n)=[2 4 5]; % Cost Coefficients
c(1:n)=1; % Cost Coefficients
Cost(1:n)=0;
Pd=1000; % Demand
P(1:n)=400; % Assuming all generations have same Power Output
Cost=sum(Cost);
cvx_solver gurobi
cvx_begin
variable x(n)
for k=1:n
Cost = sum(a' .*(x .^2) + b' .*x + c'); % Objective function for eco dispatch
end
minimize Cost
subject to
0 <= x <= 400 % Inequality Constraint
sum(x) == Pd % Equality Constraint
cvx_end

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by