Dear Dr. Zimmerman, Dear community
I am working on a *multitemporal OPF with storage device using Matpower*
To implement this problem I need to introduce new variables in the OPF
formulation.
Two of these variables are integers, 'alphaCH'and 'alphaDS' .
using the runopf function the solution converges but unfortunately the
variables 'alphaCH' 'alphaDS'are treated as continuous and not integer
variables
*Using Matpower 6.0 this is the code by which I add the function during the
formulation:*
function om = userfcn_multitemporalOPF_formulation(om, args)
global LoL LoI no_period no_SD SoCMax SoCmin SoC0;
define_constants;
% mpc = get_mpc(om);
no_SD = 1;
no_gen = 5;
no_ts = 24;
%% ADD Variable
om = add_vars(om,'alphaCH', no_SD * no_ts, 0, zeros(no_SD * no_ts, 1), ones(
no_SD * no_ts, 1), 'I');
om = add_vars(om,'alphaDS', no_SD * no_ts, 0, zeros(no_SD * no_ts, 1), ones(
no_SD * no_ts, 1), 'I');
%% ADD Constrains
% contraints on State of Charge
A = args.Ar;
l = ones(args.no_period*args.no_SD,1).*(args.SoCmin-args.SoC0)/args.baseMVA;
u = ones(args.no_period*args.no_SD,1)*(args.SoCMax-args.SoC0)/args.baseMVA;
om = add_constraints(om, 'SoC', A, l, u,{'Pg'});
% constraint that avoid charge and discharge at the same time
om = add_constraints(om, 'Pch_plus_aplha', args.Ar_CH, [], zeros(no_SD *
no_ts,1), {'Pg','alphaCH'});
om = add_constraints(om, 'Pds_plus_aplha', args.Ar_DS, [], zeros(no_SD *
no_ts,1), {'Pg','alphaDS'});
om = add_constraints(om, 'a_a',args.Ar_a_a, zeros(no_SD * no_ts, 1), ones(
no_SD * no_ts, 1), {'alphaCH', 'alphaDS'} );
Who can tell me why matpower doesn't treat the two variables as whole
numbers?
Diego Piserà