Skip to content

Scenarios

Scenarios enable what-if analysis and sensitivity studies by allowing you to create alternative versions of your network without duplicating the entire model. Using a sparse override architecture, scenarios only store attribute values that differ from the base network, making them highly efficient.

Overview

Every Convexity model has a base network that defines the default network configuration. Scenarios let you create variations by overriding specific attribute values while inheriting everything else from the base network.

Key benefits:

  • Memory efficient: Only differences are stored, not entire networks
  • Easy comparison: All scenarios share the same network topology
  • Flexible analysis: Test multiple what-if cases without model duplication
  • Stochastic optimization: Assign probabilities to scenarios for uncertainty modeling

Sparse Override Architecture

The sparse override system works as follows:

  1. Base network: All attributes with scenario_id = NULL represent the default network
  2. Scenario overrides: Attributes with a specific scenario_id override the base value for that scenario only
  3. Inheritance: If a scenario doesn't override an attribute, it uses the base network value
  4. Efficiency: A scenario with 10 overrides on a 1000-component network only stores 10 values. This makes the setup highly efficient (do not hestitate to add many scenarios)

Example:

Base network: Generator "Coal Plant" has marginal_cost = 50 EUR/MWh
Scenario "High Fuel Costs": Override marginal_cost = 80 EUR/MWh
Scenario "Low Demand": No override → uses base value 50 EUR/MWh

Scenarios Table Properties

PropertyData TypeDefaultRequiredDescription
idINTEGER(auto)-Primary key (auto-increment)
nameTEXT-YesScenario name (unique)
descriptionTEXT-NoScenario description
probabilityREALNULLNoProbability for stochastic optimization (0-1, NULL for deterministic what-if scenarios)
is_system_scenarioBOOLEANFALSENoTrue for system-reserved scenarios (cannot be deleted)
system_purposeTEXTNULLNoPurpose of system scenario (e.g., "actual" for measured values)
created_atDATETIME(auto)NoTimestamp when scenario was created

Scenario Types

1. Deterministic What-If Scenarios

Standard scenarios for sensitivity analysis and alternative cases.

Characteristics:

  • probability = NULL
  • Used for comparing discrete alternatives
  • Each scenario solved independently

Examples:

  • "High Fuel Costs" - Test impact of 50% higher gas prices
  • "Delayed Transmission" - Model postponed infrastructure investments
  • "Accelerated Renewables" - Explore faster clean energy deployment

2. Stochastic Scenarios

Scenarios with probabilities for uncertainty modeling.

Characteristics:

  • probability set between 0 and 1
  • Probabilities across scenarios should sum to 1
  • Solved together in stochastic optimization

Examples:

  • "Low Demand" (probability = 0.3) - Mild winter scenario
  • "Medium Demand" (probability = 0.5) - Normal winter
  • "High Demand" (probability = 0.2) - Severe winter

3. System Scenarios

Special reserved scenarios that cannot be deleted.

"Actual" Scenario:

  • Automatically created for every network
  • Purpose: Store measured/actual values for validation
  • is_system_scenario = TRUE, system_purpose = 'actual'
  • Not included in optimization solves
  • Used for comparing model results against real-world data

Database Storage

Scenarios are stored efficiently in the database:

scenarios table:
  id=1, name="Base Network", (implicit, no row)
  id=2, name="High Fuel Costs", probability=NULL
  id=3, name="Low Demand", probability=0.3

component_attributes table:
  component_id=5, attribute="marginal_cost", scenario_id=NULL, value=50  (base)
  component_id=5, attribute="marginal_cost", scenario_id=2, value=80     (override)
  component_id=7, attribute="p_set", scenario_id=3, value=[...]           (override)

Learn More

© Copyright 2025 Bayesian Energy