Examples

These examples build systems with Posy2's make... methods. Nosy still provides the simulation, snapshot, carriers, and nodes, but the pages do not assemble Nosy Component objects by hand.

Each page is a small working study built around one feature: an interconnection pattern, a storage technology, a hydrogen pathway. The remaining assets are kept simple.

ExampleContent
One CountryBuilding and solving a complete single-node study
Dispatchable GenerationChoosing PV and gas capacities, then meeting the residual demand
Dispatch OptimizationComparing merit-order dispatch with ramp-limited operation of a fixed CCGT fleet
CO2 PricingHow a carbon price reorders emitting and non-emitting technologies
NuclearHow refuelling schedule flexibility reduces backup capacity
Battery StorageShifting daytime PV generation to later hours
Pumped StorageUsing grid electricity to store energy and generate later
Hydro ReservoirTiming generation by storing variable natural intake
Demand ResponseDemand-side flexibility that shaves a demand peak
Electric VehiclesComparing smart charging with vehicle-to-grid operation
Hydrogen ProductionProducing hydrogen from PV and shifting supply with storage
Two CountriesComparing trade and local generation with and without a transmission limit
Price InterconnectionChoosing between domestic generation and priced imports
DC OPFHow KVL changes flows across meshed AC lines, and how controllable HVDC differs
Stochastic ProgrammingSharing investment capacities across two snapshots while operation adapts to each future
Coarse Time MeshTrading resolution for model size by solving a two-country system on two-hour steps
InfeasibilityUsing conflicts to locate incompatible constraints in an infeasible model

Data sources

The examples cover all four combinations of tech_mode and timeseries_mode. In :excel mode, missing values are read from the technology or time-series workbook, and any keyword you pass on a make... builder overrides that workbook value. In :arguments mode there is no workbook fallback: builders use documented neutral defaults where available and require the remaining active values explicitly. The table shows which combination each example uses.

Exampletech_modetimeseries_mode
One Country:excel:excel
Dispatchable Generation:arguments:excel
Dispatch Optimization:arguments:arguments
CO2 Pricing:arguments:excel
Nuclear:excel:excel
Battery Storage:arguments:excel
Pumped Storage:arguments:excel
Hydro Reservoir:excel:excel
Demand Response:arguments:arguments
Electric Vehicles:arguments:excel
Hydrogen Production:excel:excel
Two Countries:arguments:excel
Price Interconnection:arguments:excel
DC OPF:excel:arguments
Stochastic Programming:arguments:arguments
Coarse Time Mesh:arguments:excel
Infeasibility:arguments:arguments

Exporting Example Results

Every solved example returns a numeric result from extract(snapshot). write_results turns that result into Posy2's standard workbook report:

write_results(result, "results/scenario.xlsx")

The file is written at the given path and contains annual values for the complete system and the modelled system boundary, detailed time series, and price-duration curves. An existing file is kept and an error raised unless overwrite=true is passed. Call write_results with the extracted result, not the unsolved symbolic snapshot.

Posy2 follows Nosy's unit-agnostic convention: values only need to be self-consistent. Here, power and capacity are MW, energy is MWh, overnight investment is currency/kW, fixed operation and maintenance is currency/kW/year, and variable costs are currency/MWh. The numerical assumptions are deliberately simple teaching values, not reference projections.