0001 classdef opf_model < opt_model 0002 %OPF_MODEL Constructor for OPF model class. 0003 % OM = OPF_MODEL(MPC) 0004 % 0005 % This class implements the OPF model object used to encapsulate 0006 % a given OPF problem formulation. It allows for access to optimization 0007 % variables, constraints and costs in named blocks, keeping track of the 0008 % ordering and indexing of the blocks as variables, constraints and costs 0009 % are added to the problem. 0010 % 0011 % This class is a sub-class of OPT_MODEL and simply adds the 'mpc' 0012 % field for storing the MATPOWER case struct used to build the object 0013 % along with the get_mpc() method. 0014 % 0015 % The following is the structure of the data in the OPF model object. 0016 % 0017 % om 0018 % <opt_model fields> - see OPT_MODEL for details 0019 % .mpc - MATPOWER case struct used to create this model object 0020 % .baseMVA 0021 % .bus 0022 % .branch 0023 % .gen 0024 % .gencost 0025 % .A (if present, must have l, u) 0026 % .l 0027 % .u 0028 % .N (if present, must have fparm, H, Cw) 0029 % .fparm 0030 % .H 0031 % .Cw 0032 % 0033 % See also OPT_MODEL. 0034 0035 % MATPOWER 0036 % Copyright (c) 2008-2017, Power Systems Engineering Research Center (PSERC) 0037 % by Ray Zimmerman, PSERC Cornell 0038 % 0039 % This file is part of MATPOWER. 0040 % Covered by the 3-clause BSD License (see LICENSE file for details). 0041 % See https://matpower.org for more info. 0042 0043 properties 0044 mpc = struct(); 0045 end 0046 0047 methods 0048 %% constructor 0049 function om = opf_model(mpc) 0050 args = {}; 0051 have_mpc = 0; 0052 if nargin > 0 0053 if isa(mpc, 'opf_model') 0054 args = { mpc }; 0055 elseif isstruct(mpc) 0056 have_mpc = 1; 0057 end 0058 end 0059 0060 om@opt_model(args{:}); 0061 0062 if have_mpc 0063 om.mpc = mpc; 0064 end 0065 end 0066 end 0067 end