ADD_VARS Adds a set of variables to the model. ----- DEPRECATED - use ADD_VAR instead ----- OM.ADD_VARS(NAME, N, V0, VL, VU, VT) OM.ADD_VARS(NAME, N, V0, VL, VU) OM.ADD_VARS(NAME, N, V0, VL) OM.ADD_VARS(NAME, N, V0) OM.ADD_VARS(NAME, N) OM.ADD_VARS(NAME, DIM_LIST) (deprecated, use INIT_INDEXED_NAME instead) OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL, VU, VT) OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL, VU) OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL) OM.ADD_VARS(NAME, IDX_LIST, N, V0) OM.ADD_VARS(NAME, IDX_LIST, N) Adds a set of variables to the model, where N is the number of variables in the set, V0 is the initial value of those variables, VL and VU are the lower and upper bounds on the variables and VT is the variable type. The accepted values for elements of VT are: 'C' - continuous 'I' - integer 'B' - binary V0, VL and VU are N x 1 column vectors, VT is a scalar or a 1 x N row vector. The defaults for the last four arguments, which are all optional, are for all values to be initialized to zero (V0 = 0), unbounded (VL = -Inf, VU = Inf), and continuous (VT = 'C'). Examples: om.add_vars('V', nb, V0, Vmin, Vmax, 'C'); om.init_indexed_name('x', {2, 3}); for i = 1:2 for j = 1:3 om.add_vars('x', {i, j}, nx(i,j), ...); end end See also OPT_MODEL, PARAMS_VAR.
0001 function varargout = add_vars(om, varargin) 0002 %ADD_VARS Adds a set of variables to the model. 0003 % 0004 % ----- DEPRECATED - use ADD_VAR instead ----- 0005 % 0006 % OM.ADD_VARS(NAME, N, V0, VL, VU, VT) 0007 % OM.ADD_VARS(NAME, N, V0, VL, VU) 0008 % OM.ADD_VARS(NAME, N, V0, VL) 0009 % OM.ADD_VARS(NAME, N, V0) 0010 % OM.ADD_VARS(NAME, N) 0011 % OM.ADD_VARS(NAME, DIM_LIST) (deprecated, use INIT_INDEXED_NAME instead) 0012 % OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL, VU, VT) 0013 % OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL, VU) 0014 % OM.ADD_VARS(NAME, IDX_LIST, N, V0, VL) 0015 % OM.ADD_VARS(NAME, IDX_LIST, N, V0) 0016 % OM.ADD_VARS(NAME, IDX_LIST, N) 0017 % 0018 % Adds a set of variables to the model, where N is the number of 0019 % variables in the set, V0 is the initial value of those variables, 0020 % VL and VU are the lower and upper bounds on the variables and VT 0021 % is the variable type. The accepted values for elements of VT are: 0022 % 'C' - continuous 0023 % 'I' - integer 0024 % 'B' - binary 0025 % V0, VL and VU are N x 1 column vectors, VT is a scalar or a 1 x N row 0026 % vector. The defaults for the last four arguments, which are all optional, 0027 % are for all values to be initialized to zero (V0 = 0), unbounded 0028 % (VL = -Inf, VU = Inf), and continuous (VT = 'C'). 0029 % 0030 % Examples: 0031 % om.add_vars('V', nb, V0, Vmin, Vmax, 'C'); 0032 % 0033 % om.init_indexed_name('x', {2, 3}); 0034 % for i = 1:2 0035 % for j = 1:3 0036 % om.add_vars('x', {i, j}, nx(i,j), ...); 0037 % end 0038 % end 0039 % 0040 % See also OPT_MODEL, PARAMS_VAR. 0041 0042 % MATPOWER 0043 % Copyright (c) 2008-2017, Power Systems Engineering Research Center (PSERC) 0044 % by Ray Zimmerman, PSERC Cornell 0045 % 0046 % This file is part of MATPOWER. 0047 % Covered by the 3-clause BSD License (see LICENSE file for details). 0048 % See https://matpower.org for more info. 0049 0050 [varargout{1:nargout}] = om.add_var(varargin{:});