makeAy

makeAy(baseMVA, ng, gencost, pgbas, qgbas, ybas)

makeAy() - Make the A matrix and RHS for the CCV formulation.

[AY, BY]  = MAKEAY(BASEMVA, NG, GENCOST, PGBAS, QGBAS, YBAS)

Constructs the parameters for linear "basin constraints" on Pg, Qg
and Y used by the CCV cost formulation, expressed as

    AY * X <= BY

where X is the vector of optimization variables. The starting index
within the X vector for the active, reactive sources and the Y
variables should be provided in arguments PGBAS, QGBAS, YBAS. The
number of generators is NG.

Assumptions: All generators are in-service.  Filter any generators
that are offline from the GENCOST matrix before calling MAKEAY.
Efficiency depends on Qg variables being after Pg variables, and
the Y variables must be the last variables within the vector X for
the dimensions of the resulting AY to be conformable with X.

Example:
    [Ay, by]  = makeAy(baseMVA, ng, gencost, pgbas, qgbas, ybas);