Constants and enums¶
Shared domain constants and string enums live in pyflow_acdc.constants.
They centralise magic values used across OPF, TEP, and array sizing.
Array sizing enums¶
- class CssMode(value)[source]¶
Cable-string-sizing solve mode in Array_OPT (NL argument).
NL=Falseselects the linear model;NL=Trueis normalized toOPF. Only the non-linear string values are enumerated here.Cable-string-sizing mode for
sequential_CSS()andwind_farm_CSS()(NLargument).Falseselects the linear model;CssMode.PFruns linear CSS then a post-solvepower_flow()for losses;CssMode.OPFuses the nonlinear OPF path.
- class MIPBackend(value)[source]¶
Solver backend for the array-MIP path problem in Array_OPT.
Backend for the inter-array route MIP in
MIP_path_graph().
OPF objective components¶
- class ObjComponent(value)[source]¶
OPF objective components (keys of the ObjRule / weights_def dict).
Values are the public string keys users pass via
ObjRule(e.g.Optimal_PF(grid, ObjRule={'Energy_cost': 1})). Being astrEnum, members compare and hash equal to their string value, so they can be used interchangeably as dict keys/lookups while giving fail-fast typo protection on comparisons.Keys for
optimal_pf()/ TEPObjRuleweight dicts.
Economics and solver defaults¶
- pyflow_acdc.constants.HOURS_PER_YEAR¶
Hours per year (8760). Used in NPV and present-value calculations.
- pyflow_acdc.constants.DEFAULT_TIME_LIMIT¶
Default solver time limit in seconds (300).
- present_value_factor(Hy=8760, discount_rate=0.02, n_years=25)[source]¶
Annuity factor scaled by hours-per-year.
Returns Hy * (1 - (1 + r)^{-n}) / r which converts a per-hour operational cost into its net-present-value over n_years at a constant annual discount_rate.
- default_obj_weights()[source]¶
Return a fresh OPF objective-weights dict with every component at
w=0.Single source of truth for the
weights_def/Grid.OPF_objlayout (used byobj_w_rule,Grid.__init__andTS_ACDC_OPF). A new dict with fresh inner dicts is built on every call so each caller can mutate its own copy. Key order followsObjComponentdeclaration order; keys are plain strings (.value) so existing serialization/display is unchanged.