Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
p_loss q_loss
9.9413 39.47
proc optmodel;
/* Parameters */
/* Buses: ********************************************************/
number sb = 100; /* Base power in MVAr */
number nB = 14; /* Number of buses */
set <number> GBUS = {1,2,6} ;
/* Set of buses with generation */
/* Load buses: */
number pl{ 1..nB} = [0 21.7 94.2 47.8 7.6 11.2 0 0 29.5 9 3.5 6.1 13.5 14.9];
/* Active load [MW]*/
number ql{ 1..nB} = [0 12.7 19 -3.9 1.6 7.5 0 0 16.6 5.8 1.8 1.6 5.8 5];
/* Reactive load [MVAr] */
/* Generation buses : */
number cq{ GBUS } = [ 0.005 0.005 0.005]; /* Quadratic cost coeficients
[BTu/hMW2] */
number cl{ GBUS } = [ 2.450 3.510 3.890]; /* Linear cost
coeficients [BTu/MWh] */
number cb{ GBUS } = [ 105 44.1 40.6]; /* Constant cost
coeficients [BTu/h] */
number pg_min{ GBUS} = [10 20 20]; /* Max. active power generation [MW]*/
number pg_max{ GBUS} = [160 80 50]; /* Min. active power generation [MW]*/
*/number qg_max{ GBUS} = [ 200 1000 1000]; /* Max. reactive power generation
[MVAr]*/
*/number qg_min{ GBUS} = [ 0 -1000 -1000]; /* Min. reactive power generation
[MVAr]*/
number v_min = 0.95; /* minimum voltage magnitude [pu]*/
number v_max = 1.05; /* maximum voltage magnitude [pu]*/
number refB = 1; /* reference bus */
*/Substituim;
number qg_max{GBUS} = [ 1e6 1e6 1e6]; /* Max. reactive power generation
[MVAr]*/
number qg_min{GBUS} = [ -1e6 -1e6 -1e6]; /* Min. reactive power generation
[MVAr]*/
/* Lines: ********************************************************/
set <number, number> LINES = {<1,2>, <1,5>, <2,3>,<2,4>,<2,5>,
<3,4>,<4,5>,<4,7>,<4,9>,<5,6>,<6,11>,<6,12>,<6,13>,<7,8>,
<7,9>,<9,10>,<9,14>,<10,11>,<12,13>,<13,14>}; /* Set of lines == 20 */
/* Decision variables */
var PG { i in GBUS } >= pg_min[i]/sb <= pg_max[i]/sb; /* Active power
generation at bus "i" (MW) */
var QG { i in GBUS } >= qg_min[i]/sb <= qg_max[i]/sb;
*/var QG { i in GBUS } ;
*/var QG { i in GBUS }; /* Reactive power generation at bus "i" (MVAr) */
var V { i in 1..nB } >= v_min <= v_max; /* Voltage magnitude at
bus "i" (p.u.) */
var Th { i in 1..nB } >=-2*constant('PI') <=2*constant('PI'); /* Voltage phase
at bus "i" (p.u.) */
fix Th[refB]=0; /* Reference bus */
var P { <i,j> in LINES} init 1; /* Line active power
flow (MW) */
var Q { <i,j> in LINES} init 1; /* Line reactive power
flow (MVAr) */
/* Objective function */
min Total_Cost = sum{ i in GBUS } ( cq[i]*(sb*PG[i])^2+cl[i]*sb*PG[i]+cb[i] );