addgen2mpc

addgen2mpc(mpci, gen, gencost, fuel)

addgen2mpc() - Adds a set of generators to a MATPOWER case struct.

[NEW_MPC, IDX] = ADDGEN2MPC(MPC, GEN, GENCOST, GEN_TYPE)

Inserts a set of generators to a MATPOWER case struct by adding the
info of the new generators (in inputs GEN, GENCOST and GEN_TYPE) to the
bottom of the corresponding tables (fields of MPC). Dimensions must
be consistent.

Inputs:
    MPC : standard MATPOWER case struct, with the following additional
          fields:
            .genfuel : (optional) cell array of strings with fuel type
                       (filled with 'unknown' if missing)
            .i<type> : vector of generator indices for units of the
                       specified fuel type
    GEN: standard MATPOWER generator matrix for units to be added
    GENCOST: standard MATPOWER generator cost matrix for units to be added
    GEN_TYPE: string or cell array of names of fuel or type of new gens

Outputs:
    NEW_MPC : the new MATPOWER case with the additional generators
              appended to GEN, GENCOST, GENFUEL and additional field
                .i<type> : vector of generator indices for units of the
                           specified fuel type
    IDX : generator indices of the newly added generators