Objective Function Modification

50 views
Skip to first unread message

Kirn Zafar

unread,
Apr 24, 2024, 6:58:13 PM4/24/24
to Open-DSOPF
  Hi, Can anybody please elaborate the following snippet of the code.
 Here are the control variables declared.

 if 1==1: # PV Control variables 
 if 1==1: 
 model.P_control = pyo.Var(model.PVs, model.time, within=pyo.NonNegativeReals, bounds=(0.0,1.0), initialize=0.001)
 model.Thanphi_control = pyo.Var(model.PVs, model.time, bounds=(0.0,math.tan(math.acos(min_Cosphi))), initialize=0.001)  

Then 

# PV generation - PVs are constant power here
if 1==1:
def PV_P_rule(model, pv, t):
return PV_Gen_data[pv,'Profile'].loc[t] * model.P_control[pv,t]
model.PV_P= pyo.Expression(model.PVs,model.time, rule=PV_P_rule) # Active power generation at each bus from PVs
def PV_Q_rule(model, pv, t):
return model.PV_P[pv,t] * -model.Thanphi_control[pv,t]
model.PV_Q= pyo.Expression(model.PVs,model.time, rule=PV_Q_rule) # Reactive power generation at each bus from PVs

model.P_control and model.Thanphi_control are used here to define expressions. Then used in objective function. 

What if I want to minimize use of solar PV generators. How it can be added in objective function. 

Thank you so much!
Reply all
Reply to author
Forward
0 new messages