Skip to main content

Optimization

This page covers the end-to-end optimization flow and the engines behind it.

Process at a Glance

  1. Config enrichment
    • production_modeling.modelSetup(c) loads tariffs/prices/ESG/inverters/CT limits, resolves coordinates, sets SELCO export.
  2. Typical consumption
    • optimiser.main(c) uses utilities.technical.solve_pre_surcharge_bill and utilities.profile_estimation.estimate_load_profile to generate a 24h profile.
  3. Production and bills
    • production_modeling.power_and_energy(c, daily_consumption) computes hourly/net power, optional BESS sizing and SOC, and monthly aggregates (grid draw, export credits, bills).
  4. Financing optimization
    • optimiser.optimise(c, typical_consumption) dynamically dispatches to optimizers/{Tokenization|TermLoan}/{PPA|DirectPurchase} to determine system size and financials.
  5. Enrichment
    • Adds panel count, tariff escalation, and ESG metrics (CO2 reduction, trees/year).

Decision Variables (typical)

  • System size (kWp)
  • Optional battery capacity (kWh), if enabled
  • Inverter configuration (derived by size_inverters)

Constraints (examples)

  • Roof space / CT rating (via CT limits in config)
  • Budget bounds (per prices)
  • Scheme-specific constraints (e.g., SELCO export = 0)

Objective Balancing

  • Customer savings (bill without solar vs with solar + export)
  • Investor returns (NPV/IRR per financing model)
  • Cost (CapEx + installation, optional BESS costs)

Implementation of individual objective/constraint terms may vary by financing module. Engines typically rely on SciPy optimizers where continuous optimization is applicable and discrete selections are handled heuristically (e.g., inverters).

Optimizer Modules

  • Tokenization: {PPA, DirectPurchase}
  • TermLoan: {PPA, DirectPurchase}

Each module implements a callable (c, typical_consumption) -> (results, updated_c) and returns:

  • results: at minimum system_size, monthly_energy_production, customer_savings, customer_roi, optional battery_size, and any model-specific outputs
  • updated_c: configuration with any calculated fields persisted

Key Supporting Functions

  • Consumption estimation: utilities.profile_estimation.estimate_load_profile
  • Billing: utilities.technical.calculate_bill, solve_pre_surcharge_bill
  • Inverters: utilities.technical.size_inverters
  • Production aggregation: production_modeling.historical_*, power_and_energy
  • Finance: utilities.finance.*
  • ESG: derived in optimiser.optimise