pydynamicestimator.devices.inverter_filter
Inverter output-filter (electrical-plant) strategies.
The filter owns the converter’s network-interface states and writes their
dynamics, driven by the switching voltage Vsw from the inner controller and
the network voltage. It is the inverter analogue of the synchronous machine’s
electromagnetic model – the electrical plant the controllers act on – but,
unlike the SG’s is-a EM hook, it is a pluggable strategy (composition): the
filter combines freely with any angle / voltage / inner / pll choice, so by the
is-a/has-a rule it is a strategy, not an inheritance hook. See
docs/inverter_modernization_design.md (§2, §6).
A filter exposes the terminal-current states (itd_ext / itq_ext, read by
the host’s network injection gcall) and the capacitor-voltage / filter-current
states that the control ladder reads through host.var_sym – which lets a
future quasi-static realization (LCL_static) make them algebraic transparently.
Attributes
Classes
Abstract base class for inverter output-filter models (pluggable strategy). |
|
Dynamic LCL output filter -- the framework default (states realization). |
|
Quasi-static LCL filter: the SAME topology as |
Module Contents
- class pydynamicestimator.devices.inverter_filter.Filter[source]
Bases:
abc.ABCAbstract base class for inverter output-filter models (pluggable strategy).
Symmetric to the synchronous-machine strategies (AVR/governor/…): the filter does NOT own state arrays or DAE indices. It declares what states, private algebraics, parameters and estimation metadata it needs, and the host
Inverterregisters them on itself (filter first, so its states occupy the leading block of the state vector). It reads host parameters/states by attribute (host.Lf,host.var_sym(dae, "Vfd_ext"), …).- abstract states() List[str][source]
Return ordered list of differential-state names.
- Return type:
List[str]
- algebs() List[str][source]
Return ordered list of device-private algebraic variable names.
Default empty (dynamic filter: every quantity is a differential state). A quasi-static realization returns its quantities here instead and writes
0 = RHSresiduals intodae.g.- Return type:
List[str]
- abstract units() List[str][source]
Return units for each state, same length as states().
- Return type:
List[str]
- abstract params() Dict[str, float][source]
Return dict of parameter names -> default values.
- Return type:
Dict[str, float]
- abstract states_noise() Dict[str, float][source]
Return process-noise weight for each state.
- Return type:
Dict[str, float]
- abstract states_init_error() Dict[str, float][source]
Return initial error for each state.
- Return type:
Dict[str, float]
- abstract x0() Dict[str, float][source]
Return default initial guess for each state.
- Return type:
Dict[str, float]
- abstract descriptions() Dict[str, str][source]
Return descriptions for states and params.
- Return type:
Dict[str, str]
- abstract fgcall(host, dae: pydynamicestimator.system.Dae, omega_ref_vec, omega_b) None[source]
Write the filter dynamics into
dae.f(and, for a quasi-static realization, the residuals intodae.g). The driving switching voltage (converter output, network frame) is read host-mediated viahost.switching_voltage(dae).- Parameters:
host – the Inverter instance (read params via host.Lf/…, states via host.var_sym(dae, name), the switching voltage via host.switching_voltage(dae), indices via host.Vfd_ext, host.vre, …).
dae (pydynamicestimator.system.Dae) – the DAE system object.
omega_ref_vec – per-bus reference-frame frequency.
omega_b – base speed (2*pi*fn) per device.
- Return type:
None
- provides() Set[str][source]
Plant capability tags this filter exposes (e.g.
"shunt_capacitor"), checked against the inner controller’s requirements at construction. Empty by default.- Return type:
Set[str]
- abstract finit_sequential(host, dae: pydynamicestimator.system.Dae) Dict[str, numpy.ndarray][source]
Steady-state init of the filter from the power-flow terminal point. Returns a dict with the filter states plus the switching voltage
Vswd/Vswqand terminal currentitd_ext/itq_extconsumed downstream. The base raises – a filter without a sequential init (e.g. an algebraic realization) is only usable with the joint init.- Parameters:
- Return type:
Dict[str, numpy.ndarray]
- class pydynamicestimator.devices.inverter_filter.LCL[source]
Bases:
FilterDynamic LCL output filter – the framework default (states realization).
Capacitor voltage (Vfd_ext/Vfq_ext), converter-side filter current (ifd_ext/ifq_ext) and grid-side / terminal current (itd_ext/itq_ext), all in the network (external) dq frame, with the classic series-Rf-Lf / shunt-Cf / series-Rt-Lt topology. Equivalent to the equations previously hardcoded in
Inverter.fgcall; the trajectory is byte-identical.- units() List[str][source]
Return units for each state, same length as states().
- Return type:
List[str]
- params() Dict[str, float][source]
Return dict of parameter names -> default values.
- Return type:
Dict[str, float]
- states_noise() Dict[str, float][source]
Return process-noise weight for each state.
- Return type:
Dict[str, float]
- states_init_error() Dict[str, float][source]
Return initial error for each state.
- Return type:
Dict[str, float]
- x0() Dict[str, float][source]
Return default initial guess for each state.
- Return type:
Dict[str, float]
- descriptions() Dict[str, str][source]
Return descriptions for states and params.
- Return type:
Dict[str, str]
- fgcall(host, dae: pydynamicestimator.system.Dae, omega_ref_vec, omega_b) None[source]
Write the filter dynamics into
dae.f(and, for a quasi-static realization, the residuals intodae.g). The driving switching voltage (converter output, network frame) is read host-mediated viahost.switching_voltage(dae).- Parameters:
host – the Inverter instance (read params via host.Lf/…, states via host.var_sym(dae, name), the switching voltage via host.switching_voltage(dae), indices via host.Vfd_ext, host.vre, …).
dae (pydynamicestimator.system.Dae) – the DAE system object.
omega_ref_vec – per-bus reference-frame frequency.
omega_b – base speed (2*pi*fn) per device.
- Return type:
None
- provides() Set[str][source]
Plant capability tags this filter exposes (e.g.
"shunt_capacitor"), checked against the inner controller’s requirements at construction. Empty by default.- Return type:
Set[str]
- finit_sequential(host, dae: pydynamicestimator.system.Dae) Dict[str, numpy.ndarray][source]
Steady-state init of the LCL filter (decoupled from the controls): given the power-flow terminal voltage (vre/vim) and current (itd_ext/itq_ext), solve the 6 filter ODEs = 0 for the capacitor voltage, filter current, and the switching voltage Vsw the converter must output.
- Parameters:
- Return type:
Dict[str, numpy.ndarray]
- class pydynamicestimator.devices.inverter_filter.LCL_static[source]
Bases:
LCLQuasi-static LCL filter: the SAME topology as
LCL, but the six filter quantities are device-private algebraic variables instead of differential states – the singular-perturbation / quasi-static reduction that zeroes the fast LCL dynamics (d/dt -> 0). Appropriate when the network itself is quasi-static (line_dyn=False); a dynamic filter on a static network is physically incoherent (the host warns but allows it).Because the filter quantities are algebraic, this realization requires the one-shot joint init (the staged sequential init cannot initialize algebraic states) – the host switches to
_init_method="joint"automatically when a filter declares algebraics.Per docs/inverter_modernization_design.md §6/§7, the
2*pi*f(omega_b) factor common to every term of the dynamic ODE is DROPPED on the0 = RHSalgebraic constraint: it is mathematically redundant and would inflate the finit Jacobian condition number.- units() List[str][source]
Return units for each state, same length as states().
- Return type:
List[str]
- states_noise() Dict[str, float][source]
Return process-noise weight for each state.
- Return type:
Dict[str, float]
- states_init_error() Dict[str, float][source]
Return initial error for each state.
- Return type:
Dict[str, float]
- x0() Dict[str, float][source]
Return default initial guess for each state.
- Return type:
Dict[str, float]
- algebs() List[str][source]
Return ordered list of device-private algebraic variable names.
Default empty (dynamic filter: every quantity is a differential state). A quasi-static realization returns its quantities here instead and writes
0 = RHSresiduals intodae.g.- Return type:
List[str]
- fgcall(host, dae: pydynamicestimator.system.Dae, omega_ref_vec, omega_b) None[source]
Write the filter dynamics into
dae.f(and, for a quasi-static realization, the residuals intodae.g). The driving switching voltage (converter output, network frame) is read host-mediated viahost.switching_voltage(dae).- Parameters:
host – the Inverter instance (read params via host.Lf/…, states via host.var_sym(dae, name), the switching voltage via host.switching_voltage(dae), indices via host.Vfd_ext, host.vre, …).
dae (pydynamicestimator.system.Dae) – the DAE system object.
omega_ref_vec – per-bus reference-frame frequency.
omega_b – base speed (2*pi*fn) per device.
- Return type:
None
- pydynamicestimator.devices.inverter_filter.FILTER_REGISTRY: Dict[str, type]