Network
Like PyPSA, TyPSA provides a Network object.
API Reference
Network
generators
property
Get all Generator, ExtendableGenerator, and CommittableGenerator
instances.
global_constraints
property
Get all GlobalConstraint instances.
lines
property
Get all Line and ExtendableLine instances.
links
property
Get all Link, ExtendableLink, and CommittableLink instances.
shunt_impedances
property
Get all ShuntImpedance instances.
storage_units
property
Get all StorageUnit and ExtendableStorageUnit instances.
stores
property
Get all Store and ExtendableStore instances.
transformers
property
Get all Transformer and ExtendableTransformer instances.
from_pypsa_network
classmethod
Create a typsa.Network from a pypsa.Network.
add_components
Add one or more components to the network.
determine_network_topology
determine_network_topology(investment_period: int | str | None = None, skip_isolated_buses: bool = False) -> TopologyDeterminedNetwork[T]
Build SubNetworks from topology.
lpf
lpf(snapshots: T | None = None, skip_pre: bool = False) -> tuple[LinearPowerFlowDynamicResults, PowerFlowInfo]
Run linearized power flow on the optimized network.
pf
pf(snapshots: T | None = None, skip_pre: bool = False, x_tol: float = 1e-06, use_seed: bool = False, distribute_slack: bool = False, slack_weights: str = 'p_set') -> tuple[NonlinearPowerFlowDynamicResults, PowerFlowInfo]
Run nonlinear power flow on the optimized network.
optimize
optimize(snapshots: T | None = None, multi_investment_periods: bool = False, transmission_losses: int = 0, linearized_unit_commitment: bool = False, extra_functionality: Callable[[Network, Index], None] | None = None, assign_all_duals: bool = False, solver_name: str | None = None, solver_options: dict[str, Any] | None = None, compute_infeasibilities: bool = False, **kwargs: Any) -> tuple[OptimizedNetwork[T], OptimizationInfo]
Optimize the network (model and solve its optimization problem).
Returns:
| Type | Description |
|---|---|
tuple[OptimizedNetwork[T], OptimizationInfo]
|
Optimized network and optimization info. |
optimize_with_rolling_horizon
optimize_with_rolling_horizon(horizon: int, overlap: int = 0, snapshots: T | None = None, multi_investment_periods: bool = False, transmission_losses: int = 0, linearized_unit_commitment: bool = False, extra_functionality: Callable[[Network, Index], None] | None = None, assign_all_duals: bool = False, solver_name: str | None = None, solver_options: dict[str, Any] | None = None, compute_infeasibilities: bool = False, **kwargs: Any) -> OptimizedNetwork[T]
Optimize the network in a rolling horizon fashion.
Optimization info are per-horizon and thus not returned. However, solver status and objective value are logged per-horizon.
Returns:
| Type | Description |
|---|---|
OptimizedNetwork[T]
|
Optimized network. |
OptimizedNetwork
static_results
property
Access static optimization results.
dynamic_results
property
Access dynamic optimization results.
generators
property
Get all Generator, ExtendableGenerator, and CommittableGenerator
instances.
global_constraints
property
Get all GlobalConstraint instances.
lines
property
Get all Line and ExtendableLine instances.
links
property
Get all Link, ExtendableLink, and CommittableLink instances.
shunt_impedances
property
Get all ShuntImpedance instances.
storage_units
property
Get all StorageUnit and ExtendableStorageUnit instances.
stores
property
Get all Store and ExtendableStore instances.
transformers
property
Get all Transformer and ExtendableTransformer instances.