loadxgendata

loadxgendata(xgd_table, mpc)

loadxgendata() - Load xGenData table into xGenData struct.

XGD = LOADXGENDATA(XGD_TABLE)
XGD = LOADXGENDATA(XGD_TABLE, GEN)
XGD = LOADXGENDATA(XGD_TABLE, MPC)

Loads data from an xGenData table struct, or from a function or MAT-file
that returns such a struct, and converts it to an xGenData struct.
xGenData contains all of the per-generator data required by MOST
that is not included in MPC, including reserve offer data.

If the first argument is the name of a function the optional second
argument will be passed to it. This can be useful for cases where
the user wishes to use data from GEN or GENCOST to set values in the
xGenData.

Inputs:
    XGD_TABLE : an xGenData table struct or the name of a function
                or MAT-file that returns one, with 2 fields
        .colnames : N dimensional cell array of names corresponding
            to the columns of the 'data' field. Valid column names
            are the same as the output field names. All columns are
            optional and the corresponding defaults are listed
            next to the output field names below.
        .data : (NG x N) matrix of data
        If XGD_TABLE is empty, an xGenData struct will be created
        with default values (requires GEN or MPC).
    GEN : (optional) standard GEN matrix for generators corresponding
          to XGD_TABLE
    MPC : (optional) MATPOWER case struct containing GEN and GENCOST
          matrices for generators corresponding to XGD_TABLE

Output:
    XGD :   an xGenData struct, contains the following fields,
            all of which are (NG x 1) vectors
        .CommitSched                        (default = C*)
            (if MPC or GEN not provided, default = 1)
        .InitialPg                          (default = GEN(:, PG))
            (only optional on input if MPC or GEN are provided)
        .TerminalPg (only included if provided in input)
        .RampWearCostCoeff                  (default = 0)
        .PositiveActiveReservePrice         (default = 0)
        .PositiveActiveReserveQuantity      (default = R*)
        .NegativeActiveReservePrice         (default = 0)
        .NegativeActiveReserveQuantity      (default = R*)
        .PositiveActiveDeltaPrice           (default = 0)
        .NegativeActiveDeltaPrice           (default = 0)
        .PositiveLoadFollowReservePrice     (default = 0)
        .PositiveLoadFollowReserveQuantity  (default = R*)
        .NegativeLoadFollowReservePrice     (default = 0)
        .NegativeLoadFollowReserveQuantity  (default = R*)
        .CommitKey                          (default = not present)
        .InitialState **                    (default = +/-Inf, based on C*)
        .MinUp **                           (default = 1)
        .MinDown **                         (default = 1)
            (potential future additions)
                FuelType (would need to define numeric constants for each)

    * If GEN or MPC are provided then C = GEN(:, GEN_STATUS) and
      R = 2 * (GEN(:, PMAX) - MIN(0, GEN(:, PMIN))), otherwise
      C = 1 and R = Inf.
    ** Requires CommitKey be present and non-empty.