From 2ce5dcda5bff5063a8039b6150e16460ba49ac66 Mon Sep 17 00:00:00 2001 From: ParticularlyPythonicBS Date: Thu, 18 Dec 2025 15:58:44 -0500 Subject: [PATCH] deduplicating testing databases by separating central schema from modifications --- temoa/tutorial_assets/utopia.sql | 2 +- tests/conftest.py | 124 +- .../config_annualised_demand.toml | 68 +- tests/testing_configs/config_emissions.toml | 60 +- tests/testing_configs/config_link_test.toml | 112 +- tests/testing_configs/config_materials.toml | 60 +- tests/testing_configs/config_mediumville.toml | 94 +- .../config_seasonal_storage.toml | 68 +- .../testing_configs/config_storageville.toml | 94 +- .../config_survival_curve.toml | 68 +- tests/testing_configs/config_test_system.toml | 60 +- tests/testing_configs/config_utopia.toml | 68 +- tests/testing_configs/config_utopia_gv.toml | 72 +- .../testing_configs/config_utopia_myopic.toml | 64 +- tests/testing_data/annualised_demand.sql | 1136 +-------- tests/testing_data/emissions.sql | 1234 +--------- tests/testing_data/materials.sql | 2034 ++++------------ tests/testing_data/mediumville.sql | 1422 ++--------- tests/testing_data/seasonal_storage.sql | 1249 +--------- tests/testing_data/simple_linked_tech.sql | 1152 +-------- tests/testing_data/storageville.sql | 1206 +--------- tests/testing_data/survival_curve.sql | 1396 ++--------- tests/testing_data/test_system.sql | 2140 +++++------------ tests/testing_data/utopia_data.sql | 559 +++++ 24 files changed, 2557 insertions(+), 11985 deletions(-) create mode 100644 tests/testing_data/utopia_data.sql diff --git a/temoa/tutorial_assets/utopia.sql b/temoa/tutorial_assets/utopia.sql index 41fe6dba..24138883 100644 --- a/temoa/tutorial_assets/utopia.sql +++ b/temoa/tutorial_assets/utopia.sql @@ -458,7 +458,7 @@ CREATE TABLE demand ); INSERT INTO "demand" VALUES('utopia',1990,'RH',25.2,'PJ',''); INSERT INTO "demand" VALUES('utopia',2000,'RH',37.8,'PJ',''); -INSERT INTO "demand" VALUES('utopia',2010,'RH',5.669999999999999574e+01,'PJ',''); +INSERT INTO "demand" VALUES('utopia',2010,'RH',56.7,'PJ',''); INSERT INTO "demand" VALUES('utopia',1990,'RL',5.6,'PJ',''); INSERT INTO "demand" VALUES('utopia',2000,'RL',8.4,'PJ',''); INSERT INTO "demand" VALUES('utopia',2010,'RL',12.6,'PJ',''); diff --git a/tests/conftest.py b/tests/conftest.py index 34f4de3e..8b46ad77 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,4 @@ import logging -import os import sqlite3 from pathlib import Path from typing import Any @@ -34,83 +33,77 @@ logging.getLogger('pyutilib').setLevel(logging.WARNING) +# Central paths +TEST_DATA_PATH = Path(__file__).parent / 'testing_data' +TEST_OUTPUT_PATH = Path(__file__).parent / 'testing_outputs' +SCHEMA_PATH = Path(__file__).parent.parent / 'temoa' / 'db_schema' / 'temoa_schema_v4.sql' + + +def _build_test_db( + db_file: Path, + data_scripts: list[Path], + modifications: list[tuple[str, tuple[Any, ...]]] | None = None, +) -> None: + """Helper to build a test database from central schema + data scripts + mods.""" + if db_file.exists(): + db_file.unlink() + + with sqlite3.connect(db_file) as con: + con.execute('PRAGMA foreign_keys = OFF') + # 1. Load central schema + con.executescript(SCHEMA_PATH.read_text(encoding='utf-8')) + # Force FK OFF again as schema file might turn it on at the end + con.execute('PRAGMA foreign_keys = OFF') + + # 2. Load data scripts + for script_path in data_scripts: + with open(script_path) as f: + con.executescript(f.read()) + + # 3. Apply modifications + if modifications: + for sql, params in modifications: + con.execute(sql, params) + + # 4. Turn foreign keys back on + con.execute('PRAGMA foreign_keys = ON') + con.commit() + + def refresh_databases() -> None: """ make new databases from source for testing... removes possibility of contamination by earlier runs """ - data_output_path = Path(__file__).parent / 'testing_outputs' - data_source_path = Path(__file__).parent / 'testing_data' - # utopia.sql is in tutorial_assets (single source of truth for unit-compliant data) - tutorial_assets_path = Path(__file__).parent.parent / 'temoa' / 'tutorial_assets' - # Map source files to their locations - # (source_dir, source_file, output_file) databases = [ - # Utopia uses the tutorial_assets source (unit-compliant) - (tutorial_assets_path, 'utopia.sql', 'utopia.sqlite'), - (tutorial_assets_path, 'utopia.sql', 'myo_utopia.sqlite'), - # Other test databases use testing_data - (data_source_path, 'test_system.sql', 'test_system.sqlite'), - (data_source_path, 'storageville.sql', 'storageville.sqlite'), - (data_source_path, 'mediumville.sql', 'mediumville.sqlite'), - (data_source_path, 'emissions.sql', 'emissions.sqlite'), - (data_source_path, 'materials.sql', 'materials.sqlite'), - (data_source_path, 'simple_linked_tech.sql', 'simple_linked_tech.sqlite'), - (data_source_path, 'seasonal_storage.sql', 'seasonal_storage.sqlite'), - (data_source_path, 'survival_curve.sql', 'survival_curve.sqlite'), - (data_source_path, 'annualised_demand.sql', 'annualised_demand.sqlite'), + # Utopia uses the unit-compliant data-only script + ('utopia_data.sql', 'utopia.sqlite'), + ('utopia_data.sql', 'myo_utopia.sqlite'), + # Other test databases + ('test_system.sql', 'test_system.sqlite'), + ('mediumville.sql', 'mediumville.sqlite'), + ('seasonal_storage.sql', 'seasonal_storage.sqlite'), + ('survival_curve.sql', 'survival_curve.sqlite'), + ('annualised_demand.sql', 'annualised_demand.sqlite'), + # Feature tests (separate for temporal consistency) + ('emissions.sql', 'emissions.sqlite'), + ('materials.sql', 'materials.sqlite'), + ('simple_linked_tech.sql', 'simple_linked_tech.sqlite'), + ('storageville.sql', 'storageville.sqlite'), ] - for source_dir, src, db in databases: - if Path.exists(data_output_path / db): - os.remove(data_output_path / db) - # make a new one and fill it - con = sqlite3.connect(data_output_path / db) - with open(source_dir / src) as script: - con.executescript(script.read()) - con.close() - - -def create_unit_test_db_from_sql( - source_sql_path: Path, output_db_path: Path, modifications: list[tuple[str, tuple[Any, ...]]] -) -> None: - """Create a unit test database from SQL source with specific modifications. - - Args: - source_sql_path: Path to the source SQL file - output_db_path: Path where the database should be created - modifications: List of (sql, params) tuples to apply after creation - """ - if output_db_path.exists(): - output_db_path.unlink() - - # Generate database from SQL source and apply modifications - with sqlite3.connect(output_db_path) as conn: - # Execute the SQL source to create the database - conn.executescript(source_sql_path.read_text(encoding='utf-8')) - # Apply modifications - for sql, params in modifications: - conn.execute(sql, params) - conn.commit() + for src, db in databases: + _build_test_db(TEST_OUTPUT_PATH / db, [TEST_DATA_PATH / src]) def create_unit_test_dbs() -> None: """Create unit test databases from SQL source for unit checking tests. - Generates databases from the single SQL source of truth (tutorial_assets/utopia.sql), + Generates databases from the single SQL source of truth (utopia_data.sql), applying modifications for each test case. """ - test_output_dir = Path(__file__).parent / 'testing_outputs' - test_output_dir.mkdir(exist_ok=True) - - # Source SQL file path (single source of truth) - source_sql = Path(__file__).parent.parent / 'temoa' / 'tutorial_assets' / 'utopia.sql' - - if not source_sql.exists(): - raise FileNotFoundError( - f'Source SQL not found at: {source_sql}. Please ensure the Utopia tutorial SQL exists.' - ) + TEST_OUTPUT_PATH.mkdir(exist_ok=True) # Define unit test variations with their modifications unit_test_variations = [ @@ -169,8 +162,11 @@ def create_unit_test_dbs() -> None: ] for db_name, modifications in unit_test_variations: - output_path = test_output_dir / db_name - create_unit_test_db_from_sql(source_sql, output_path, modifications) + _build_test_db( + TEST_OUTPUT_PATH / db_name, + [TEST_DATA_PATH / 'utopia_data.sql'], + modifications, + ) logger.info('Created unit test DB: %s', db_name) diff --git a/tests/testing_configs/config_annualised_demand.toml b/tests/testing_configs/config_annualised_demand.toml index 9506d7b1..3e6393fe 100644 --- a/tests/testing_configs/config_annualised_demand.toml +++ b/tests/testing_configs/config_annualised_demand.toml @@ -1,73 +1,21 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/annualised_demand.sqlite" output_database = "tests/testing_outputs/annualised_demand.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "representative_periods" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'representative_periods' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] -cost_epsilon = 0.03 # 3% relaxation on optimal cost -iteration_limit = 15 # max iterations to perform -time_limit_hrs = 1 # max time -axis = "tech_category_activity" # use the tech activity Manager to control exploration based on categories in Tech -weighting = "hull_expansion" # use a convex hull expansion algorithm to weight exploration +cost_epsilon = 0.03 +iteration_limit = 15 +time_limit_hrs = 1 +axis = "tech_category_activity" +weighting = "hull_expansion" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_emissions.toml b/tests/testing_configs/config_emissions.toml index c131806c..f06f424d 100644 --- a/tests/testing_configs/config_emissions.toml +++ b/tests/testing_configs/config_emissions.toml @@ -1,71 +1,19 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/emissions.sqlite" output_database = "tests/testing_outputs/emissions.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_link_test.toml b/tests/testing_configs/config_link_test.toml index 0a378317..ff8bab41 100644 --- a/tests/testing_configs/config_link_test.toml +++ b/tests/testing_configs/config_link_test.toml @@ -1,125 +1,23 @@ -# ---------------------------------------------------------- -# Configuration file for a Temoa Run -# Allows specification of run type and associated parameters -# ---------------------------------------------------------- -# -# For toml format info see: https://toml.io/en/ -# - comments may be added with hash -# - do NOT comment out table names in brackets like: [] - -# Scenario Name (Mandatory) -# This scenario name is used to label results within the output .sqlite file scenario = "test_linked_tech" - -# Scenaio Mode (Mandatory) -# See documentation for explanations. A standard single run is "perfect_foresight" -# mode must be one of (case-insensitive): -# [perfect_foresight, MGA, myopic, method_of_morris, build_only, check] scenario_mode = "perfect_foresight" - -# Input database (Mandatory) input_database = "tests/testing_outputs/simple_linked_tech.sqlite" - -# Output file (Mandatory) -# The output file must be an existing .sqlite file -# For Pefrect Foresight, the user may target the same input file or a separate / -# copied sqlite file in a different location. Myopic requires that input_database = output_database output_database = "tests/testing_outputs/simple_linked_tech.sqlite" - -# ------------------------------------ -# DATA / MODEL CHECKS -# To check data / cost integrity -# ------------------------------------ - -# Check the pricing structure for common errors, which are reported in the log file -# Strongly recommended price_check = false - -# Check the network connectivity for processes in the model. Strongly -# recommended to ensure proper performance. Results are reported in log file -# This requires that source commodities be marked with 's' in commodity table -# This is required for Myopic runs source_trace = true - -# Produce HTML files for Commodity Networks. Requires source_trace above plot_commodity_network = false - -# ------------------------------------ -# SOLVER -# Solver Selection -# ------------------------------------ - -# use the NEOS server to solve. (Currently NOT supported) neos = false - -# solver (Mandatory) -# Depending on what client machine has installed. -# [cbc, appsi_highs, gurobi, cplex, ...] solver_name = "appsi_highs" - -# ------------------------------------ -# OUTPUTS -# select desired output products/files -# ------------------------------------ - -# generate an Excel file in the output_files folder save_excel = false - -# save the duals in the output Database (may slow execution slightly?) save_duals = false - -# save a copy of the pyomo-generated lp file(s) to the outputs folder (maybe a large file(s)!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -view_depth = 2 # number of periods seen/analyzed per iteration -step_size = 1 # number of periods to step by (must be <= view depth) +view_depth = 2 +step_size = 1 diff --git a/tests/testing_configs/config_materials.toml b/tests/testing_configs/config_materials.toml index b70404fe..81bb00f0 100644 --- a/tests/testing_configs/config_materials.toml +++ b/tests/testing_configs/config_materials.toml @@ -1,71 +1,19 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/materials.sqlite" output_database = "tests/testing_outputs/materials.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_mediumville.toml b/tests/testing_configs/config_mediumville.toml index 0376832e..53f1b935 100644 --- a/tests/testing_configs/config_mediumville.toml +++ b/tests/testing_configs/config_mediumville.toml @@ -1,105 +1,19 @@ -# ---------------------------------------------------------- -# Configuration file for a Temoa Run -# Allows specification of run type and associated parameters -# -# For toml format info see: https://toml.io/en/ -# - comments may be added with hash -# - do NOT comment out table names in brackets like: [
] - -# Scenario Name (Mandatory) -# This scenario name is used to label results within the output .sqlite file scenario = "testing" - -# Scenaio Mode (Mandatory) -# See documentation for explanations. A standard single run is "perfect foresight" -# mode must be one of (case-insensitive): -# [perfect_foresight, MGA, myopic, method_of_morris, build_only] scenario_mode = "perfect_foresight" - -# Input file (Mandatory) -# Input can be a .sqlite or .dat file -# Both relative path and absolute path are accepted input_database = "tests/testing_outputs/mediumville.sqlite" - -# Output file (Mandatory) -# The output file must be an existing .sqlite file -# the user may target the same input file or a separate / -# copied sqlite file in a different location output_database = "tests/testing_outputs/mediumville.sqlite" - -# ------------------------------------ -# SOLVER -# Solver Selection -# ------------------------------------ - -# use the NEOS server to solve neos = false - -# solver solver_name = "appsi_highs" - -# ------------------------------------ -# OUTPUTS -# select desired output products/files -# ------------------------------------ - -# generate an Excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_seasonal_storage.toml b/tests/testing_configs/config_seasonal_storage.toml index fa7fac06..760a7b88 100644 --- a/tests/testing_configs/config_seasonal_storage.toml +++ b/tests/testing_configs/config_seasonal_storage.toml @@ -1,73 +1,21 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/seasonal_storage.sqlite" output_database = "tests/testing_outputs/seasonal_storage.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "representative_periods" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'representative_periods' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] -cost_epsilon = 0.03 # 3% relaxation on optimal cost -iteration_limit = 15 # max iterations to perform -time_limit_hrs = 1 # max time -axis = "tech_category_activity" # use the tech activity Manager to control exploration based on categories in Tech -weighting = "hull_expansion" # use a convex hull expansion algorithm to weight exploration +cost_epsilon = 0.03 +iteration_limit = 15 +time_limit_hrs = 1 +axis = "tech_category_activity" +weighting = "hull_expansion" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_storageville.toml b/tests/testing_configs/config_storageville.toml index fe96195f..df73dad1 100644 --- a/tests/testing_configs/config_storageville.toml +++ b/tests/testing_configs/config_storageville.toml @@ -1,105 +1,19 @@ -# ---------------------------------------------------------- -# Configuration file for a Temoa Run -# Allows specification of run type and associated parameters -# -# For toml format info see: https://toml.io/en/ -# - comments may be added with hash -# - do NOT comment out table names in brackets like: [
] - -# Scenario Name (Mandatory) -# This scenario name is used to label results within the output .sqlite file scenario = "storage testing" - -# Scenaio Mode (Mandatory) -# See documentation for explanations. A standard single run is "perfect foresight" -# mode must be one of (case-insensitive): -# [perfect_foresight, MGA, myopic, method_of_morris, build_only] scenario_mode = "perfect_foresight" - -# Input file (Mandatory) -# Input can be a .sqlite or .dat file -# Both relative path and absolute path are accepted input_database = "tests/testing_outputs/storageville.sqlite" - -# Output file (Mandatory) -# The output file must be an existing .sqlite file -# the user may target the same input file or a separate / -# copied sqlite file in a different location output_database = "tests/testing_outputs/storageville.sqlite" - -# ------------------------------------ -# SOLVER -# Solver Selection -# ------------------------------------ - -# use the NEOS server to solve neos = false - -# solver solver_name = "appsi_highs" - -# ------------------------------------ -# OUTPUTS -# select desired output products/files -# ------------------------------------ - -# generate an Excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_survival_curve.toml b/tests/testing_configs/config_survival_curve.toml index c59abb9c..2c1d051e 100644 --- a/tests/testing_configs/config_survival_curve.toml +++ b/tests/testing_configs/config_survival_curve.toml @@ -1,73 +1,21 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/survival_curve.sqlite" output_database = "tests/testing_outputs/survival_curve.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] -cost_epsilon = 0.03 # 3% relaxation on optimal cost -iteration_limit = 15 # max iterations to perform -time_limit_hrs = 1 # max time -axis = "tech_category_activity" # use the tech activity Manager to control exploration based on categories in Tech -weighting = "hull_expansion" # use a convex hull expansion algorithm to weight exploration +cost_epsilon = 0.03 +iteration_limit = 15 +time_limit_hrs = 1 +axis = "tech_category_activity" +weighting = "hull_expansion" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_test_system.toml b/tests/testing_configs/config_test_system.toml index d65c627f..b776c317 100644 --- a/tests/testing_configs/config_test_system.toml +++ b/tests/testing_configs/config_test_system.toml @@ -1,71 +1,19 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/test_system.sqlite" output_database = "tests/testing_outputs/test_system.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_utopia.toml b/tests/testing_configs/config_utopia.toml index 90ba7490..e13262f2 100644 --- a/tests/testing_configs/config_utopia.toml +++ b/tests/testing_configs/config_utopia.toml @@ -1,73 +1,21 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/utopia.sqlite" output_database = "tests/testing_outputs/utopia.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] -cost_epsilon = 0.03 # 3% relaxation on optimal cost -iteration_limit = 15 # max iterations to perform -time_limit_hrs = 1 # max time -axis = "tech_category_activity" # use the tech activity Manager to control exploration based on categories in Tech -weighting = "hull_expansion" # use a convex hull expansion algorithm to weight exploration +cost_epsilon = 0.03 +iteration_limit = 15 +time_limit_hrs = 1 +axis = "tech_category_activity" +weighting = "hull_expansion" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_utopia_gv.toml b/tests/testing_configs/config_utopia_gv.toml index 54e04867..4112427d 100644 --- a/tests/testing_configs/config_utopia_gv.toml +++ b/tests/testing_configs/config_utopia_gv.toml @@ -1,78 +1,22 @@ -# this config is used for testing in test_full_runs.py scenario = "test run" scenario_mode = "perfect_foresight" - input_database = "tests/testing_outputs/utopia.sqlite" output_database = "tests/testing_outputs/utopia.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = false - -# save the duals in the output .sqlite database save_duals = false - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false - -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# OUTPUT OPTIONS -# --------------------------------------------------- +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" graphviz_output = true -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] -cost_epsilon = 0.03 # 3% relaxation on optimal cost -iteration_limit = 15 # max iterations to perform -time_limit_hrs = 1 # max time -axis = "tech_category_activity" # use the tech activity Manager to control exploration based on categories in Tech -weighting = "hull_expansion" # use a convex hull expansion algorithm to weight exploration +cost_epsilon = 0.03 +iteration_limit = 15 +time_limit_hrs = 1 +axis = "tech_category_activity" +weighting = "hull_expansion" [myopic] -myopic_view = 2 # number of periods seen at one iteration +myopic_view = 2 diff --git a/tests/testing_configs/config_utopia_myopic.toml b/tests/testing_configs/config_utopia_myopic.toml index e5f0f1fe..bbfff786 100644 --- a/tests/testing_configs/config_utopia_myopic.toml +++ b/tests/testing_configs/config_utopia_myopic.toml @@ -1,74 +1,20 @@ -# this config is used for testing in test_full_runs.py scenario = "test myopic" scenario_mode = "myopic" - -# note that myopic currently only supports input = output. Test code will be responsible -# for making a fresh copy (if desired) and moving it to the output folder input_database = "tests/testing_outputs/myo_utopia.sqlite" output_database = "tests/testing_outputs/myo_utopia.sqlite" neos = false - -# solver solver_name = "appsi_highs" - -# generate an excel file in the output_files folder save_excel = true - -# save the duals in the output .sqlite database save_duals = true - -# save a copy of the pyomo-generated lp file to the outputs folder (may be large file!) save_lp_file = false +time_sequencing = "seasonal_timeslices" +reserve_margin = "static" -# ------------------------------------ -# MODEL PARAMETERS -# these are specific to each model -# ------------------------------------ - -# What seasons represent in the model -# Options: -# 'consecutive_days' -# Seasons are a set of days in order, with each season representing only one day. Examples -# might be a model of a representative week with 7 days or a whole-year model with 365 days. -# Seasonal storage need not be tagged and the time_season_sequential table can be left empty. -# 'representative_periods' -# Each season represents a number of days, though not necessarily in any particular order. -# If using inter-season constraints like seasonal storage or ramp rates, the true sequence -# must be defined using the time_season_sequential table. Seasonal storage must also be tagged in -# the technology table. -# 'seasonal_timeslices' -# Each season represents a sequential slice of the year, with one or many days represented per -# season. We assume that the true sequence is the same as the TimeSeason sequence, so the -# time_season_sequential table can be left empty. Seasonal storage must still be tagged. -# 'manual' -# The sequence of time slices is defined manually in the TimeNext table (which is commented out -# in the schema). This is an advanced feature and not recommended for most users. Seasonal -# storage must be tagged and the time_season_sequential table filled. -time_sequencing = 'seasonal_timeslices' - -# How contributions to the planning reserve margin are calculated -# Options: -# 'static' -# Traditional planning reserve formulation. Contributions are independent of hourly availability: -# capacity value = net capacity * capacity credit -# 'dynamic' -# Contributions are available output including a capacity derate factor (e.g., forced outage rate). -# For most generators, contributions are available (derated) output in each time slice: -# capacity value = net capacity * reserve capacity derate * capacity factor -# For storage, contributions are (derated) actual output in each time slice: -# capacity value = flow out * reserve capacity derate -reserve_margin = 'static' - -# --------------------------------------------------- -# MODE OPTIONS -# options below are mode-specific and will be ignored -# if the run is not executed in that mode. -# --------------------------------------------------- [MGA] slack = 0.1 iterations = 4 -weight = "integer" # currently supported: [integer, normalized] +weight = "integer" [myopic] -view_depth = 2 # number of periods seen/analyzed per iteration -step_size = 1 # number of periods to step by +view_depth = 2 +step_size = 1 diff --git a/tests/testing_data/annualised_demand.sql b/tests/testing_data/annualised_demand.sql index aa694747..a69b0e57 100644 --- a/tests/testing_data/annualised_demand.sql +++ b/tests/testing_data/annualised_demand.sql @@ -1,1081 +1,55 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('source','s',NULL); -INSERT INTO "commodity" VALUES('annual','a',NULL); -INSERT INTO "commodity" VALUES('physical','p',NULL); -INSERT INTO "commodity" VALUES('demand','d',NULL); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('region','annual',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','non_annual',2000,1.0,NULL,NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('region',2000,'annual',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2000,'non_annual',2000,1.0,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('region',2000,'demand',1.0,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('region','annual','annual',2000,'physical',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','annual','annual',2000,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','physical','annual',2000,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','physical','annual',2000,'annual',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','import',2000,'physical',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','import',2000,'annual',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','annual','non_annual',2000,'physical',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','annual','non_annual',2000,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','physical','non_annual',2000,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','physical','non_annual',2000,'annual',1.0,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('region','annual',1.0,NULL); -INSERT INTO "lifetime_tech" VALUES('region','non_annual',1.0,NULL); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_activity" VALUES('region',2000,'annual','le',0.5,NULL,NULL); -INSERT INTO "limit_activity" VALUES('region',2000,'non_annual','le',0.5,NULL,NULL); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "loan_lifetime_process" VALUES('region','annual',2000,1.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('region','non_annual',2000,1.0,NULL); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('region',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('annual','p','energy',NULL,NULL,0,1,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('import','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('non_annual','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(0,'D1'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(0,2000,'f'); -INSERT INTO "time_period" VALUES(1,2001,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2000,0,'S1',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2000,'S1','D1',1.0,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "commodity" VALUES('source', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('annual', 'a', NULL, NULL); +REPLACE INTO "commodity" VALUES('physical', 'p', NULL, NULL); +REPLACE INTO "commodity" VALUES('demand', 'd', NULL, NULL); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "cost_invest" VALUES('region','annual',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','non_annual',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2000,'annual',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2000,'non_annual',2000,1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2000,'demand',1.0,NULL,NULL); +REPLACE INTO "efficiency" VALUES('region', 'annual', 'annual', 2000, 'physical', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'annual', 'annual', 2000, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'physical', 'annual', 2000, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'physical', 'annual', 2000, 'annual', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'import', 2000, 'physical', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'import', 2000, 'annual', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'annual', 'non_annual', 2000, 'physical', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'annual', 'non_annual', 2000, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'physical', 'non_annual', 2000, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'physical', 'non_annual', 2000, 'annual', 1.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'annual', 1.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'non_annual', 1.0, NULL, NULL); +REPLACE INTO "limit_activity" VALUES('region',2000,'annual','le',0.5,NULL,NULL); +REPLACE INTO "limit_activity" VALUES('region',2000,'non_annual','le',0.5,NULL,NULL); +REPLACE INTO "loan_lifetime_process" VALUES('region', 'annual', 2000, 1.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('region', 'non_annual', 2000, 1.0, NULL, NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('region',NULL); +REPLACE INTO "technology" VALUES('annual','p','energy',NULL,NULL,0,1,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('import','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('non_annual','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(0,'D1'); +REPLACE INTO "time_period" VALUES(0,2000,'f'); +REPLACE INTO "time_period" VALUES(1,2001,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2000,0,'S1',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'S1','D1',1.0,NULL); diff --git a/tests/testing_data/emissions.sql b/tests/testing_data/emissions.sql index 3e3355ef..25faaf3e 100644 --- a/tests/testing_data/emissions.sql +++ b/tests/testing_data/emissions.sql @@ -1,1130 +1,104 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD1','TechCurtailment',1.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD2','TechCurtailment',0.5,NULL); -INSERT INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD1','TechOrdinary',1.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD2','TechOrdinary',0.5,NULL); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('annual_in','s',NULL); -INSERT INTO "commodity" VALUES('flex_in','s',NULL); -INSERT INTO "commodity" VALUES('ordinary_in','s',NULL); -INSERT INTO "commodity" VALUES('curtailment_in','s',NULL); -INSERT INTO "commodity" VALUES('annual_out','d',NULL); -INSERT INTO "commodity" VALUES('flex_out','p',NULL); -INSERT INTO "commodity" VALUES('ordinary_out','d',NULL); -INSERT INTO "commodity" VALUES('curtailment_out','d',NULL); -INSERT INTO "commodity" VALUES('emission','e',NULL); -INSERT INTO "commodity" VALUES('flex_null','d',NULL); -INSERT INTO "commodity" VALUES('annual_flex_out','p',NULL); -INSERT INTO "commodity" VALUES('annual_flex_in','s',NULL); -INSERT INTO "commodity" VALUES('annual_flex_null','d',NULL); -INSERT INTO "commodity" VALUES('embodied_in','s',NULL); -INSERT INTO "commodity" VALUES('embodied_out','d',NULL); -INSERT INTO "commodity" VALUES('eol_in','s',NULL); -INSERT INTO "commodity" VALUES('eol_out','d',NULL); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -INSERT INTO "cost_emission" VALUES('Testregion',2000,'emission',0.7,NULL,NULL); -INSERT INTO "cost_emission" VALUES('Testregion',2005,'emission',0.7,NULL,NULL); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('Testregion',2000,'annual_out',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'ordinary_out',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'curtailment_out',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'flex_null',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'annual_flex_null',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'embodied_out',0.6,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2000,'eol_out',0.6,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'ordinary_out',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'annual_out',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'curtailment_out',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'flex_null',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'annual_flex_null',0.3,NULL,NULL); -INSERT INTO "demand" VALUES('Testregion',2005,'embodied_out',0.6,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('Testregion','annual_in','TechAnnual',2000,'annual_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','flex_in','TechFlex',2000,'flex_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','ordinary_in','TechOrdinary',2000,'ordinary_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','curtailment_in','TechCurtailment',2000,'curtailment_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','flex_out','TechFlexNull',2000,'flex_null',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','annual_flex_out','TechFlexNull',2000,'annual_flex_null',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','annual_flex_in','TechAnnualFlex',2000,'annual_flex_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','embodied_in','TechEmbodied',2000,'embodied_out',1.0,NULL); -INSERT INTO "efficiency" VALUES('Testregion','eol_in','TechEndOfLife',2000,'eol_out',1.0,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('Testregion','emission','annual_in','TechAnnual',2000,'annual_out',1.0,NULL,NULL); -INSERT INTO "emission_activity" VALUES('Testregion','emission','flex_in','TechFlex',2000,'flex_out',1.0,NULL,NULL); -INSERT INTO "emission_activity" VALUES('Testregion','emission','ordinary_in','TechOrdinary',2000,'ordinary_out',1.0,NULL,NULL); -INSERT INTO "emission_activity" VALUES('Testregion','emission','curtailment_in','TechCurtailment',2000,'curtailment_out',1.0,NULL,NULL); -INSERT INTO "emission_activity" VALUES('Testregion','emission','annual_flex_in','TechAnnualFlex',2000,'annual_flex_out',1.0,NULL,NULL); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -INSERT INTO "emission_embodied" VALUES('Testregion','emission','TechEmbodied',2000,0.5,NULL,NULL); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -INSERT INTO "emission_end_of_life" VALUES('Testregion','emission','TechEndOfLife',2000,0.5,NULL,NULL); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('Testregion','TechEndOfLife',5.0,NULL); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_activity" VALUES('Testregion',2000,'TechFlex','ge',1.0,NULL,NULL); -INSERT INTO "limit_activity" VALUES('Testregion',2000,'TechAnnualFlex','ge',1.0,NULL,NULL); -INSERT INTO "limit_activity" VALUES('Testregion',2000,'TechFlex','le',1.0,NULL,NULL); -INSERT INTO "limit_activity" VALUES('Testregion',2000,'TechAnnualFlex','le',1.0,NULL,NULL); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_capacity" VALUES('Testregion',2000,'TechOrdinary','ge',1.0,NULL,NULL); -INSERT INTO "limit_capacity" VALUES('Testregion',2000,'TechCurtailment','ge',1.0,NULL,NULL); -INSERT INTO "limit_capacity" VALUES('Testregion',2000,'TechOrdinary','le',1.0,NULL,NULL); -INSERT INTO "limit_capacity" VALUES('Testregion',2000,'TechCurtailment','le',1.0,NULL,NULL); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('Testregion',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('S1',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('TechAnnual','p','energy',NULL,NULL,0,1,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('TechFlex','p','energy',NULL,NULL,0,0,0,0,0,1,0,0,NULL); -INSERT INTO "technology" VALUES('TechOrdinary','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('TechCurtailment','p','energy',NULL,NULL,0,0,0,1,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('TechFlexNull','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('TechAnnualFlex','p','energy',NULL,NULL,0,1,0,0,0,1,0,0,NULL); -INSERT INTO "technology" VALUES('TechEmbodied','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('TechEndOfLife','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'TOD1'); -INSERT INTO "time_of_day" VALUES(2,'TOD2'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(1,1999,'e'); -INSERT INTO "time_period" VALUES(2,2000,'f'); -INSERT INTO "time_period" VALUES(3,2005,'f'); -INSERT INTO "time_period" VALUES(4,2010,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2000,1,'S1',NULL); -INSERT INTO "time_season" VALUES(2005,1,'S1',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2000,'S1','TOD1',0.5,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'S1','TOD2',0.5,NULL); -INSERT INTO "time_segment_fraction" VALUES(2005,'S1','TOD1',0.5,NULL); -INSERT INTO "time_segment_fraction" VALUES(2005,'S1','TOD2',0.5,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD1','TechCurtailment',1.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD2','TechCurtailment',0.5,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD1','TechOrdinary',1.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('Testregion',2000,'S1','TOD2','TechOrdinary',0.5,NULL); +REPLACE INTO "commodity" VALUES('annual_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('flex_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('ordinary_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('curtailment_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('annual_out', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('flex_out', 'p', NULL, NULL); +REPLACE INTO "commodity" VALUES('ordinary_out', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('curtailment_out', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('emission', 'e', NULL, NULL); +REPLACE INTO "commodity" VALUES('flex_null', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('annual_flex_out', 'p', NULL, NULL); +REPLACE INTO "commodity" VALUES('annual_flex_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('annual_flex_null', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('embodied_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('embodied_out', 'd', NULL, NULL); +REPLACE INTO "commodity" VALUES('eol_in', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('eol_out', 'd', NULL, NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "cost_emission" VALUES('Testregion',2000,'emission',0.7,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('Testregion',2005,'emission',0.7,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'annual_out',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'ordinary_out',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'curtailment_out',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'flex_null',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'annual_flex_null',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'embodied_out',0.6,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2000,'eol_out',0.6,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'ordinary_out',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'annual_out',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'curtailment_out',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'flex_null',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'annual_flex_null',0.3,NULL,NULL); +REPLACE INTO "demand" VALUES('Testregion',2005,'embodied_out',0.6,NULL,NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'annual_in', 'TechAnnual', 2000, 'annual_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'flex_in', 'TechFlex', 2000, 'flex_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'ordinary_in', 'TechOrdinary', 2000, 'ordinary_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'curtailment_in', 'TechCurtailment', 2000, 'curtailment_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'flex_out', 'TechFlexNull', 2000, 'flex_null', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'annual_flex_out', 'TechFlexNull', 2000, 'annual_flex_null', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'annual_flex_in', 'TechAnnualFlex', 2000, 'annual_flex_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'embodied_in', 'TechEmbodied', 2000, 'embodied_out', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('Testregion', 'eol_in', 'TechEndOfLife', 2000, 'eol_out', 1.0, NULL, NULL); +REPLACE INTO "emission_activity" VALUES('Testregion','emission','annual_in','TechAnnual',2000,'annual_out',1.0,NULL,NULL); +REPLACE INTO "emission_activity" VALUES('Testregion','emission','flex_in','TechFlex',2000,'flex_out',1.0,NULL,NULL); +REPLACE INTO "emission_activity" VALUES('Testregion','emission','ordinary_in','TechOrdinary',2000,'ordinary_out',1.0,NULL,NULL); +REPLACE INTO "emission_activity" VALUES('Testregion','emission','curtailment_in','TechCurtailment',2000,'curtailment_out',1.0,NULL,NULL); +REPLACE INTO "emission_activity" VALUES('Testregion','emission','annual_flex_in','TechAnnualFlex',2000,'annual_flex_out',1.0,NULL,NULL); +REPLACE INTO "emission_embodied" VALUES('Testregion','emission','TechEmbodied',2000,0.5,NULL,NULL); +REPLACE INTO "emission_end_of_life" VALUES('Testregion','emission','TechEndOfLife',2000,0.5,NULL,NULL); +REPLACE INTO "lifetime_tech" VALUES('Testregion', 'TechEndOfLife', 5.0, NULL, NULL); +REPLACE INTO "limit_activity" VALUES('Testregion',2000,'TechFlex','ge',1.0,NULL,NULL); +REPLACE INTO "limit_activity" VALUES('Testregion',2000,'TechAnnualFlex','ge',1.0,NULL,NULL); +REPLACE INTO "limit_activity" VALUES('Testregion',2000,'TechFlex','le',1.0,NULL,NULL); +REPLACE INTO "limit_activity" VALUES('Testregion',2000,'TechAnnualFlex','le',1.0,NULL,NULL); +REPLACE INTO "limit_capacity" VALUES('Testregion',2000,'TechOrdinary','ge',1.0,NULL,NULL); +REPLACE INTO "limit_capacity" VALUES('Testregion',2000,'TechCurtailment','ge',1.0,NULL,NULL); +REPLACE INTO "limit_capacity" VALUES('Testregion',2000,'TechOrdinary','le',1.0,NULL,NULL); +REPLACE INTO "limit_capacity" VALUES('Testregion',2000,'TechCurtailment','le',1.0,NULL,NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('Testregion',NULL); +REPLACE INTO "season_label" VALUES('S1',NULL); +REPLACE INTO "technology" VALUES('TechAnnual','p','energy',NULL,NULL,0,1,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('TechFlex','p','energy',NULL,NULL,0,0,0,0,0,1,0,0,NULL); +REPLACE INTO "technology" VALUES('TechOrdinary','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('TechCurtailment','p','energy',NULL,NULL,0,0,0,1,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('TechFlexNull','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('TechAnnualFlex','p','energy',NULL,NULL,0,1,0,0,0,1,0,0,NULL); +REPLACE INTO "technology" VALUES('TechEmbodied','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('TechEndOfLife','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'TOD1'); +REPLACE INTO "time_of_day" VALUES(2,'TOD2'); +REPLACE INTO "time_period" VALUES(1,1999,'e'); +REPLACE INTO "time_period" VALUES(2,2000,'f'); +REPLACE INTO "time_period" VALUES(3,2005,'f'); +REPLACE INTO "time_period" VALUES(4,2010,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2000,1,'S1',NULL); +REPLACE INTO "time_season" VALUES(2005,1,'S1',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'S1','TOD1',0.5,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'S1','TOD2',0.5,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2005,'S1','TOD1',0.5,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2005,'S1','TOD2',0.5,NULL); diff --git a/tests/testing_data/materials.sql b/tests/testing_data/materials.sql index f32e898d..abf2c3c0 100644 --- a/tests/testing_data/materials.sql +++ b/tests/testing_data/materials.sql @@ -1,1530 +1,504 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','morning','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','morning','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','morning','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','afternoon','SOL_PV',0.3,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','afternoon','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','afternoon','SOL_PV',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','evening','SOL_PV',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','evening','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','overnight','SOL_PV',0.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','overnight','SOL_PV',0.0,NULL); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ethos','s','import dummy source'); -INSERT INTO "commodity" VALUES('electricity','p','grid electricity'); -INSERT INTO "commodity" VALUES('passenger_km','d','demand for passenger km'); -INSERT INTO "commodity" VALUES('battery_nmc','a','battery - lithium nickel manganese cobalt oxide'); -INSERT INTO "commodity" VALUES('battery_lfp','a','battery - lithium iron phosphate'); -INSERT INTO "commodity" VALUES('lithium','a','lithium'); -INSERT INTO "commodity" VALUES('cobalt','a','cobalt'); -INSERT INTO "commodity" VALUES('phosphorous','a','phosphorous'); -INSERT INTO "commodity" VALUES('diesel','a','diesel'); -INSERT INTO "commodity" VALUES('heating','d','demand for residential heating'); -INSERT INTO "commodity" VALUES('nickel','a','nickel'); -INSERT INTO "commodity" VALUES('used_batt_nmc','wa','used battery - lithium nickel manganese cobalt oxide'); -INSERT INTO "commodity" VALUES('used_batt_lfp','wa','used battery - lithium iron phosphate'); -INSERT INTO "commodity" VALUES('co2e','e','emitted co2-equivalent GHGs'); -INSERT INTO "commodity" VALUES('waste_steel','w','waste steel from cars'); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -INSERT INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2000,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2000,0.1,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2010,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2010,0.1,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2020,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2020,0.1,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2000,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2000,0.1,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2010,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2010,0.1,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2020,1.0,NULL,NULL); -INSERT INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2020,0.1,NULL,NULL); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -INSERT INTO "cost_emission" VALUES('regionA',2000,'co2e',1.0,NULL,NULL); -INSERT INTO "cost_emission" VALUES('regionA',2010,'co2e',1.0,NULL,NULL); -INSERT INTO "cost_emission" VALUES('regionA',2020,'co2e',1.0,NULL,NULL); -INSERT INTO "cost_emission" VALUES('regionB',2000,'co2e',1.0,NULL,NULL); -INSERT INTO "cost_emission" VALUES('regionB',2010,'co2e',1.0,NULL,NULL); -INSERT INTO "cost_emission" VALUES('regionB',2020,'co2e',1.0,NULL,NULL); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('regionA','CAR_BEV',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_BEV',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_BEV',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_PHEV',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_PHEV',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_PHEV',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_ICE',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_ICE',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','CAR_ICE',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','RECYCLE_NMC',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','RECYCLE_LFP',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','MANUFAC_NMC',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','MANUFAC_LFP',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','BATT_GRID',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','SOL_PV',2000,10.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA','GEN_DSL',2000,2.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_BEV',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_BEV',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_BEV',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_PHEV',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_PHEV',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_PHEV',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_ICE',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_ICE',2010,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','CAR_ICE',2020,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','RECYCLE_NMC',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','RECYCLE_LFP',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','MANUFAC_NMC',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','MANUFAC_LFP',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','BATT_GRID',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','GEN_DSL',2000,2.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionA-regionB','ELEC_INTERTIE',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB-regionA','ELEC_INTERTIE',2000,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('regionB','SOL_PV',2000,1.0,NULL,NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('regionA',2000,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2000,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2000,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2000,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2000,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2000,'DOMESTIC_NI',2000,0.5,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2010,'DOMESTIC_NI',2000,0.5,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionA',2020,'DOMESTIC_NI',2000,0.5,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'IMPORT_DSL',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'IMPORT_LI',2000,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'IMPORT_NI',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'IMPORT_CO',2000,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'IMPORT_P',2000,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2000,'DOMESTIC_NI',2000,0.5,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2010,'DOMESTIC_NI',2000,0.5,NULL,NULL); -INSERT INTO "cost_variable" VALUES('regionB',2020,'DOMESTIC_NI',2000,0.5,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('regionA',2000,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionA',2010,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionA',2020,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionA',2000,'heating',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionA',2010,'heating',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionA',2020,'heating',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2000,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2010,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2020,'passenger_km',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2000,'heating',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2010,'heating',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('regionB',2020,'heating',1.0,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('regionA','ethos','DOMESTIC_NI',2000,'nickel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','IMPORT_LI',2000,'lithium',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','IMPORT_NI',2000,'nickel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','IMPORT_CO',2000,'cobalt',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','IMPORT_P',2000,'phosphorous',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','used_batt_nmc','RECYCLE_NMC',2000,'battery_nmc',0.2,NULL); -INSERT INTO "efficiency" VALUES('regionA','used_batt_lfp','RECYCLE_LFP',2000,'battery_lfp',0.2,NULL); -INSERT INTO "efficiency" VALUES('regionA','lithium','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','nickel','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','cobalt','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','lithium','MANUFAC_LFP',2000,'battery_lfp',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','phosphorous','MANUFAC_LFP',2000,'battery_lfp',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','RECYCLE_NMC',2000,'battery_nmc',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionA','electricity','RECYCLE_LFP',2000,'battery_lfp',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionA','electricity','MANUFAC_NMC',2000,'battery_nmc',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionA','electricity','MANUFAC_LFP',2000,'battery_lfp',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionA','diesel','GEN_DSL',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','SOL_PV',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','BATT_GRID',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','FURNACE',2000,'heating',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','HEATPUMP',2000,'heating',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_BEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_PHEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_PHEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_ICE',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_BEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_PHEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_PHEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_ICE',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_BEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_PHEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_PHEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_ICE',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_BEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','electricity','CAR_PHEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_PHEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA','diesel','CAR_ICE',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','DOMESTIC_NI',2000,'nickel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','IMPORT_LI',2000,'lithium',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','IMPORT_NI',2000,'nickel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','IMPORT_CO',2000,'cobalt',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','IMPORT_P',2000,'phosphorous',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','used_batt_nmc','RECYCLE_NMC',2000,'battery_nmc',0.2,NULL); -INSERT INTO "efficiency" VALUES('regionB','used_batt_lfp','RECYCLE_LFP',2000,'battery_lfp',0.2,NULL); -INSERT INTO "efficiency" VALUES('regionB','lithium','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','nickel','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','cobalt','MANUFAC_NMC',2000,'battery_nmc',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','lithium','MANUFAC_LFP',2000,'battery_lfp',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','phosphorous','MANUFAC_LFP',2000,'battery_lfp',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','RECYCLE_NMC',2000,'battery_nmc',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionB','electricity','RECYCLE_LFP',2000,'battery_lfp',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionB','electricity','MANUFAC_NMC',2000,'battery_nmc',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionB','electricity','MANUFAC_LFP',2000,'battery_lfp',0.001,'Effectively zero'); -INSERT INTO "efficiency" VALUES('regionB','diesel','GEN_DSL',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','SOL_PV',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','BATT_GRID',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','FURNACE',2000,'heating',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','HEATPUMP',2000,'heating',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_BEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_PHEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_PHEV',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_ICE',1990,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_BEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_PHEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_PHEV',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_ICE',2000,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_BEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_PHEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_PHEV',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_ICE',2010,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_BEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','electricity','CAR_PHEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_PHEV',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionB','diesel','CAR_ICE',2020,'passenger_km',1.0,NULL); -INSERT INTO "efficiency" VALUES('regionA-regionB','electricity','ELEC_INTERTIE',2000,'electricity',0.9,NULL); -INSERT INTO "efficiency" VALUES('regionB-regionA','electricity','ELEC_INTERTIE',2000,'electricity',0.9,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('regionA','co2e','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL,'assumed combusted'); -INSERT INTO "emission_activity" VALUES('regionB','co2e','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL,'assumed combusted'); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',1990,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',1990,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2000,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2000,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2010,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2010,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',1990,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',1990,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2000,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2000,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2010,'used_batt_nmc',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2010,'used_batt_lfp',0.1,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_ICE',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_ICE',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2010,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_ICE',2010,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2010,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_ICE',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',1990,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_ICE',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2000,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2010,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_ICE',2010,'waste_steel',1.0,NULL,NULL); -INSERT INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2010,'waste_steel',1.0,NULL,NULL); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "existing_capacity" VALUES('regionA','CAR_BEV',1990,1.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('regionA','CAR_PHEV',1990,1.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('regionA','CAR_ICE',1990,1.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('regionB','CAR_BEV',1990,1.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('regionB','CAR_PHEV',1990,1.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('regionB','CAR_ICE',1990,1.0,NULL,NULL); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('regionA','CAR_BEV',10.0,NULL); -INSERT INTO "lifetime_tech" VALUES('regionA','CAR_PHEV',10.0,NULL); -INSERT INTO "lifetime_tech" VALUES('regionA','CAR_ICE',10.0,NULL); -INSERT INTO "lifetime_tech" VALUES('regionB','CAR_BEV',10.0,NULL); -INSERT INTO "lifetime_tech" VALUES('regionB','CAR_PHEV',10.0,NULL); -INSERT INTO "lifetime_tech" VALUES('regionB','CAR_ICE',10.0,NULL); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'diesel','CAR_PHEV','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'diesel','CAR_PHEV','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'diesel','CAR_PHEV','le',0.8,NULL); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'lithium','MANUFAC_NMC','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'nickel','MANUFAC_NMC','le',0.15,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'cobalt','MANUFAC_NMC','le',0.04,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','MANUFAC_NMC','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'lithium','MANUFAC_LFP','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'phosphorous','MANUFAC_LFP','le',0.19,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','MANUFAC_LFP','le',0.01,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'diesel','CAR_PHEV','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'diesel','CAR_PHEV','le',0.8,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','CAR_PHEV','le',0.2,''); -INSERT INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'diesel','CAR_PHEV','le',0.8,NULL); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('regionA',NULL); -INSERT INTO "region" VALUES('regionB',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('summer',NULL); -INSERT INTO "season_label" VALUES('autumn',NULL); -INSERT INTO "season_label" VALUES('winter',NULL); -INSERT INTO "season_label" VALUES('spring',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "storage_duration" VALUES('regionA','BATT_GRID',2.0,'2 hours energy storage'); -INSERT INTO "storage_duration" VALUES('regionB','BATT_GRID',2.0,'2 hours energy storage'); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('IMPORT_LI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'lithium importer'); -INSERT INTO "technology" VALUES('IMPORT_CO','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'cobalt importer'); -INSERT INTO "technology" VALUES('IMPORT_P','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'phosphorous importer'); -INSERT INTO "technology" VALUES('CAR_BEV','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - battery electric'); -INSERT INTO "technology" VALUES('CAR_PHEV','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - plug in hybrid'); -INSERT INTO "technology" VALUES('CAR_ICE','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - internal combustion'); -INSERT INTO "technology" VALUES('RECYCLE_NMC','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'nmc battery recycler'); -INSERT INTO "technology" VALUES('RECYCLE_LFP','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'lfp battery recycler'); -INSERT INTO "technology" VALUES('MANUFAC_NMC','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'nmc battery manufacturing'); -INSERT INTO "technology" VALUES('MANUFAC_LFP','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'lfp battery manufacturing'); -INSERT INTO "technology" VALUES('IMPORT_NI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'nickel importer'); -INSERT INTO "technology" VALUES('DOMESTIC_NI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'domestic nickel production'); -INSERT INTO "technology" VALUES('GEN_DSL','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,'diesel generators'); -INSERT INTO "technology" VALUES('SOL_PV','p','electricity',NULL,NULL,0,0,0,1,0,0,0,0,'solar panels'); -INSERT INTO "technology" VALUES('BATT_GRID','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,0,'grid battery storage'); -INSERT INTO "technology" VALUES('FURNACE','p','residential',NULL,NULL,1,0,0,0,0,0,0,0,'diesel furnace heater'); -INSERT INTO "technology" VALUES('HEATPUMP','p','residential',NULL,NULL,1,0,0,0,0,0,0,0,'heat pump'); -INSERT INTO "technology" VALUES('IMPORT_DSL','p','fuels',NULL,NULL,1,1,0,0,0,0,0,0,'diesel importer'); -INSERT INTO "technology" VALUES('ELEC_INTERTIE','p','electricity',NULL,NULL,0,0,0,0,0,0,1,0,'dummy tech to make landfill feasible'); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'morning'); -INSERT INTO "time_of_day" VALUES(2,'afternoon'); -INSERT INTO "time_of_day" VALUES(3,'evening'); -INSERT INTO "time_of_day" VALUES(4,'overnight'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(1,1990,'e'); -INSERT INTO "time_period" VALUES(2,2000,'f'); -INSERT INTO "time_period" VALUES(3,2010,'f'); -INSERT INTO "time_period" VALUES(4,2020,'f'); -INSERT INTO "time_period" VALUES(5,2030,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2000,1,'summer',NULL); -INSERT INTO "time_season" VALUES(2000,2,'autumn',NULL); -INSERT INTO "time_season" VALUES(2000,3,'winter',NULL); -INSERT INTO "time_season" VALUES(2000,4,'spring',NULL); -INSERT INTO "time_season" VALUES(2010,5,'summer',NULL); -INSERT INTO "time_season" VALUES(2010,6,'autumn',NULL); -INSERT INTO "time_season" VALUES(2010,7,'winter',NULL); -INSERT INTO "time_season" VALUES(2010,8,'spring',NULL); -INSERT INTO "time_season" VALUES(2020,9,'summer',NULL); -INSERT INTO "time_season" VALUES(2020,10,'autumn',NULL); -INSERT INTO "time_season" VALUES(2020,11,'winter',NULL); -INSERT INTO "time_season" VALUES(2020,12,'spring',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2000,'summer','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'autumn','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'winter','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'spring','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'summer','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'autumn','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'winter','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'spring','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'summer','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'autumn','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'winter','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'spring','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'summer','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'autumn','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'winter','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'spring','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'summer','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'autumn','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'winter','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'spring','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'summer','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'autumn','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'winter','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'spring','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'summer','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'autumn','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'winter','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'spring','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'summer','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'autumn','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'winter','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2010,'spring','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'autumn','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','morning',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'autumn','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','afternoon',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'autumn','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','evening',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'autumn','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','overnight',0.0625,NULL); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','overnight',0.0625,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2000,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2010,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionA',2020,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2000,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2010,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','morning','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','morning','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','morning','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','afternoon','SOL_PV',0.3,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','afternoon','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','afternoon','SOL_PV',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','evening','SOL_PV',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','evening','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'summer','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'autumn','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'winter','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('regionB',2020,'spring','overnight','SOL_PV',0.0,NULL); +REPLACE INTO "commodity" VALUES('ethos', 's', 'import dummy source', NULL); +REPLACE INTO "commodity" VALUES('electricity', 'p', 'grid electricity', NULL); +REPLACE INTO "commodity" VALUES('passenger_km', 'd', 'demand for passenger km', NULL); +REPLACE INTO "commodity" VALUES('battery_nmc', 'a', 'battery - lithium nickel manganese cobalt oxide', NULL); +REPLACE INTO "commodity" VALUES('battery_lfp', 'a', 'battery - lithium iron phosphate', NULL); +REPLACE INTO "commodity" VALUES('lithium', 'a', 'lithium', NULL); +REPLACE INTO "commodity" VALUES('cobalt', 'a', 'cobalt', NULL); +REPLACE INTO "commodity" VALUES('phosphorous', 'a', 'phosphorous', NULL); +REPLACE INTO "commodity" VALUES('diesel', 'a', 'diesel', NULL); +REPLACE INTO "commodity" VALUES('heating', 'd', 'demand for residential heating', NULL); +REPLACE INTO "commodity" VALUES('nickel', 'a', 'nickel', NULL); +REPLACE INTO "commodity" VALUES('used_batt_nmc', 'wa', 'used battery - lithium nickel manganese cobalt oxide', NULL); +REPLACE INTO "commodity" VALUES('used_batt_lfp', 'wa', 'used battery - lithium iron phosphate', NULL); +REPLACE INTO "commodity" VALUES('co2e', 'e', 'emitted co2-equivalent GHGs', NULL); +REPLACE INTO "commodity" VALUES('waste_steel', 'w', 'waste steel from cars', NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2000,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2000,0.1,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2010,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2010,0.1,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionA','battery_nmc','CAR_BEV',2020,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionA','battery_lfp','CAR_PHEV',2020,0.1,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2000,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2000,0.1,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2010,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2010,0.1,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_nmc','CAR_BEV',2020,1.0,NULL,NULL); +REPLACE INTO "construction_input" VALUES('regionB','battery_lfp','CAR_PHEV',2020,0.1,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionA',2000,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionA',2010,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionA',2020,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionB',2000,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionB',2010,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_emission" VALUES('regionB',2020,'co2e',1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_BEV',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_BEV',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_BEV',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_PHEV',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_PHEV',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_PHEV',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_ICE',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_ICE',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','CAR_ICE',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','RECYCLE_NMC',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','RECYCLE_LFP',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','MANUFAC_NMC',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','MANUFAC_LFP',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','BATT_GRID',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','SOL_PV',2000,10.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA','GEN_DSL',2000,2.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_BEV',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_BEV',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_BEV',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_PHEV',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_PHEV',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_PHEV',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_ICE',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_ICE',2010,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','CAR_ICE',2020,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','RECYCLE_NMC',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','RECYCLE_LFP',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','MANUFAC_NMC',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','MANUFAC_LFP',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','BATT_GRID',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','GEN_DSL',2000,2.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionA-regionB','ELEC_INTERTIE',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB-regionA','ELEC_INTERTIE',2000,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('regionB','SOL_PV',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2000,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2010,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionA',2020,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'IMPORT_DSL',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'IMPORT_LI',2000,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'IMPORT_NI',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'IMPORT_CO',2000,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'IMPORT_P',2000,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2000,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2010,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('regionB',2020,'DOMESTIC_NI',2000,0.5,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2000,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2010,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2020,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2000,'heating',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2010,'heating',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionA',2020,'heating',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2000,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2010,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2020,'passenger_km',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2000,'heating',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2010,'heating',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('regionB',2020,'heating',1.0,NULL,NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'DOMESTIC_NI', 2000, 'nickel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'IMPORT_LI', 2000, 'lithium', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'IMPORT_NI', 2000, 'nickel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'IMPORT_CO', 2000, 'cobalt', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'IMPORT_P', 2000, 'phosphorous', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'used_batt_nmc', 'RECYCLE_NMC', 2000, 'battery_nmc', 0.2, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'used_batt_lfp', 'RECYCLE_LFP', 2000, 'battery_lfp', 0.2, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'lithium', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'nickel', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'cobalt', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'lithium', 'MANUFAC_LFP', 2000, 'battery_lfp', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'phosphorous', 'MANUFAC_LFP', 2000, 'battery_lfp', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'RECYCLE_NMC', 2000, 'battery_nmc', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'RECYCLE_LFP', 2000, 'battery_lfp', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'MANUFAC_NMC', 2000, 'battery_nmc', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'MANUFAC_LFP', 2000, 'battery_lfp', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'GEN_DSL', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'SOL_PV', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'BATT_GRID', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'ethos', 'IMPORT_DSL', 2000, 'diesel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'FURNACE', 2000, 'heating', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'HEATPUMP', 2000, 'heating', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_BEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_PHEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_PHEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_ICE', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_BEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_PHEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_PHEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_ICE', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_BEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_PHEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_PHEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_ICE', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_BEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'electricity', 'CAR_PHEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_PHEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA', 'diesel', 'CAR_ICE', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'DOMESTIC_NI', 2000, 'nickel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'IMPORT_LI', 2000, 'lithium', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'IMPORT_NI', 2000, 'nickel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'IMPORT_CO', 2000, 'cobalt', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'IMPORT_P', 2000, 'phosphorous', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'used_batt_nmc', 'RECYCLE_NMC', 2000, 'battery_nmc', 0.2, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'used_batt_lfp', 'RECYCLE_LFP', 2000, 'battery_lfp', 0.2, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'lithium', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'nickel', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'cobalt', 'MANUFAC_NMC', 2000, 'battery_nmc', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'lithium', 'MANUFAC_LFP', 2000, 'battery_lfp', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'phosphorous', 'MANUFAC_LFP', 2000, 'battery_lfp', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'RECYCLE_NMC', 2000, 'battery_nmc', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'RECYCLE_LFP', 2000, 'battery_lfp', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'MANUFAC_NMC', 2000, 'battery_nmc', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'MANUFAC_LFP', 2000, 'battery_lfp', 0.001, NULL, 'Effectively zero'); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'GEN_DSL', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'SOL_PV', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'BATT_GRID', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'ethos', 'IMPORT_DSL', 2000, 'diesel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'FURNACE', 2000, 'heating', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'HEATPUMP', 2000, 'heating', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_BEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_PHEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_PHEV', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_ICE', 1990, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_BEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_PHEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_PHEV', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_ICE', 2000, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_BEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_PHEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_PHEV', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_ICE', 2010, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_BEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'electricity', 'CAR_PHEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_PHEV', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB', 'diesel', 'CAR_ICE', 2020, 'passenger_km', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionA-regionB', 'electricity', 'ELEC_INTERTIE', 2000, 'electricity', 0.9, NULL, NULL); +REPLACE INTO "efficiency" VALUES('regionB-regionA', 'electricity', 'ELEC_INTERTIE', 2000, 'electricity', 0.9, NULL, NULL); +REPLACE INTO "emission_activity" VALUES('regionA','co2e','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL,'assumed combusted'); +REPLACE INTO "emission_activity" VALUES('regionB','co2e','ethos','IMPORT_DSL',2000,'diesel',1.0,NULL,'assumed combusted'); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',1990,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',1990,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2000,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2000,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2010,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2010,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',1990,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',1990,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2000,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2000,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2010,'used_batt_nmc',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2010,'used_batt_lfp',0.1,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_ICE',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_ICE',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_BEV',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_ICE',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionA','CAR_PHEV',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_ICE',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',1990,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_ICE',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2000,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_BEV',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_ICE',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "end_of_life_output" VALUES('regionB','CAR_PHEV',2010,'waste_steel',1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionA','CAR_BEV',1990,1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionA','CAR_PHEV',1990,1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionA','CAR_ICE',1990,1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionB','CAR_BEV',1990,1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionB','CAR_PHEV',1990,1.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('regionB','CAR_ICE',1990,1.0,NULL,NULL); +REPLACE INTO "lifetime_tech" VALUES('regionA', 'CAR_BEV', 10.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('regionA', 'CAR_PHEV', 10.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('regionA', 'CAR_ICE', 10.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('regionB', 'CAR_BEV', 10.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('regionB', 'CAR_PHEV', 10.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('regionB', 'CAR_ICE', 10.0, NULL, NULL); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2000,'diesel','CAR_PHEV','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2010,'diesel','CAR_PHEV','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionA',2020,'diesel','CAR_PHEV','le',0.8,NULL); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'lithium','MANUFAC_NMC','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'nickel','MANUFAC_NMC','le',0.15,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'cobalt','MANUFAC_NMC','le',0.04,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','MANUFAC_NMC','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'lithium','MANUFAC_LFP','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'phosphorous','MANUFAC_LFP','le',0.19,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','MANUFAC_LFP','le',0.01,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2000,'diesel','CAR_PHEV','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2010,'diesel','CAR_PHEV','le',0.8,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'electricity','CAR_PHEV','le',0.2,''); +REPLACE INTO "limit_tech_input_split_annual" VALUES('regionB',2020,'diesel','CAR_PHEV','le',0.8,NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('regionA',NULL); +REPLACE INTO "region" VALUES('regionB',NULL); +REPLACE INTO "season_label" VALUES('summer',NULL); +REPLACE INTO "season_label" VALUES('autumn',NULL); +REPLACE INTO "season_label" VALUES('winter',NULL); +REPLACE INTO "season_label" VALUES('spring',NULL); +REPLACE INTO "storage_duration" VALUES('regionA','BATT_GRID',2.0,'2 hours energy storage'); +REPLACE INTO "storage_duration" VALUES('regionB','BATT_GRID',2.0,'2 hours energy storage'); +REPLACE INTO "technology" VALUES('IMPORT_LI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'lithium importer'); +REPLACE INTO "technology" VALUES('IMPORT_CO','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'cobalt importer'); +REPLACE INTO "technology" VALUES('IMPORT_P','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'phosphorous importer'); +REPLACE INTO "technology" VALUES('CAR_BEV','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - battery electric'); +REPLACE INTO "technology" VALUES('CAR_PHEV','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - plug in hybrid'); +REPLACE INTO "technology" VALUES('CAR_ICE','p','transportation',NULL,NULL,0,0,0,0,0,0,0,0,'car - internal combustion'); +REPLACE INTO "technology" VALUES('RECYCLE_NMC','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'nmc battery recycler'); +REPLACE INTO "technology" VALUES('RECYCLE_LFP','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'lfp battery recycler'); +REPLACE INTO "technology" VALUES('MANUFAC_NMC','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'nmc battery manufacturing'); +REPLACE INTO "technology" VALUES('MANUFAC_LFP','p','materials',NULL,NULL,0,1,0,0,0,0,0,0,'lfp battery manufacturing'); +REPLACE INTO "technology" VALUES('IMPORT_NI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'nickel importer'); +REPLACE INTO "technology" VALUES('DOMESTIC_NI','p','materials',NULL,NULL,1,1,0,0,0,0,0,0,'domestic nickel production'); +REPLACE INTO "technology" VALUES('GEN_DSL','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,'diesel generators'); +REPLACE INTO "technology" VALUES('SOL_PV','p','electricity',NULL,NULL,0,0,0,1,0,0,0,0,'solar panels'); +REPLACE INTO "technology" VALUES('BATT_GRID','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,0,'grid battery storage'); +REPLACE INTO "technology" VALUES('FURNACE','p','residential',NULL,NULL,1,0,0,0,0,0,0,0,'diesel furnace heater'); +REPLACE INTO "technology" VALUES('HEATPUMP','p','residential',NULL,NULL,1,0,0,0,0,0,0,0,'heat pump'); +REPLACE INTO "technology" VALUES('IMPORT_DSL','p','fuels',NULL,NULL,1,1,0,0,0,0,0,0,'diesel importer'); +REPLACE INTO "technology" VALUES('ELEC_INTERTIE','p','electricity',NULL,NULL,0,0,0,0,0,0,1,0,'dummy tech to make landfill feasible'); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'morning'); +REPLACE INTO "time_of_day" VALUES(2,'afternoon'); +REPLACE INTO "time_of_day" VALUES(3,'evening'); +REPLACE INTO "time_of_day" VALUES(4,'overnight'); +REPLACE INTO "time_period" VALUES(1,1990,'e'); +REPLACE INTO "time_period" VALUES(2,2000,'f'); +REPLACE INTO "time_period" VALUES(3,2010,'f'); +REPLACE INTO "time_period" VALUES(4,2020,'f'); +REPLACE INTO "time_period" VALUES(5,2030,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2000,1,'summer',NULL); +REPLACE INTO "time_season" VALUES(2000,2,'autumn',NULL); +REPLACE INTO "time_season" VALUES(2000,3,'winter',NULL); +REPLACE INTO "time_season" VALUES(2000,4,'spring',NULL); +REPLACE INTO "time_season" VALUES(2010,5,'summer',NULL); +REPLACE INTO "time_season" VALUES(2010,6,'autumn',NULL); +REPLACE INTO "time_season" VALUES(2010,7,'winter',NULL); +REPLACE INTO "time_season" VALUES(2010,8,'spring',NULL); +REPLACE INTO "time_season" VALUES(2020,9,'summer',NULL); +REPLACE INTO "time_season" VALUES(2020,10,'autumn',NULL); +REPLACE INTO "time_season" VALUES(2020,11,'winter',NULL); +REPLACE INTO "time_season" VALUES(2020,12,'spring',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'autumn','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'spring','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'autumn','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'spring','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'autumn','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'spring','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'autumn','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'spring','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'autumn','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'spring','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'autumn','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'spring','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'autumn','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'spring','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'autumn','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2010,'spring','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'autumn','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','morning',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'autumn','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','afternoon',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'autumn','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','evening',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'autumn','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','overnight',0.0625,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','overnight',0.0625,NULL); diff --git a/tests/testing_data/mediumville.sql b/tests/testing_data/mediumville.sql index 6a1cd6ca..dcd0f59b 100644 --- a/tests/testing_data/mediumville.sql +++ b/tests/testing_data/mediumville.sql @@ -1,1224 +1,198 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -INSERT INTO "capacity_credit" VALUES('A',2025,'EF',2025,0.6,NULL); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_process" VALUES('A',2025,'s2','d1','EFL',2025,0.8,NULL); -INSERT INTO "capacity_factor_process" VALUES('A',2025,'s1','d2','EFL',2025,0.9,NULL); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_tech" VALUES('A',2025,'s1','d1','EF',0.8,NULL); -INSERT INTO "capacity_factor_tech" VALUES('B',2025,'s2','d2','bulbs',0.75,NULL); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "capacity_to_activity" VALUES('A','bulbs',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('B','bulbs',1.0,NULL); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ELC','p','electricity'); -INSERT INTO "commodity" VALUES('HYD','p','water'); -INSERT INTO "commodity" VALUES('co2','e','CO2 emissions'); -INSERT INTO "commodity" VALUES('RL','d','residential lighting'); -INSERT INTO "commodity" VALUES('earth','s','the source of stuff'); -INSERT INTO "commodity" VALUES('RH','d','residential heat'); -INSERT INTO "commodity" VALUES('FusionGas','e','mystery emission'); -INSERT INTO "commodity" VALUES('FusionGasFuel','p','converted mystery gas to fuel'); -INSERT INTO "commodity" VALUES('GeoHyd','p','Hot water from geo'); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -INSERT INTO "cost_emission" VALUES('A',2025,'co2',1.99,'dollars','none'); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_fixed" VALUES('A',2025,'EH',2025,3.3,'',''); -INSERT INTO "cost_fixed" VALUES('A',2025,'EF',2025,2.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('A',2025,'EFL',2025,3.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'batt',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'EF',2025,2.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('A',2025,'bulbs',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'bulbs',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('A',2025,'heater',2025,2.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'heater',2025,2.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'GeoThermal',2025,6.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'GeoHeater',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('B',2025,'EH',2025,3.3,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('A',2025,'GeoThermal',2025,4.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('A',2025,'GeoHeater',2025,4.5,NULL,NULL); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('A','EF',2025,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','EH',2025,3.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','bulbs',2025,4.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','heater',2025,5.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','EF',2025,6.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','batt',2025,7.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','bulbs',2025,8.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','heater',2025,9.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','EFL',2025,2.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','GeoThermal',2025,3.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','GeoHeater',2025,4.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('B','EH',2025,3.3,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','GeoThermal',2025,5.6,NULL,NULL); -INSERT INTO "cost_invest" VALUES('A','GeoHeater',2025,4.2,NULL,NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('A',2025,'EF',2025,9.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('A',2025,'EFL',2025,8.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('A',2025,'EH',2025,7.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('A',2025,'bulbs',2025,6.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('A',2025,'heater',2025,5.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('B',2025,'EF',2025,4.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('B',2025,'batt',2025,3.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('B',2025,'bulbs',2025,2.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('B',2025,'heater',2025,1.0,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('A',2025,'RL',100.0,'',''); -INSERT INTO "demand" VALUES('B',2025,'RL',100.0,NULL,NULL); -INSERT INTO "demand" VALUES('A',2025,'RH',50.0,NULL,NULL); -INSERT INTO "demand" VALUES('B',2025,'RH',50.0,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s1','d1','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s1','d2','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s2','d1','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s2','d2','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s1','d1','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s1','d2','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s2','d1','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s2','d2','RL',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s1','d1','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s2','d1','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s1','d1','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s2','d1','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s1','d2','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('A',2025,'s2','d2','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s1','d2','RH',0.25,NULL); -INSERT INTO "demand_specific_distribution" VALUES('B',2025,'s2','d2','RH',0.25,NULL); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('A','ELC','bulbs',2025,'RL',1.0,NULL); -INSERT INTO "efficiency" VALUES('A','HYD','EH',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('A','HYD','EF',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('B','ELC','bulbs',2025,'RL',1.0,NULL); -INSERT INTO "efficiency" VALUES('B','HYD','EH',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('B','ELC','batt',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('B','HYD','EF',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('A','earth','well',2025,'HYD',1.0,NULL); -INSERT INTO "efficiency" VALUES('B','earth','well',2025,'HYD',1.0,NULL); -INSERT INTO "efficiency" VALUES('A','earth','EFL',2025,'FusionGasFuel',1.0,NULL); -INSERT INTO "efficiency" VALUES('A','FusionGasFuel','heater',2025,'RH',0.9,NULL); -INSERT INTO "efficiency" VALUES('A-B','FusionGasFuel','FGF_pipe',2025,'FusionGasFuel',0.95,NULL); -INSERT INTO "efficiency" VALUES('B','FusionGasFuel','heater',2025,'RH',0.9,NULL); -INSERT INTO "efficiency" VALUES('B','GeoHyd','GeoHeater',2025,'RH',9.80000000000000093e-01,NULL); -INSERT INTO "efficiency" VALUES('B','earth','GeoThermal',2025,'GeoHyd',1.0,NULL); -INSERT INTO "efficiency" VALUES('B-A','FusionGasFuel','FGF_pipe',2025,'FusionGasFuel',0.95,NULL); -INSERT INTO "efficiency" VALUES('A','GeoHyd','GeoHeater',2025,'RH',0.9,NULL); -INSERT INTO "efficiency" VALUES('A','earth','GeoThermal',2025,'GeoHyd',1.0,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('A','co2','HYD','EH',2025,'ELC',0.02,NULL,NULL); -INSERT INTO "emission_activity" VALUES('A','FusionGas','HYD','EF',2025,'ELC',-0.2,NULL,'needs to be negative as a driver of linked tech...don''t ask'); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "existing_capacity" VALUES('A','EH',2020,200.0,'things',NULL); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "lifetime_process" VALUES('B','EF',2025,200.0,NULL); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('A','EH',60.0,''); -INSERT INTO "lifetime_tech" VALUES('B','bulbs',100.0,'super LED!'); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_activity" VALUES('A',2025,'EF','ge',0.001,'PJ/CY','goofy units'); -INSERT INTO "limit_activity" VALUES('B',2025,'EH','le',10000.0,'stuff',NULL); -INSERT INTO "limit_activity" VALUES('A',2025,'EF','le',10000.0,'stuff',NULL); -INSERT INTO "limit_activity" VALUES('A',2025,'A_tech_grp_1','ge',0.05,'',NULL); -INSERT INTO "limit_activity" VALUES('A',2025,'A_tech_grp_1','le',10000.0,'',NULL); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_capacity" VALUES('A',2025,'EH','ge',0.1,'',''); -INSERT INTO "limit_capacity" VALUES('B',2025,'batt','ge',0.1,'',''); -INSERT INTO "limit_capacity" VALUES('A',2025,'EH','le',20000.0,'',''); -INSERT INTO "limit_capacity" VALUES('B',2025,'EH','le',20000.0,'',''); -INSERT INTO "limit_capacity" VALUES('A',2025,'A_tech_grp_1','ge',0.2,'',NULL); -INSERT INTO "limit_capacity" VALUES('A',2025,'A_tech_grp_1','le',6000.0,'',NULL); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -INSERT INTO "limit_emission" VALUES('A',2025,'co2','le',10000.0,'gulps',NULL); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -INSERT INTO "limit_new_capacity_share" VALUES('A',2025,'RPS_common','A_tech_grp_1','ge',0.0,''); -INSERT INTO "limit_new_capacity_share" VALUES('global',2025,'RPS_common','A_tech_grp_1','le',1.0,''); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -INSERT INTO "limit_resource" VALUES('B','EF','le',9000.0,'clumps',NULL); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -INSERT INTO "limit_tech_input_split" VALUES('A',2025,'HYD','EH','ge',0.95,'95% HYD reqt. (other not specified...)'); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -INSERT INTO "limit_tech_output_split" VALUES('B',2025,'EH','ELC','ge',0.95,'95% ELC output (there are not others, this is a min)'); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -INSERT INTO "linked_tech" VALUES('A','EF','FusionGas','EFL',NULL); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "loan_lifetime_process" VALUES('A','EF',2025,57.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','EFL',2025,68.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','bulbs',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','EH',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','well',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','heater',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','GeoHeater',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A','GeoThermal',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','EF',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','bulbs',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','EH',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','batt',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','well',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','heater',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','GeoHeater',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B','GeoThermal',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('A-B','FGF_pipe',2025,10.0,NULL); -INSERT INTO "loan_lifetime_process" VALUES('B-A','FGF_pipe',2025,10.0,NULL); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -INSERT INTO "metadata_real" VALUES('global_discount_rate',4.2000000000000004e-01,''); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -INSERT INTO "planning_reserve_margin" VALUES('A',0.05,NULL); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "ramp_down_hourly" VALUES('A','EH',0.05,NULL); -INSERT INTO "ramp_down_hourly" VALUES('B','EH',0.05,NULL); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "ramp_up_hourly" VALUES('B','EH',0.05,NULL); -INSERT INTO "ramp_up_hourly" VALUES('A','EH',0.05,NULL); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('A','main region'); -INSERT INTO "region" VALUES('B','just a 2nd region'); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -INSERT INTO "rps_requirement" VALUES('B',2025,'RPS_common',0.3,NULL); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('s1',NULL); -INSERT INTO "season_label" VALUES('s2',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "sector_label" VALUES('supply',NULL); -INSERT INTO "sector_label" VALUES('electric',NULL); -INSERT INTO "sector_label" VALUES('transport',NULL); -INSERT INTO "sector_label" VALUES('commercial',NULL); -INSERT INTO "sector_label" VALUES('residential',NULL); -INSERT INTO "sector_label" VALUES('industrial',NULL); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "storage_duration" VALUES('B','batt',15.0,NULL); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "tech_group" VALUES('RPS_common',''); -INSERT INTO "tech_group" VALUES('A_tech_grp_1','converted from old db'); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -INSERT INTO "tech_group_member" VALUES('RPS_common','EF'); -INSERT INTO "tech_group_member" VALUES('A_tech_grp_1','EH'); -INSERT INTO "tech_group_member" VALUES('A_tech_grp_1','EF'); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('well','p','supply','water','',0,0,0,0,0,0,0,0,'plain old water'); -INSERT INTO "technology" VALUES('bulbs','p','residential','electric','',0,0,0,0,0,0,0,0,'residential lighting'); -INSERT INTO "technology" VALUES('EH','pb','electric','hydro','',0,0,0,1,1,0,0,0,'hydro power electric plant'); -INSERT INTO "technology" VALUES('batt','ps','electric','electric','',0,0,0,0,0,0,0,0,'big battery'); -INSERT INTO "technology" VALUES('EF','p','electric','electric','',0,0,1,0,0,0,0,0,'fusion plant'); -INSERT INTO "technology" VALUES('EFL','p','electric','electric','',0,0,0,0,0,1,0,0,'linked (to Fusion) producer'); -INSERT INTO "technology" VALUES('heater','p','residential','electric','',0,0,0,0,0,0,0,0,'heater'); -INSERT INTO "technology" VALUES('FGF_pipe','p','transport',NULL,'',0,0,0,0,0,0,1,0,'transportation line A->B'); -INSERT INTO "technology" VALUES('GeoThermal','p','residential','hydro','',0,1,0,0,0,0,0,0,'geothermal hot water source'); -INSERT INTO "technology" VALUES('GeoHeater','p','residential','hydro','',0,0,0,0,0,0,0,0,'geothermal heater from geo hyd'); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'d1'); -INSERT INTO "time_of_day" VALUES(2,'d2'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(1,2020,'e'); -INSERT INTO "time_period" VALUES(2,2025,'f'); -INSERT INTO "time_period" VALUES(3,2030,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2025,1,'s1',NULL); -INSERT INTO "time_season" VALUES(2025,2,'s2',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d1',0.25,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d2',0.25,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d1',0.25,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d2',0.25,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "capacity_credit" VALUES('A',2025,'EF',2025,0.6,NULL); +REPLACE INTO "capacity_factor_process" VALUES('A',2025,'s2','d1','EFL',2025,0.8,NULL); +REPLACE INTO "capacity_factor_process" VALUES('A',2025,'s1','d2','EFL',2025,0.9,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('A',2025,'s1','d1','EF',0.8,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('B',2025,'s2','d2','bulbs',0.75,NULL); +REPLACE INTO "capacity_to_activity" VALUES('A', 'bulbs', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('B', 'bulbs', 1.0, NULL, NULL); +REPLACE INTO "commodity" VALUES('ELC', 'p', 'electricity', NULL); +REPLACE INTO "commodity" VALUES('HYD', 'p', 'water', NULL); +REPLACE INTO "commodity" VALUES('co2', 'e', 'CO2 emissions', NULL); +REPLACE INTO "commodity" VALUES('RL', 'd', 'residential lighting', NULL); +REPLACE INTO "commodity" VALUES('earth', 's', 'the source of stuff', NULL); +REPLACE INTO "commodity" VALUES('RH', 'd', 'residential heat', NULL); +REPLACE INTO "commodity" VALUES('FusionGas', 'e', 'mystery emission', NULL); +REPLACE INTO "commodity" VALUES('FusionGasFuel', 'p', 'converted mystery gas to fuel', NULL); +REPLACE INTO "commodity" VALUES('GeoHyd', 'p', 'Hot water from geo', NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "cost_emission" VALUES('A',2025,'co2',1.99,'dollars','none'); +REPLACE INTO "cost_fixed" VALUES('A',2025,'EH',2025,3.3,'',''); +REPLACE INTO "cost_fixed" VALUES('A',2025,'EF',2025,2.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('A',2025,'EFL',2025,3.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'batt',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'EF',2025,2.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('A',2025,'bulbs',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'bulbs',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('A',2025,'heater',2025,2.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'heater',2025,2.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'GeoThermal',2025,6.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'GeoHeater',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('B',2025,'EH',2025,3.3,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('A',2025,'GeoThermal',2025,4.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('A',2025,'GeoHeater',2025,4.5,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','EF',2025,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','EH',2025,3.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','bulbs',2025,4.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','heater',2025,5.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','EF',2025,6.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','batt',2025,7.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','bulbs',2025,8.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','heater',2025,9.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','EFL',2025,2.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','GeoThermal',2025,3.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','GeoHeater',2025,4.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('B','EH',2025,3.3,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','GeoThermal',2025,5.6,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('A','GeoHeater',2025,4.2,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('A',2025,'EF',2025,9.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('A',2025,'EFL',2025,8.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('A',2025,'EH',2025,7.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('A',2025,'bulbs',2025,6.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('A',2025,'heater',2025,5.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('B',2025,'EF',2025,4.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('B',2025,'batt',2025,3.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('B',2025,'bulbs',2025,2.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('B',2025,'heater',2025,1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('A',2025,'RL',100.0,'',''); +REPLACE INTO "demand" VALUES('B',2025,'RL',100.0,NULL,NULL); +REPLACE INTO "demand" VALUES('A',2025,'RH',50.0,NULL,NULL); +REPLACE INTO "demand" VALUES('B',2025,'RH',50.0,NULL,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s1','d1','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s1','d2','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s2','d1','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s2','d2','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s1','d1','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s1','d2','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s2','d1','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s2','d2','RL',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s1','d1','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s2','d1','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s1','d1','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s2','d1','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s1','d2','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('A',2025,'s2','d2','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s1','d2','RH',0.25,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('B',2025,'s2','d2','RH',0.25,NULL); +REPLACE INTO "efficiency" VALUES('A', 'ELC', 'bulbs', 2025, 'RL', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'HYD', 'EH', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'HYD', 'EF', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'ELC', 'bulbs', 2025, 'RL', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'HYD', 'EH', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'ELC', 'batt', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'HYD', 'EF', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'earth', 'well', 2025, 'HYD', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'earth', 'well', 2025, 'HYD', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'earth', 'EFL', 2025, 'FusionGasFuel', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'FusionGasFuel', 'heater', 2025, 'RH', 0.9, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A-B', 'FusionGasFuel', 'FGF_pipe', 2025, 'FusionGasFuel', 0.95, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'FusionGasFuel', 'heater', 2025, 'RH', 0.9, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'GeoHyd', 'GeoHeater', 2025, 'RH', 9.80000000000000093e-01, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B', 'earth', 'GeoThermal', 2025, 'GeoHyd', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('B-A', 'FusionGasFuel', 'FGF_pipe', 2025, 'FusionGasFuel', 0.95, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'GeoHyd', 'GeoHeater', 2025, 'RH', 0.9, NULL, NULL); +REPLACE INTO "efficiency" VALUES('A', 'earth', 'GeoThermal', 2025, 'GeoHyd', 1.0, NULL, NULL); +REPLACE INTO "emission_activity" VALUES('A','co2','HYD','EH',2025,'ELC',0.02,NULL,NULL); +REPLACE INTO "emission_activity" VALUES('A','FusionGas','HYD','EF',2025,'ELC',-0.2,NULL,'emission_activity specifies emission activity coefficients (not efficiency values), negative coefficients represent emissions removal/capture, this coupling is essential for the linked tech constraint that converts CO2 from emissions commodity to physical commodity input.'); +REPLACE INTO "existing_capacity" VALUES('A','EH',2020,200.0,'things',NULL); +REPLACE INTO "lifetime_process" VALUES('B', 'EF', 2025, 200.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('A', 'EH', 60.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('B', 'bulbs', 100.0, NULL, 'super LED!'); +REPLACE INTO "limit_activity" VALUES('A',2025,'EF','ge',0.001,'PJ/CY','goofy units'); +REPLACE INTO "limit_activity" VALUES('B',2025,'EH','le',10000.0,'stuff',NULL); +REPLACE INTO "limit_activity" VALUES('A',2025,'EF','le',10000.0,'stuff',NULL); +REPLACE INTO "limit_activity" VALUES('A',2025,'A_tech_grp_1','ge',0.05,'',NULL); +REPLACE INTO "limit_activity" VALUES('A',2025,'A_tech_grp_1','le',10000.0,'',NULL); +REPLACE INTO "limit_capacity" VALUES('A',2025,'EH','ge',0.1,'',''); +REPLACE INTO "limit_capacity" VALUES('B',2025,'batt','ge',0.1,'',''); +REPLACE INTO "limit_capacity" VALUES('A',2025,'EH','le',20000.0,'',''); +REPLACE INTO "limit_capacity" VALUES('B',2025,'EH','le',20000.0,'',''); +REPLACE INTO "limit_capacity" VALUES('A',2025,'A_tech_grp_1','ge',0.2,'',NULL); +REPLACE INTO "limit_capacity" VALUES('A',2025,'A_tech_grp_1','le',6000.0,'',NULL); +REPLACE INTO "limit_emission" VALUES('A',2025,'co2','le',10000.0,'gulps',NULL); +REPLACE INTO "limit_new_capacity_share" VALUES('A',2025,'RPS_common','A_tech_grp_1','ge',0.0,''); +REPLACE INTO "limit_new_capacity_share" VALUES('global',2025,'RPS_common','A_tech_grp_1','le',1.0,''); +REPLACE INTO "limit_resource" VALUES('B','EF','le',9000.0,'clumps',NULL); +REPLACE INTO "limit_tech_input_split" VALUES('A',2025,'HYD','EH','ge',0.95,'95% HYD reqt. (other not specified...)'); +REPLACE INTO "limit_tech_output_split" VALUES('B',2025,'EH','ELC','ge',0.95,'95% ELC output (there are not others, this is a min)'); +REPLACE INTO "linked_tech" VALUES('A','EF','FusionGas','EFL',NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'EF', 2025, 57.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'EFL', 2025, 68.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'bulbs', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'EH', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'well', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'heater', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'GeoHeater', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A', 'GeoThermal', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'EF', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'bulbs', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'EH', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'batt', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'well', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'heater', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'GeoHeater', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B', 'GeoThermal', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('A-B', 'FGF_pipe', 2025, 10.0, NULL, NULL); +REPLACE INTO "loan_lifetime_process" VALUES('B-A', 'FGF_pipe', 2025, 10.0, NULL, NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',4.2000000000000004e-01,''); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "planning_reserve_margin" VALUES('A',0.05,NULL); +REPLACE INTO "ramp_down_hourly" VALUES('A','EH',0.05,NULL); +REPLACE INTO "ramp_down_hourly" VALUES('B','EH',0.05,NULL); +REPLACE INTO "ramp_up_hourly" VALUES('B','EH',0.05,NULL); +REPLACE INTO "ramp_up_hourly" VALUES('A','EH',0.05,NULL); +REPLACE INTO "region" VALUES('A','main region'); +REPLACE INTO "region" VALUES('B','just a 2nd region'); +REPLACE INTO "rps_requirement" VALUES('B',2025,'RPS_common',0.3,NULL); +REPLACE INTO "season_label" VALUES('s1',NULL); +REPLACE INTO "season_label" VALUES('s2',NULL); +REPLACE INTO "sector_label" VALUES('supply',NULL); +REPLACE INTO "sector_label" VALUES('electric',NULL); +REPLACE INTO "sector_label" VALUES('transport',NULL); +REPLACE INTO "sector_label" VALUES('commercial',NULL); +REPLACE INTO "sector_label" VALUES('residential',NULL); +REPLACE INTO "sector_label" VALUES('industrial',NULL); +REPLACE INTO "storage_duration" VALUES('B','batt',15.0,NULL); +REPLACE INTO "tech_group" VALUES('RPS_common',''); +REPLACE INTO "tech_group" VALUES('A_tech_grp_1','converted from old db'); +REPLACE INTO "tech_group_member" VALUES('RPS_common','EF'); +REPLACE INTO "tech_group_member" VALUES('A_tech_grp_1','EH'); +REPLACE INTO "tech_group_member" VALUES('A_tech_grp_1','EF'); +REPLACE INTO "technology" VALUES('well','p','supply','water','',0,0,0,0,0,0,0,0,'plain old water'); +REPLACE INTO "technology" VALUES('bulbs','p','residential','electric','',0,0,0,0,0,0,0,0,'residential lighting'); +REPLACE INTO "technology" VALUES('EH','pb','electric','hydro','',0,0,0,1,1,0,0,0,'hydro power electric plant'); +REPLACE INTO "technology" VALUES('batt','ps','electric','electric','',0,0,0,0,0,0,0,0,'big battery'); +REPLACE INTO "technology" VALUES('EF','p','electric','electric','',0,0,1,0,0,0,0,0,'fusion plant'); +REPLACE INTO "technology" VALUES('EFL','p','electric','electric','',0,0,0,0,0,1,0,0,'linked (to Fusion) producer'); +REPLACE INTO "technology" VALUES('heater','p','residential','electric','',0,0,0,0,0,0,0,0,'heater'); +REPLACE INTO "technology" VALUES('FGF_pipe','p','transport',NULL,'',0,0,0,0,0,0,1,0,'transportation line A->B'); +REPLACE INTO "technology" VALUES('GeoThermal','p','residential','hydro','',0,1,0,0,0,0,0,0,'geothermal hot water source'); +REPLACE INTO "technology" VALUES('GeoHeater','p','residential','hydro','',0,0,0,0,0,0,0,0,'geothermal heater from geo hyd'); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'d1'); +REPLACE INTO "time_of_day" VALUES(2,'d2'); +REPLACE INTO "time_period" VALUES(1,2020,'e'); +REPLACE INTO "time_period" VALUES(2,2025,'f'); +REPLACE INTO "time_period" VALUES(3,2030,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2025,1,'s1',NULL); +REPLACE INTO "time_season" VALUES(2025,2,'s2',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d1',0.25,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d2',0.25,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d1',0.25,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d2',0.25,NULL); diff --git a/tests/testing_data/seasonal_storage.sql b/tests/testing_data/seasonal_storage.sql index 990abbd2..70d88e5a 100644 --- a/tests/testing_data/seasonal_storage.sql +++ b/tests/testing_data/seasonal_storage.sql @@ -1,1138 +1,111 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'charge','a','generator',1.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'charge','b','generator',1.0,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'charge','c','generator',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'charge','d','generator',0.2,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'discharge','a','generator',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'discharge','b','generator',0.1,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'discharge','c','generator',0.01,NULL); -INSERT INTO "capacity_factor_tech" VALUES('region',2000,'discharge','d','generator',0.01,NULL); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "capacity_to_activity" VALUES('region','generator',8760.0,'MWh/MWy'); -INSERT INTO "capacity_to_activity" VALUES('region','dly_stor',8760.0,'MWh/MWy'); -INSERT INTO "capacity_to_activity" VALUES('region','seas_stor',8760.0,'MWh/MWy'); -INSERT INTO "capacity_to_activity" VALUES('region','demand',8760.0,'MWh/MWy'); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ethos','s',NULL); -INSERT INTO "commodity" VALUES('electricity','p',NULL); -INSERT INTO "commodity" VALUES('demand','d',NULL); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('region','generator',2000,1000.0,'',NULL); -INSERT INTO "cost_invest" VALUES('region','dly_stor',2000,1.0,'',NULL); -INSERT INTO "cost_invest" VALUES('region','seas_stor',2000,100.0,'',NULL); -INSERT INTO "cost_invest" VALUES('region','demand',2000,1.0,'',NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('region',2000,'generator',2000,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2000,'demand',2000,1.0,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('region',2000,'demand',8760.0,'MWh',NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'charge','a','demand',0.0,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'charge','b','demand',0.05,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'charge','c','demand',0.05,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'charge','d','demand',0.1,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'discharge','a','demand',0.0,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'discharge','b','demand',0.2,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'discharge','c','demand',0.2,NULL); -INSERT INTO "demand_specific_distribution" VALUES('region',2000,'discharge','d','demand',0.4,NULL); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('region','ethos','generator',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','electricity','dly_stor',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','electricity','seas_stor',2000,'electricity',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','electricity','demand',2000,'demand',1.0,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -INSERT INTO "limit_storage_level_fraction" VALUES('region',2000,'winter','b','seas_stor',2000,'e',0.5,NULL); -INSERT INTO "limit_storage_level_fraction" VALUES('region',2000,'charge','b','dly_stor',2000,'e',0.5,NULL); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('region',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('charge','non-sequential season - charging day'); -INSERT INTO "season_label" VALUES('discharge','non-sequential season - discharging day'); -INSERT INTO "season_label" VALUES('summer','sequential season - summer day'); -INSERT INTO "season_label" VALUES('sept_w1','sequential season - day in first week of September'); -INSERT INTO "season_label" VALUES('sept_w2','sequential season - day in second week of September'); -INSERT INTO "season_label" VALUES('sept_w3','sequential season - day in third week of September'); -INSERT INTO "season_label" VALUES('sept_w4','sequential season - day in fourth week of September'); -INSERT INTO "season_label" VALUES('sept_29th','sequential season - 29th of September'); -INSERT INTO "season_label" VALUES('sept_30th','sequential season - 30th of September'); -INSERT INTO "season_label" VALUES('winter','sequential season - winter day'); -INSERT INTO "season_label" VALUES('apr_w1','sequential season - day in first week of September'); -INSERT INTO "season_label" VALUES('apr_w2','sequential season - day in second week of September'); -INSERT INTO "season_label" VALUES('apr_w3','sequential season - day in third week of September'); -INSERT INTO "season_label" VALUES('apr_w4','sequential season - day in fourth week of September'); -INSERT INTO "season_label" VALUES('apr_29th','sequential season - 29th of April'); -INSERT INTO "season_label" VALUES('apr_30th','sequential season - 30th of April'); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "sector_label" VALUES('electricity',NULL); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "storage_duration" VALUES('region','dly_stor',4.0,NULL); -INSERT INTO "storage_duration" VALUES('region','seas_stor',8760.0,NULL); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('generator','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('dly_stor','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('seas_stor','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,1,NULL); -INSERT INTO "technology" VALUES('demand','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(0,'a'); -INSERT INTO "time_of_day" VALUES(1,'b'); -INSERT INTO "time_of_day" VALUES(2,'c'); -INSERT INTO "time_of_day" VALUES(3,'d'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(0,2000,'f'); -INSERT INTO "time_period" VALUES(1,2005,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2000,0,'charge',NULL); -INSERT INTO "time_season" VALUES(2000,1,'discharge',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); -INSERT INTO "time_season_sequential" VALUES(2000,1,'summer','charge',152.5,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,2,'sept_w1','discharge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,3,'sept_w2','charge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,4,'sept_w3','discharge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,5,'sept_w4','charge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,6,'sept_29th','discharge',1.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,7,'sept_30th','charge',1.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,8,'winter','discharge',152.5,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,9,'apr_w1','charge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,10,'apr_w2','discharge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,11,'apr_w3','charge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,12,'apr_w4','discharge',7.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,13,'apr_29th','charge',1.0,NULL); -INSERT INTO "time_season_sequential" VALUES(2000,14,'apr_30th','discharge',1.0,NULL); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2000,'charge','a',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'charge','b',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'charge','c',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'charge','d',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'discharge','a',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'discharge','b',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'discharge','c',0.125,NULL); -INSERT INTO "time_segment_fraction" VALUES(2000,'discharge','d',0.125,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); - -COMMIT; +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'charge','a','generator',1.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'charge','b','generator',1.0,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'charge','c','generator',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'charge','d','generator',0.2,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'discharge','a','generator',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'discharge','b','generator',0.1,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'discharge','c','generator',0.01,NULL); +REPLACE INTO "capacity_factor_tech" VALUES('region',2000,'discharge','d','generator',0.01,NULL); +REPLACE INTO "capacity_to_activity" VALUES('region', 'generator', 8760.0, NULL, 'MWh/MWy'); +REPLACE INTO "capacity_to_activity" VALUES('region', 'dly_stor', 8760.0, NULL, 'MWh/MWy'); +REPLACE INTO "capacity_to_activity" VALUES('region', 'seas_stor', 8760.0, NULL, 'MWh/MWy'); +REPLACE INTO "capacity_to_activity" VALUES('region', 'demand', 8760.0, NULL, 'MWh/MWy'); +REPLACE INTO "commodity" VALUES('ethos', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('electricity', 'p', NULL, NULL); +REPLACE INTO "commodity" VALUES('demand', 'd', NULL, NULL); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "cost_invest" VALUES('region','generator',2000,1000.0,'',NULL); +REPLACE INTO "cost_invest" VALUES('region','dly_stor',2000,1.0,'',NULL); +REPLACE INTO "cost_invest" VALUES('region','seas_stor',2000,100.0,'',NULL); +REPLACE INTO "cost_invest" VALUES('region','demand',2000,1.0,'',NULL); +REPLACE INTO "cost_variable" VALUES('region',2000,'generator',2000,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2000,'demand',2000,1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2000,'demand',8760.0,'MWh',NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'charge','a','demand',0.0,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'charge','b','demand',0.05,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'charge','c','demand',0.05,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'charge','d','demand',0.1,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'discharge','a','demand',0.0,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'discharge','b','demand',0.2,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'discharge','c','demand',0.2,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('region',2000,'discharge','d','demand',0.4,NULL); +REPLACE INTO "efficiency" VALUES('region', 'ethos', 'generator', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'electricity', 'dly_stor', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'electricity', 'seas_stor', 2000, 'electricity', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'electricity', 'demand', 2000, 'demand', 1.0, NULL, NULL); +REPLACE INTO "limit_storage_level_fraction" VALUES('region',2000,'winter','b','seas_stor',2000,'e',0.5,NULL); +REPLACE INTO "limit_storage_level_fraction" VALUES('region',2000,'charge','b','dly_stor',2000,'e',0.5,NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('region',NULL); +REPLACE INTO "season_label" VALUES('charge','non-sequential season - charging day'); +REPLACE INTO "season_label" VALUES('discharge','non-sequential season - discharging day'); +REPLACE INTO "season_label" VALUES('summer','sequential season - summer day'); +REPLACE INTO "season_label" VALUES('sept_w1','sequential season - day in first week of September'); +REPLACE INTO "season_label" VALUES('sept_w2','sequential season - day in second week of September'); +REPLACE INTO "season_label" VALUES('sept_w3','sequential season - day in third week of September'); +REPLACE INTO "season_label" VALUES('sept_w4','sequential season - day in fourth week of September'); +REPLACE INTO "season_label" VALUES('sept_29th','sequential season - 29th of September'); +REPLACE INTO "season_label" VALUES('sept_30th','sequential season - 30th of September'); +REPLACE INTO "season_label" VALUES('winter','sequential season - winter day'); +REPLACE INTO "season_label" VALUES('apr_w1','sequential season - day in first week of September'); +REPLACE INTO "season_label" VALUES('apr_w2','sequential season - day in second week of September'); +REPLACE INTO "season_label" VALUES('apr_w3','sequential season - day in third week of September'); +REPLACE INTO "season_label" VALUES('apr_w4','sequential season - day in fourth week of September'); +REPLACE INTO "season_label" VALUES('apr_29th','sequential season - 29th of April'); +REPLACE INTO "season_label" VALUES('apr_30th','sequential season - 30th of April'); +REPLACE INTO "sector_label" VALUES('electricity',NULL); +REPLACE INTO "storage_duration" VALUES('region','dly_stor',4.0,NULL); +REPLACE INTO "storage_duration" VALUES('region','seas_stor',8760.0,NULL); +REPLACE INTO "technology" VALUES('generator','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('dly_stor','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('seas_stor','ps','electricity',NULL,NULL,0,0,0,0,0,0,0,1,NULL); +REPLACE INTO "technology" VALUES('demand','p','electricity',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(0,'a'); +REPLACE INTO "time_of_day" VALUES(1,'b'); +REPLACE INTO "time_of_day" VALUES(2,'c'); +REPLACE INTO "time_of_day" VALUES(3,'d'); +REPLACE INTO "time_period" VALUES(0,2000,'f'); +REPLACE INTO "time_period" VALUES(1,2005,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2000,0,'charge',NULL); +REPLACE INTO "time_season" VALUES(2000,1,'discharge',NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,1,'summer','charge',152.5,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,2,'sept_w1','discharge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,3,'sept_w2','charge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,4,'sept_w3','discharge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,5,'sept_w4','charge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,6,'sept_29th','discharge',1.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,7,'sept_30th','charge',1.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,8,'winter','discharge',152.5,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,9,'apr_w1','charge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,10,'apr_w2','discharge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,11,'apr_w3','charge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,12,'apr_w4','discharge',7.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,13,'apr_29th','charge',1.0,NULL); +REPLACE INTO "time_season_sequential" VALUES(2000,14,'apr_30th','discharge',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'charge','a',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'charge','b',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'charge','c',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'charge','d',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'discharge','a',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'discharge','b',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'discharge','c',0.125,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'discharge','d',0.125,NULL); diff --git a/tests/testing_data/simple_linked_tech.sql b/tests/testing_data/simple_linked_tech.sql index bf28bd18..359f62ce 100644 --- a/tests/testing_data/simple_linked_tech.sql +++ b/tests/testing_data/simple_linked_tech.sql @@ -1,1089 +1,63 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ELC','d','electricity'); -INSERT INTO "commodity" VALUES('NGA','p','natural gas'); -INSERT INTO "commodity" VALUES('CO2','e','CO2 emission'); -INSERT INTO "commodity" VALUES('CO2_CAP','d','captured CO2'); -INSERT INTO "commodity" VALUES('ETHOS','s','source'); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -INSERT INTO "cost_emission" VALUES('linkville',2000,'CO2',2.0,NULL,NULL); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('linkville','PLANT',2000,100.0,'',''); -INSERT INTO "cost_invest" VALUES('linkville','CCS',2000,50.0,'',''); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('linkville',2000,'PLANT',2000,10.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('linkville',2000,'CCS',2000,10.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('linkville',2000,'FAKE_SOURCE',2000,0.0,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('linkville',2000,'CO2_CAP',1000.0,NULL,NULL); -INSERT INTO "demand" VALUES('linkville',2000,'ELC',10.0,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('linkville','ETHOS','MINE',2000,'NGA',1.0,''); -INSERT INTO "efficiency" VALUES('linkville','ETHOS','CCS',2000,'CO2_CAP',1.0,'capture eff'); -INSERT INTO "efficiency" VALUES('linkville','ETHOS','FAKE_SOURCE',2000,'CO2_CAP',1.0,''); -INSERT INTO "efficiency" VALUES('linkville','NGA','PLANT',2000,'ELC',0.5,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('linkville','CO2','NGA','PLANT',2000,'ELC',-3.0,'',''); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('linkville','CCS',100.0,''); -INSERT INTO "lifetime_tech" VALUES('linkville','PLANT',100.0,''); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -INSERT INTO "linked_tech" VALUES('linkville','PLANT','CO2','CCS',NULL); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,''); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('linkville',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('summer',NULL); -INSERT INTO "season_label" VALUES('winter',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "sector_label" VALUES('supply',NULL); -INSERT INTO "sector_label" VALUES('electric',NULL); -INSERT INTO "sector_label" VALUES('transport',NULL); -INSERT INTO "sector_label" VALUES('commercial',NULL); -INSERT INTO "sector_label" VALUES('residential',NULL); -INSERT INTO "sector_label" VALUES('industrial',NULL); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('PLANT','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('CCS','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('MINE','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('FAKE_SOURCE','p','supply',NULL,NULL,1,0,0,0,0,0,0,0,NULL); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'day'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(0,1995,'e'); -INSERT INTO "time_period" VALUES(1,2000,'f'); -INSERT INTO "time_period" VALUES(2,2005,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2000,1,'summer',NULL); -INSERT INTO "time_season" VALUES(2000,2,'winter',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2000,'summer','day',0.5,'# S-D'); -INSERT INTO "time_segment_fraction" VALUES(2000,'winter','day',0.5,'# W-D'); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "commodity" VALUES('ELC', 'd', 'electricity', NULL); +REPLACE INTO "commodity" VALUES('NGA', 'p', 'natural gas', NULL); +REPLACE INTO "commodity" VALUES('CO2', 'e', 'CO2 emission', NULL); +REPLACE INTO "commodity" VALUES('CO2_CAP', 'd', 'captured CO2', NULL); +REPLACE INTO "commodity" VALUES('ETHOS', 's', 'source', NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "cost_emission" VALUES('linkville',2000,'CO2',2.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('linkville','PLANT',2000,100.0,'',''); +REPLACE INTO "cost_invest" VALUES('linkville','CCS',2000,50.0,'',''); +REPLACE INTO "cost_variable" VALUES('linkville',2000,'PLANT',2000,10.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('linkville',2000,'CCS',2000,10.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('linkville',2000,'FAKE_SOURCE',2000,0.0,NULL,NULL); +REPLACE INTO "demand" VALUES('linkville',2000,'CO2_CAP',1000.0,NULL,NULL); +REPLACE INTO "demand" VALUES('linkville',2000,'ELC',10.0,NULL,NULL); +REPLACE INTO "efficiency" VALUES('linkville', 'ETHOS', 'MINE', 2000, 'NGA', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('linkville', 'ETHOS', 'CCS', 2000, 'CO2_CAP', 1.0, NULL, 'capture eff'); +REPLACE INTO "efficiency" VALUES('linkville', 'ETHOS', 'FAKE_SOURCE', 2000, 'CO2_CAP', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('linkville', 'NGA', 'PLANT', 2000, 'ELC', 0.5, NULL, NULL); +REPLACE INTO "emission_activity" VALUES('linkville','CO2','NGA','PLANT',2000,'ELC',-3.0,'',''); +REPLACE INTO "lifetime_tech" VALUES('linkville', 'CCS', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('linkville', 'PLANT', 100.0, NULL, ''); +REPLACE INTO "linked_tech" VALUES('linkville','PLANT','CO2','CCS',NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,''); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('linkville',NULL); +REPLACE INTO "season_label" VALUES('summer',NULL); +REPLACE INTO "season_label" VALUES('winter',NULL); +REPLACE INTO "sector_label" VALUES('supply',NULL); +REPLACE INTO "sector_label" VALUES('electric',NULL); +REPLACE INTO "sector_label" VALUES('transport',NULL); +REPLACE INTO "sector_label" VALUES('commercial',NULL); +REPLACE INTO "sector_label" VALUES('residential',NULL); +REPLACE INTO "sector_label" VALUES('industrial',NULL); +REPLACE INTO "technology" VALUES('PLANT','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('CCS','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('MINE','p','supply',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('FAKE_SOURCE','p','supply',NULL,NULL,1,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'day'); +REPLACE INTO "time_period" VALUES(0,1995,'e'); +REPLACE INTO "time_period" VALUES(1,2000,'f'); +REPLACE INTO "time_period" VALUES(2,2005,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2000,1,'summer',NULL); +REPLACE INTO "time_season" VALUES(2000,2,'winter',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','day',0.5,'# S-D'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','day',0.5,'# W-D'); diff --git a/tests/testing_data/storageville.sql b/tests/testing_data/storageville.sql index 127982bf..a592e10d 100644 --- a/tests/testing_data/storageville.sql +++ b/tests/testing_data/storageville.sql @@ -1,1116 +1,90 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "capacity_to_activity" VALUES('electricville','bulbs',1.0,''); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ELC','p','# electricity'); -INSERT INTO "commodity" VALUES('HYD','p','# water'); -INSERT INTO "commodity" VALUES('co2','e','#CO2 emissions'); -INSERT INTO "commodity" VALUES('RL','d','# residential lighting'); -INSERT INTO "commodity" VALUES('earth','p','# the source of stuff'); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_fixed" VALUES('electricville',2025,'EH',2025,100.0,'',''); -INSERT INTO "cost_fixed" VALUES('electricville',2025,'batt',2025,1.0,'',''); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('electricville','EH',2025,100.0,'',''); -INSERT INTO "cost_invest" VALUES('electricville','batt',2025,1.0,NULL,NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('electricville',2025,'EH',2025,1000.0,'',''); -INSERT INTO "cost_variable" VALUES('electricville',2025,'batt',2025,1.0,'',''); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('electricville',2025,'RL',100.0,'',''); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d1','RL',0.075,''); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d2','RL',0.075,''); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d3','RL',0.075,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d1','RL',0.075,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d2','RL',0.075,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d3','RL',0.075,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d4','RL',0.075,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d5','RL',0.2,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d4','RL',0.2,NULL); -INSERT INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d5','RL',0.075,NULL); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('electricville','HYD','EH',2025,'ELC',1.0,NULL); -INSERT INTO "efficiency" VALUES('electricville','ELC','bulbs',2025,'RL',1.0,NULL); -INSERT INTO "efficiency" VALUES('electricville','earth','well',2025,'HYD',1.0,'water source'); -INSERT INTO "efficiency" VALUES('electricville','ELC','batt',2025,'ELC',0.75,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('electricville','co2','HYD','EH',2025,'ELC',0.02,NULL,NULL); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('electricville','EH',60.0,''); -INSERT INTO "lifetime_tech" VALUES('electricville','bulbs',100.0,'super LED!'); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_capacity" VALUES('electricville',2025,'EH','ge',0.1,'',''); -INSERT INTO "limit_capacity" VALUES('electricville',2025,'batt','ge',0.1,'',''); -INSERT INTO "limit_capacity" VALUES('electricville',2025,'EH','le',200.0,'',''); -INSERT INTO "limit_capacity" VALUES('electricville',2025,'batt','le',100.0,'',''); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -INSERT INTO "limit_storage_level_fraction" VALUES('electricville',2025,'s1','d1','batt',2025,'e',0.5,NULL); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,''); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('electricville',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('s1',NULL); -INSERT INTO "season_label" VALUES('s2',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "sector_label" VALUES('supply',NULL); -INSERT INTO "sector_label" VALUES('electric',NULL); -INSERT INTO "sector_label" VALUES('transport',NULL); -INSERT INTO "sector_label" VALUES('commercial',NULL); -INSERT INTO "sector_label" VALUES('residential',NULL); -INSERT INTO "sector_label" VALUES('industrial',NULL); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "storage_duration" VALUES('electricville','batt',10.0,NULL); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('well','p','supply','water','',0,0,0,0,0,0,0,0,'plain old water'); -INSERT INTO "technology" VALUES('bulbs','p','residential','electric','',0,0,0,0,0,0,0,0,' residential lighting'); -INSERT INTO "technology" VALUES('EH','pb','electric','hydro','',0,0,0,0,0,0,0,0,'hydro power electric plant'); -INSERT INTO "technology" VALUES('batt','ps','electric','electric','',0,0,0,0,0,0,0,0,'big battery'); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'d1'); -INSERT INTO "time_of_day" VALUES(2,'d2'); -INSERT INTO "time_of_day" VALUES(3,'d3'); -INSERT INTO "time_of_day" VALUES(4,'d4'); -INSERT INTO "time_of_day" VALUES(5,'d5'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(1,2020,'e'); -INSERT INTO "time_period" VALUES(2,2025,'f'); -INSERT INTO "time_period" VALUES(3,2030,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2025,1,'s1',NULL); -INSERT INTO "time_season" VALUES(2025,2,'s2',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d3',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d1',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d2',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d3',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d1',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d2',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d4',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s1','d5',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d4',0.1,NULL); -INSERT INTO "time_segment_fraction" VALUES(2025,'s2','d5',0.1,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "capacity_to_activity" VALUES('electricville', 'bulbs', 1.0, NULL, ''); +REPLACE INTO "commodity" VALUES('ELC', 'p', '# electricity', NULL); +REPLACE INTO "commodity" VALUES('HYD', 'p', '# water', NULL); +REPLACE INTO "commodity" VALUES('co2', 'e', '#CO2 emissions', NULL); +REPLACE INTO "commodity" VALUES('RL', 'd', '# residential lighting', NULL); +REPLACE INTO "commodity" VALUES('earth', 'p', '# the source of stuff', NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "cost_fixed" VALUES('electricville',2025,'EH',2025,100.0,'',''); +REPLACE INTO "cost_fixed" VALUES('electricville',2025,'batt',2025,1.0,'',''); +REPLACE INTO "cost_invest" VALUES('electricville','EH',2025,100.0,'',''); +REPLACE INTO "cost_invest" VALUES('electricville','batt',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('electricville',2025,'EH',2025,1000.0,'',''); +REPLACE INTO "cost_variable" VALUES('electricville',2025,'batt',2025,1.0,'',''); +REPLACE INTO "demand" VALUES('electricville',2025,'RL',100.0,'',''); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d1','RL',0.075,''); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d2','RL',0.075,''); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d3','RL',0.075,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d1','RL',0.075,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d2','RL',0.075,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d3','RL',0.075,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d4','RL',0.075,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s1','d5','RL',0.2,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d4','RL',0.2,NULL); +REPLACE INTO "demand_specific_distribution" VALUES('electricville',2025,'s2','d5','RL',0.075,NULL); +REPLACE INTO "efficiency" VALUES('electricville', 'HYD', 'EH', 2025, 'ELC', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('electricville', 'ELC', 'bulbs', 2025, 'RL', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('electricville', 'earth', 'well', 2025, 'HYD', 1.0, NULL, 'water source'); +REPLACE INTO "efficiency" VALUES('electricville', 'ELC', 'batt', 2025, 'ELC', 0.75, NULL, NULL); +REPLACE INTO "emission_activity" VALUES('electricville','co2','HYD','EH',2025,'ELC',0.02,NULL,NULL); +REPLACE INTO "lifetime_tech" VALUES('electricville', 'EH', 60.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('electricville', 'bulbs', 100.0, NULL, 'super LED!'); +REPLACE INTO "limit_capacity" VALUES('electricville',2025,'EH','ge',0.1,'',''); +REPLACE INTO "limit_capacity" VALUES('electricville',2025,'batt','ge',0.1,'',''); +REPLACE INTO "limit_capacity" VALUES('electricville',2025,'EH','le',200.0,'',''); +REPLACE INTO "limit_capacity" VALUES('electricville',2025,'batt','le',100.0,'',''); +REPLACE INTO "limit_storage_level_fraction" VALUES('electricville',2025,'s1','d1','batt',2025,'e',0.5,NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,''); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('electricville',NULL); +REPLACE INTO "season_label" VALUES('s1',NULL); +REPLACE INTO "season_label" VALUES('s2',NULL); +REPLACE INTO "sector_label" VALUES('supply',NULL); +REPLACE INTO "sector_label" VALUES('electric',NULL); +REPLACE INTO "sector_label" VALUES('transport',NULL); +REPLACE INTO "sector_label" VALUES('commercial',NULL); +REPLACE INTO "sector_label" VALUES('residential',NULL); +REPLACE INTO "sector_label" VALUES('industrial',NULL); +REPLACE INTO "storage_duration" VALUES('electricville','batt',10.0,NULL); +REPLACE INTO "technology" VALUES('well','p','supply','water','',0,0,0,0,0,0,0,0,'plain old water'); +REPLACE INTO "technology" VALUES('bulbs','p','residential','electric','',0,0,0,0,0,0,0,0,' residential lighting'); +REPLACE INTO "technology" VALUES('EH','pb','electric','hydro','',0,0,0,0,0,0,0,0,'hydro power electric plant'); +REPLACE INTO "technology" VALUES('batt','ps','electric','electric','',0,0,0,0,0,0,0,0,'big battery'); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'d1'); +REPLACE INTO "time_of_day" VALUES(2,'d2'); +REPLACE INTO "time_of_day" VALUES(3,'d3'); +REPLACE INTO "time_of_day" VALUES(4,'d4'); +REPLACE INTO "time_of_day" VALUES(5,'d5'); +REPLACE INTO "time_period" VALUES(1,2020,'e'); +REPLACE INTO "time_period" VALUES(2,2025,'f'); +REPLACE INTO "time_period" VALUES(3,2030,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2025,1,'s1',NULL); +REPLACE INTO "time_season" VALUES(2025,2,'s2',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d3',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d1',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d2',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d3',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d1',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d2',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d4',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s1','d5',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d4',0.1,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s2','d5',0.1,NULL); diff --git a/tests/testing_data/survival_curve.sql b/tests/testing_data/survival_curve.sql index ea605511..de16ef19 100644 --- a/tests/testing_data/survival_curve.sql +++ b/tests/testing_data/survival_curve.sql @@ -1,1211 +1,185 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('source','s',NULL); -INSERT INTO "commodity" VALUES('demand','d',NULL); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_fixed" VALUES('region',2025,'tech_ancient',1994,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2025,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2030,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2035,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2040,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2025,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2030,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2035,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2040,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2045,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2030,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2035,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2040,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2045,'tech_future',2045,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_future',2050,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2035,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2040,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2045,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_future',2045,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2040,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2045,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2045,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_fixed" VALUES('region',2050,'tech_future',2030,1.0,NULL,NULL); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('region','tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','tech_future',2045,1.0,NULL,NULL); -INSERT INTO "cost_invest" VALUES('region','tech_future',2050,1.0,NULL,NULL); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('region',2025,'tech_ancient',1994,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2025,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2030,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2035,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2040,'tech_old',2010,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2025,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2030,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2035,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2040,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2045,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_current',2025,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2030,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2035,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2040,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2045,'tech_future',2045,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_future',2050,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2035,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2040,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2045,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_future',2045,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2040,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2045,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_future',2040,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2045,'tech_future',2030,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_future',2035,1.0,NULL,NULL); -INSERT INTO "cost_variable" VALUES('region',2050,'tech_future',2030,1.0,NULL,NULL); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('region',2025,'demand',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('region',2030,'demand',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('region',2035,'demand',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('region',2040,'demand',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('region',2045,'demand',1.0,NULL,NULL); -INSERT INTO "demand" VALUES('region',2050,'demand',1.0,NULL,NULL); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('region','source','tech_ancient',1994,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_old',2010,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_current',2025,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_future',2030,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_future',2035,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_future',2040,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_future',2045,'demand',1.0,NULL); -INSERT INTO "efficiency" VALUES('region','source','tech_future',2050,'demand',1.0,NULL); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "existing_capacity" VALUES('region','tech_ancient',1994,3.0,NULL,NULL); -INSERT INTO "existing_capacity" VALUES('region','tech_old',2010,0.7,NULL,NULL); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "lifetime_survival_curve" VALUES('region',1994,'tech_ancient',1994,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',1999,'tech_ancient',1994,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2004,'tech_ancient',1994,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2009,'tech_ancient',1994,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2014,'tech_ancient',1994,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2019,'tech_ancient',1994,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2029,'tech_ancient',1994,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2010,'tech_old',2010,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2015,'tech_old',2010,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2020,'tech_old',2010,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2025,'tech_old',2010,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2030,'tech_old',2010,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2035,'tech_old',2010,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_old',2010,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2025,'tech_current',2025,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2030,'tech_current',2025,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2035,'tech_current',2025,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2040,'tech_current',2025,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_current',2025,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_current',2025,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2060,'tech_current',2025,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2030,'tech_future',2030,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2035,'tech_future',2030,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2030,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2030,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2030,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2030,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2030,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2035,'tech_future',2035,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2035,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2035,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2035,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2035,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2035,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2035,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2040,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2040,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2040,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2040,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2040,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2040,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2075,'tech_future',2040,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2045,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2045,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2045,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2045,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2045,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2045,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2080,'tech_future',2045,0.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2050,1.0,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2050,0.97,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2050,8.80000000000000115e-01,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2050,0.62,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2050,0.27,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2075,'tech_future',2050,0.08,NULL); -INSERT INTO "lifetime_survival_curve" VALUES('region',2085,'tech_future',2050,0.0,NULL); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('region','tech_ancient',35.0,NULL); -INSERT INTO "lifetime_tech" VALUES('region','tech_old',35.0,NULL); -INSERT INTO "lifetime_tech" VALUES('region','tech_current',35.0,NULL); -INSERT INTO "lifetime_tech" VALUES('region','tech_future',35.0,NULL); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('region',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('s',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('tech_ancient','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('tech_old','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('tech_current','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -INSERT INTO "technology" VALUES('tech_future','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(0,'d'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(-2,1994,'e'); -INSERT INTO "time_period" VALUES(-1,2010,'e'); -INSERT INTO "time_period" VALUES(0,2025,'f'); -INSERT INTO "time_period" VALUES(1,2030,'f'); -INSERT INTO "time_period" VALUES(2,2035,'f'); -INSERT INTO "time_period" VALUES(3,2040,'f'); -INSERT INTO "time_period" VALUES(4,2045,'f'); -INSERT INTO "time_period" VALUES(5,2050,'f'); -INSERT INTO "time_period" VALUES(6,2055,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2025,0,'s',NULL); -INSERT INTO "time_season" VALUES(2030,1,'s',NULL); -INSERT INTO "time_season" VALUES(2035,2,'s',NULL); -INSERT INTO "time_season" VALUES(2040,3,'s',NULL); -INSERT INTO "time_season" VALUES(2045,4,'s',NULL); -INSERT INTO "time_season" VALUES(2050,5,'s',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2025,'s','d',1.0,NULL); -INSERT INTO "time_segment_fraction" VALUES(2030,'s','d',1.0,NULL); -INSERT INTO "time_segment_fraction" VALUES(2035,'s','d',1.0,NULL); -INSERT INTO "time_segment_fraction" VALUES(2040,'s','d',1.0,NULL); -INSERT INTO "time_segment_fraction" VALUES(2045,'s','d',1.0,NULL); -INSERT INTO "time_segment_fraction" VALUES(2050,'s','d',1.0,NULL); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "commodity" VALUES('source', 's', NULL, NULL); +REPLACE INTO "commodity" VALUES('demand', 'd', NULL, NULL); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "cost_fixed" VALUES('region',2025,'tech_ancient',1994,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2025,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2030,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2035,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2040,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2025,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2030,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2035,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2040,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2045,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2030,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2035,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2040,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2045,'tech_future',2045,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_future',2050,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2035,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2040,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2045,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_future',2045,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2040,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2045,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2045,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_fixed" VALUES('region',2050,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_future',2045,1.0,NULL,NULL); +REPLACE INTO "cost_invest" VALUES('region','tech_future',2050,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2025,'tech_ancient',1994,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2025,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2030,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2035,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2040,'tech_old',2010,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2025,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2030,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2035,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2040,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2045,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_current',2025,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2030,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2035,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2040,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2045,'tech_future',2045,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_future',2050,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2035,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2040,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2045,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_future',2045,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2040,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2045,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_future',2040,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2045,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_future',2035,1.0,NULL,NULL); +REPLACE INTO "cost_variable" VALUES('region',2050,'tech_future',2030,1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2025,'demand',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2030,'demand',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2035,'demand',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2040,'demand',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2045,'demand',1.0,NULL,NULL); +REPLACE INTO "demand" VALUES('region',2050,'demand',1.0,NULL,NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_ancient', 1994, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_old', 2010, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_current', 2025, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_future', 2030, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_future', 2035, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_future', 2040, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_future', 2045, 'demand', 1.0, NULL, NULL); +REPLACE INTO "efficiency" VALUES('region', 'source', 'tech_future', 2050, 'demand', 1.0, NULL, NULL); +REPLACE INTO "existing_capacity" VALUES('region','tech_ancient',1994,3.0,NULL,NULL); +REPLACE INTO "existing_capacity" VALUES('region','tech_old',2010,0.7,NULL,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',1994,'tech_ancient',1994,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',1999,'tech_ancient',1994,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2004,'tech_ancient',1994,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2009,'tech_ancient',1994,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2014,'tech_ancient',1994,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2019,'tech_ancient',1994,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2029,'tech_ancient',1994,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2010,'tech_old',2010,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2015,'tech_old',2010,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2020,'tech_old',2010,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2025,'tech_old',2010,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2030,'tech_old',2010,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2035,'tech_old',2010,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_old',2010,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2025,'tech_current',2025,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2030,'tech_current',2025,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2035,'tech_current',2025,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2040,'tech_current',2025,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_current',2025,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_current',2025,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2060,'tech_current',2025,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2030,'tech_future',2030,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2035,'tech_future',2030,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2030,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2030,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2030,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2030,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2030,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2035,'tech_future',2035,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2035,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2035,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2035,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2035,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2035,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2035,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2040,'tech_future',2040,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2040,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2040,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2040,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2040,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2040,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2075,'tech_future',2040,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2045,'tech_future',2045,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2045,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2045,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2045,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2045,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2045,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2080,'tech_future',2045,0.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2050,'tech_future',2050,1.0,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2055,'tech_future',2050,0.97,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2060,'tech_future',2050,8.80000000000000115e-01,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2065,'tech_future',2050,0.62,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2070,'tech_future',2050,0.27,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2075,'tech_future',2050,0.08,NULL); +REPLACE INTO "lifetime_survival_curve" VALUES('region',2085,'tech_future',2050,0.0,NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'tech_ancient', 35.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'tech_old', 35.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'tech_current', 35.0, NULL, NULL); +REPLACE INTO "lifetime_tech" VALUES('region', 'tech_future', 35.0, NULL, NULL); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,'Discount Rate for future costs'); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('region',NULL); +REPLACE INTO "season_label" VALUES('s',NULL); +REPLACE INTO "technology" VALUES('tech_ancient','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('tech_old','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('tech_current','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology" VALUES('tech_future','p','energy',NULL,NULL,0,0,0,0,0,0,0,0,NULL); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(0,'d'); +REPLACE INTO "time_period" VALUES(-2,1994,'e'); +REPLACE INTO "time_period" VALUES(-1,2010,'e'); +REPLACE INTO "time_period" VALUES(0,2025,'f'); +REPLACE INTO "time_period" VALUES(1,2030,'f'); +REPLACE INTO "time_period" VALUES(2,2035,'f'); +REPLACE INTO "time_period" VALUES(3,2040,'f'); +REPLACE INTO "time_period" VALUES(4,2045,'f'); +REPLACE INTO "time_period" VALUES(5,2050,'f'); +REPLACE INTO "time_period" VALUES(6,2055,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2025,0,'s',NULL); +REPLACE INTO "time_season" VALUES(2030,1,'s',NULL); +REPLACE INTO "time_season" VALUES(2035,2,'s',NULL); +REPLACE INTO "time_season" VALUES(2040,3,'s',NULL); +REPLACE INTO "time_season" VALUES(2045,4,'s',NULL); +REPLACE INTO "time_season" VALUES(2050,5,'s',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2025,'s','d',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2030,'s','d',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2035,'s','d',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2040,'s','d',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2045,'s','d',1.0,NULL); +REPLACE INTO "time_segment_fraction" VALUES(2050,'s','d',1.0,NULL); diff --git a/tests/testing_data/test_system.sql b/tests/testing_data/test_system.sql index 89b181fc..fff350f1 100644 --- a/tests/testing_data/test_system.sql +++ b/tests/testing_data/test_system.sql @@ -1,1583 +1,557 @@ -BEGIN TRANSACTION; -CREATE TABLE capacity_credit -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - credit REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage), - CHECK (credit >= 0 AND credit <= 1) -); -CREATE TABLE capacity_factor_process -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE capacity_factor_tech -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, tech), - CHECK (factor >= 0 AND factor <= 1) -); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'spring','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'summer','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'fall','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'winter','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2020,'winter','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'spring','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'summer','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'fall','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'winter','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2020,'winter','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'spring','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'summer','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'fall','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'winter','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2025,'winter','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'spring','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'summer','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'fall','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'winter','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2025,'winter','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'spring','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'summer','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'fall','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'winter','day','E_SOLPV',0.6,''); -INSERT INTO "capacity_factor_tech" VALUES('R1',2030,'winter','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'spring','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'spring','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'summer','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'summer','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'fall','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'fall','night','E_SOLPV',0.0,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'winter','day','E_SOLPV',0.48,''); -INSERT INTO "capacity_factor_tech" VALUES('R2',2030,'winter','night','E_SOLPV',0.0,''); -CREATE TABLE capacity_to_activity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - c2a REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "capacity_to_activity" VALUES('R1','S_IMPETH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','S_IMPOIL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','S_IMPNG',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','S_IMPURN',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','S_OILREF',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','E_NGCC',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R1','E_SOLPV',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R1','E_BATT',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R1','E_NUCLEAR',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R1','T_BLND',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','T_DSL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','T_GSL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','T_EV',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','R_EH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1','R_NGH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','S_IMPETH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','S_IMPOIL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','S_IMPNG',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','S_IMPURN',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','S_OILREF',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','E_NGCC',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R2','E_SOLPV',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R2','E_BATT',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R2','E_NUCLEAR',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R2','T_BLND',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','T_DSL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','T_GSL',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','T_EV',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','R_EH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R2','R_NGH',1.0,''); -INSERT INTO "capacity_to_activity" VALUES('R1-R2','E_TRANS',31.54,''); -INSERT INTO "capacity_to_activity" VALUES('R2-R1','E_TRANS',31.54,''); -CREATE TABLE commodity -( - name TEXT - PRIMARY KEY, - flag TEXT - REFERENCES commodity_type (label), - description TEXT -); -INSERT INTO "commodity" VALUES('ethos','s','dummy commodity to supply inputs (makes graph easier to read)'); -INSERT INTO "commodity" VALUES('OIL','p','crude oil'); -INSERT INTO "commodity" VALUES('NG','p','natural gas'); -INSERT INTO "commodity" VALUES('URN','p','uranium'); -INSERT INTO "commodity" VALUES('ETH','p','ethanol'); -INSERT INTO "commodity" VALUES('SOL','p','solar insolation'); -INSERT INTO "commodity" VALUES('GSL','p','gasoline'); -INSERT INTO "commodity" VALUES('DSL','p','diesel'); -INSERT INTO "commodity" VALUES('ELC','p','electricity'); -INSERT INTO "commodity" VALUES('E10','p','gasoline blend with 10% ethanol'); -INSERT INTO "commodity" VALUES('VMT','d','travel demand for vehicle-miles traveled'); -INSERT INTO "commodity" VALUES('RH','d','demand for residential heating'); -INSERT INTO "commodity" VALUES('CO2','e','CO2 emissions commodity'); -CREATE TABLE commodity_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "commodity_type" VALUES('w','waste commodity'); -INSERT INTO "commodity_type" VALUES('wa','waste annual commodity'); -INSERT INTO "commodity_type" VALUES('wp','waste physical commodity'); -INSERT INTO "commodity_type" VALUES('a','annual commodity'); -INSERT INTO "commodity_type" VALUES('s','source commodity'); -INSERT INTO "commodity_type" VALUES('p','physical commodity'); -INSERT INTO "commodity_type" VALUES('e','emissions commodity'); -INSERT INTO "commodity_type" VALUES('d','demand commodity'); -CREATE TABLE construction_input -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage) -); -CREATE TABLE cost_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT NOT NULL - REFERENCES commodity (name), - cost REAL NOT NULL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm) -); -CREATE TABLE cost_fixed -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_fixed" VALUES('R1',2020,'E_NGCC',2020,30.6,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_NGCC',2020,9.78,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_NGCC',2025,9.78,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2020,9.78,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2025,9.78,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2030,9.78,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2020,'E_SOLPV',2020,10.4,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_SOLPV',2020,10.4,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_SOLPV',2025,9.1,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2020,10.4,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2025,9.1,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2030,9.1,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2020,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_NUCLEAR',2025,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2025,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2030,9.809999999999998e+01,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2020,'E_BATT',2020,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_BATT',2020,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2025,'E_BATT',2025,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2020,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2025,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2030,7.05,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2020,'E_NGCC',2020,24.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_NGCC',2020,7.824,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_NGCC',2025,7.824,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2020,7.824,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2025,7.824,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2030,7.824,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2020,'E_SOLPV',2020,8.32,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_SOLPV',2020,8.32,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_SOLPV',2025,7.28,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2020,8.32,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2025,7.28,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2030,7.28,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2020,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_NUCLEAR',2025,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2025,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2030,78.48,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2020,'E_BATT',2020,5.64,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_BATT',2020,5.64,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2025,'E_BATT',2025,5.64,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2020,5.64,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2025,5.64,'$M/GWyr',''); -INSERT INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2030,5.64,'$M/GWyr',''); -CREATE TABLE cost_invest -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "cost_invest" VALUES('R1','E_NGCC',2020,1050.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_NGCC',2025,1025.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_NGCC',2030,1000.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_SOLPV',2020,900.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_SOLPV',2025,560.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_SOLPV',2030,800.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_NUCLEAR',2020,6145.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_NUCLEAR',2025,6045.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_NUCLEAR',2030,5890.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_BATT',2020,1150.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_BATT',2025,720.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','E_BATT',2030,480.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R1','T_GSL',2020,2570.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_GSL',2025,2700.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_GSL',2030,2700.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_DSL',2020,2715.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_DSL',2025,2810.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_DSL',2030,2810.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_EV',2020,3100.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_EV',2025,3030.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','T_EV',2030,2925.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_EH',2020,4.1,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_EH',2025,4.1,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_EH',2030,4.1,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_NGH',2020,7.6,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_NGH',2025,7.6,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R1','R_NGH',2030,7.6,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','E_NGCC',2020,840.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_NGCC',2025,820.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_NGCC',2030,800.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_SOLPV',2020,720.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_SOLPV',2025,448.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_SOLPV',2030,640.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_NUCLEAR',2020,4916.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_NUCLEAR',2025,4836.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_NUCLEAR',2030,4712.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_BATT',2020,920.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_BATT',2025,576.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','E_BATT',2030,384.0,'$M/GW',''); -INSERT INTO "cost_invest" VALUES('R2','T_GSL',2020,2056.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_GSL',2025,2160.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_GSL',2030,2160.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_DSL',2020,2172.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_DSL',2025,2248.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_DSL',2030,2248.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_EV',2020,2480.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_EV',2025,2424.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','T_EV',2030,2340.0,'$/bvmt/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_EH',2020,3.28,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_EH',2025,3.28,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_EH',2030,3.28,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_NGH',2020,6.08,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_NGH',2025,6.08,'$/PJ/yr',''); -INSERT INTO "cost_invest" VALUES('R2','R_NGH',2030,6.08,'$/PJ/yr',''); -CREATE TABLE cost_variable -( - region TEXT NOT NULL, - period INTEGER NOT NULL - REFERENCES time_period (period), - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - cost REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -INSERT INTO "cost_variable" VALUES('R1',2020,'S_IMPETH',2020,32.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'S_IMPETH',2020,32.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'S_IMPETH',2020,32.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2020,'S_IMPOIL',2020,20.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'S_IMPOIL',2020,20.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'S_IMPOIL',2020,20.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2020,'S_IMPNG',2020,4.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'S_IMPNG',2020,4.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'S_IMPNG',2020,4.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2020,'S_OILREF',2020,1.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'S_OILREF',2020,1.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'S_OILREF',2020,1.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2020,'E_NGCC',2020,1.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'E_NGCC',2020,1.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'E_NGCC',2025,1.7,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2020,1.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2025,1.7,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2030,1.8,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2020,'E_NUCLEAR',2020,0.24,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'E_NUCLEAR',2020,0.24,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2025,'E_NUCLEAR',2025,0.25,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2020,0.24,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2025,0.25,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2030,0.26,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'S_IMPETH',2020,25.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'S_IMPETH',2020,25.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'S_IMPETH',2020,25.6,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'S_IMPOIL',2020,16.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'S_IMPOIL',2020,16.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'S_IMPOIL',2020,16.0,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'S_IMPNG',2020,3.2,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'S_IMPNG',2020,3.2,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'S_IMPNG',2020,3.2,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'S_OILREF',2020,0.8,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'S_OILREF',2020,0.8,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'S_OILREF',2020,0.8,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'E_NGCC',2020,1.28,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'E_NGCC',2020,1.28,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'E_NGCC',2025,1.36,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2020,1.28,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2025,1.36,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2030,1.44,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2020,'E_NUCLEAR',2020,0.192,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'E_NUCLEAR',2020,0.192,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2025,'E_NUCLEAR',2025,0.2,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2020,0.192,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2025,0.2,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2030,2.08000000000000018e-01,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1-R2',2020,'E_TRANS',2015,0.1,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1-R2',2025,'E_TRANS',2015,0.1,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R1-R2',2030,'E_TRANS',2015,0.1,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2-R1',2020,'E_TRANS',2015,0.1,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2-R1',2025,'E_TRANS',2015,0.1,'$M/PJ',''); -INSERT INTO "cost_variable" VALUES('R2-R1',2030,'E_TRANS',2015,0.1,'$M/PJ',''); -CREATE TABLE demand -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - commodity TEXT - REFERENCES commodity (name), - demand REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, commodity) -); -INSERT INTO "demand" VALUES('R1',2020,'RH',30.0,'',''); -INSERT INTO "demand" VALUES('R1',2025,'RH',33.0,'',''); -INSERT INTO "demand" VALUES('R1',2030,'RH',36.0,'',''); -INSERT INTO "demand" VALUES('R1',2020,'VMT',84.0,'',''); -INSERT INTO "demand" VALUES('R1',2025,'VMT',91.0,'',''); -INSERT INTO "demand" VALUES('R1',2030,'VMT',98.0,'',''); -INSERT INTO "demand" VALUES('R2',2020,'RH',70.0,'',''); -INSERT INTO "demand" VALUES('R2',2025,'RH',77.0,'',''); -INSERT INTO "demand" VALUES('R2',2030,'RH',84.0,'',''); -INSERT INTO "demand" VALUES('R2',2020,'VMT',36.0,'',''); -INSERT INTO "demand" VALUES('R2',2025,'VMT',39.0,'',''); -INSERT INTO "demand" VALUES('R2',2030,'VMT',42.0,'',''); -CREATE TABLE demand_specific_distribution -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - demand_name TEXT - REFERENCES commodity (name), - dsd REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, demand_name), - CHECK (dsd >= 0 AND dsd <= 1) -); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2020,'winter','night','RH',0.4,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2020,'winter','night','RH',0.4,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2025,'winter','night','RH',0.4,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2025,'winter','night','RH',0.4,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R1',2030,'winter','night','RH',0.4,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'spring','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'spring','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'summer','day','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'summer','night','RH',0.0,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'fall','day','RH',0.05,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'fall','night','RH',0.1,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'winter','day','RH',0.3,''); -INSERT INTO "demand_specific_distribution" VALUES('R2',2030,'winter','night','RH',0.4,''); -CREATE TABLE efficiency -( - region TEXT, - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -INSERT INTO "efficiency" VALUES('R1','ethos','S_IMPETH',2020,'ETH',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ethos','S_IMPOIL',2020,'OIL',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ethos','S_IMPNG',2020,'NG',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ethos','S_IMPURN',2020,'URN',1.0,''); -INSERT INTO "efficiency" VALUES('R1','OIL','S_OILREF',2020,'GSL',1.0,''); -INSERT INTO "efficiency" VALUES('R1','OIL','S_OILREF',2020,'DSL',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ETH','T_BLND',2020,'E10',1.0,''); -INSERT INTO "efficiency" VALUES('R1','GSL','T_BLND',2020,'E10',1.0,''); -INSERT INTO "efficiency" VALUES('R1','NG','E_NGCC',2020,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R1','NG','E_NGCC',2025,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R1','NG','E_NGCC',2030,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R1','SOL','E_SOLPV',2020,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R1','SOL','E_SOLPV',2025,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R1','SOL','E_SOLPV',2030,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R1','URN','E_NUCLEAR',2015,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R1','URN','E_NUCLEAR',2020,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R1','URN','E_NUCLEAR',2025,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R1','URN','E_NUCLEAR',2030,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R1','ELC','E_BATT',2020,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R1','ELC','E_BATT',2025,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R1','ELC','E_BATT',2030,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R1','E10','T_GSL',2020,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R1','E10','T_GSL',2025,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R1','E10','T_GSL',2030,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R1','DSL','T_DSL',2020,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R1','DSL','T_DSL',2025,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R1','DSL','T_DSL',2030,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R1','ELC','T_EV',2020,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R1','ELC','T_EV',2025,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R1','ELC','T_EV',2030,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R1','ELC','R_EH',2020,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ELC','R_EH',2025,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R1','ELC','R_EH',2030,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R1','NG','R_NGH',2020,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R1','NG','R_NGH',2025,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R1','NG','R_NGH',2030,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R2','ethos','S_IMPETH',2020,'ETH',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ethos','S_IMPOIL',2020,'OIL',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ethos','S_IMPNG',2020,'NG',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ethos','S_IMPURN',2020,'URN',1.0,''); -INSERT INTO "efficiency" VALUES('R2','OIL','S_OILREF',2020,'GSL',1.0,''); -INSERT INTO "efficiency" VALUES('R2','OIL','S_OILREF',2020,'DSL',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ETH','T_BLND',2020,'E10',1.0,''); -INSERT INTO "efficiency" VALUES('R2','GSL','T_BLND',2020,'E10',1.0,''); -INSERT INTO "efficiency" VALUES('R2','NG','E_NGCC',2020,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R2','NG','E_NGCC',2025,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R2','NG','E_NGCC',2030,'ELC',0.55,''); -INSERT INTO "efficiency" VALUES('R2','SOL','E_SOLPV',2020,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R2','SOL','E_SOLPV',2025,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R2','SOL','E_SOLPV',2030,'ELC',1.0,''); -INSERT INTO "efficiency" VALUES('R2','URN','E_NUCLEAR',2015,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R2','URN','E_NUCLEAR',2020,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R2','URN','E_NUCLEAR',2025,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R2','URN','E_NUCLEAR',2030,'ELC',0.4,''); -INSERT INTO "efficiency" VALUES('R2','ELC','E_BATT',2020,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R2','ELC','E_BATT',2025,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R2','ELC','E_BATT',2030,'ELC',0.85,''); -INSERT INTO "efficiency" VALUES('R2','E10','T_GSL',2020,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R2','E10','T_GSL',2025,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R2','E10','T_GSL',2030,'VMT',0.25,''); -INSERT INTO "efficiency" VALUES('R2','DSL','T_DSL',2020,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R2','DSL','T_DSL',2025,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R2','DSL','T_DSL',2030,'VMT',0.3,''); -INSERT INTO "efficiency" VALUES('R2','ELC','T_EV',2020,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R2','ELC','T_EV',2025,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R2','ELC','T_EV',2030,'VMT',0.89,''); -INSERT INTO "efficiency" VALUES('R2','ELC','R_EH',2020,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ELC','R_EH',2025,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R2','ELC','R_EH',2030,'RH',1.0,''); -INSERT INTO "efficiency" VALUES('R2','NG','R_NGH',2020,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R2','NG','R_NGH',2025,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R2','NG','R_NGH',2030,'RH',0.85,''); -INSERT INTO "efficiency" VALUES('R1-R2','ELC','E_TRANS',2015,'ELC',0.9,''); -INSERT INTO "efficiency" VALUES('R2-R1','ELC','E_TRANS',2015,'ELC',0.9,''); -CREATE TABLE efficiency_variable -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - efficiency REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tod, input_comm, tech, vintage, output_comm), - CHECK (efficiency > 0) -); -CREATE TABLE emission_activity -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, input_comm, tech, vintage, output_comm) -); -INSERT INTO "emission_activity" VALUES('R1','CO2','ethos','S_IMPNG',2020,'NG',5.029999999999999e+01,'kT/PJ','taken from MIT Energy Fact Sheet'); -INSERT INTO "emission_activity" VALUES('R1','CO2','OIL','S_OILREF',2020,'GSL',67.2,'kT/PJ','taken from MIT Energy Fact Sheet'); -INSERT INTO "emission_activity" VALUES('R1','CO2','OIL','S_OILREF',2020,'DSL',69.4,'kT/PJ','taken from MIT Energy Fact Sheet'); -INSERT INTO "emission_activity" VALUES('R2','CO2','ethos','S_IMPNG',2020,'NG',5.029999999999999e+01,'kT/PJ','taken from MIT Energy Fact Sheet'); -INSERT INTO "emission_activity" VALUES('R2','CO2','OIL','S_OILREF',2020,'GSL',67.2,'kT/PJ','taken from MIT Energy Fact Sheet'); -INSERT INTO "emission_activity" VALUES('R2','CO2','OIL','S_OILREF',2020,'DSL',69.4,'kT/PJ','taken from MIT Energy Fact Sheet'); -CREATE TABLE emission_embodied -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE emission_end_of_life -( - region TEXT, - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, emis_comm, tech, vintage) -); -CREATE TABLE end_of_life_output -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage, output_comm) -); -CREATE TABLE existing_capacity -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -INSERT INTO "existing_capacity" VALUES('R1','E_NUCLEAR',2015,0.07,'GW',''); -INSERT INTO "existing_capacity" VALUES('R2','E_NUCLEAR',2015,0.03,'GW',''); -INSERT INTO "existing_capacity" VALUES('R1-R2','E_TRANS',2015,10.0,'GW',''); -INSERT INTO "existing_capacity" VALUES('R2-R1','E_TRANS',2015,10.0,'GW',''); -CREATE TABLE lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE lifetime_survival_curve -( - region TEXT NOT NULL, - period INTEGER NOT NULL, - tech TEXT NOT NULL - REFERENCES technology (tech), - vintage INTEGER NOT NULL - REFERENCES time_period (period), - fraction REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, vintage) -); -CREATE TABLE lifetime_tech -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "lifetime_tech" VALUES('R1','S_IMPETH',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','S_IMPOIL',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','S_IMPNG',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','S_IMPURN',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','S_OILREF',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','E_NGCC',30.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','E_SOLPV',30.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','E_BATT',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','E_NUCLEAR',50.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','T_BLND',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','T_DSL',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','T_GSL',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','T_EV',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','R_EH',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R1','R_NGH',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','S_IMPETH',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','S_IMPOIL',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','S_IMPNG',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','S_IMPURN',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','S_OILREF',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','E_NGCC',30.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','E_SOLPV',30.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','E_BATT',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','E_NUCLEAR',50.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','T_BLND',100.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','T_DSL',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','T_GSL',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','T_EV',12.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','R_EH',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R2','R_NGH',20.0,''); -INSERT INTO "lifetime_tech" VALUES('R1-R2','E_TRANS',30.0,''); -INSERT INTO "lifetime_tech" VALUES('R2-R1','E_TRANS',30.0,''); -CREATE TABLE limit_activity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - activity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -INSERT INTO "limit_activity" VALUES('R1',2020,'T_GSL','ge',35.0,'',''); -INSERT INTO "limit_activity" VALUES('R1',2025,'T_GSL','ge',35.0,'',''); -INSERT INTO "limit_activity" VALUES('R1',2030,'T_GSL','ge',35.0,'',''); -INSERT INTO "limit_activity" VALUES('R2',2020,'T_GSL','ge',15.0,'',''); -INSERT INTO "limit_activity" VALUES('R2',2025,'T_GSL','ge',15.0,'',''); -INSERT INTO "limit_activity" VALUES('R2',2030,'T_GSL','ge',15.0,'',''); -CREATE TABLE limit_activity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_annual_capacity_factor -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE limit_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - capacity REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_degrowth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_degrowth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_emission -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - value REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, emis_comm, operator) -); -INSERT INTO "limit_emission" VALUES('R1',2020,'CO2','le',25000.0,'kT CO2',''); -INSERT INTO "limit_emission" VALUES('R1',2025,'CO2','le',24000.0,'kT CO2',''); -INSERT INTO "limit_emission" VALUES('R1',2030,'CO2','le',23000.0,'kT CO2',''); -INSERT INTO "limit_emission" VALUES('global',2020,'CO2','le',37500.0,'kT CO2',''); -INSERT INTO "limit_emission" VALUES('global',2025,'CO2','le',36000.0,'kT CO2',''); -INSERT INTO "limit_emission" VALUES('global',2030,'CO2','le',34500.0,'kT CO2',''); -CREATE TABLE limit_growth_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_growth_new_capacity_delta -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - rate REAL NOT NULL DEFAULT 0, - seed REAL NOT NULL DEFAULT 0, - seed_units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - new_cap REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, period, tech_or_group, operator) -); -CREATE TABLE limit_new_capacity_share -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - sub_group TEXT, - super_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - share REAL, - notes TEXT, - PRIMARY KEY (region, period, sub_group, super_group, operator) -); -CREATE TABLE limit_resource -( - region TEXT, - tech_or_group TEXT, - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - cum_act REAL, - units TEXT, - notes TEXT, - PRIMARY KEY (region, tech_or_group, operator) -); -CREATE TABLE limit_seasonal_capacity_factor -( - region TEXT - REFERENCES region (region), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - factor REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tech, operator) -); -CREATE TABLE limit_storage_level_fraction -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - fraction REAL, - notes TEXT, - PRIMARY KEY(region, period, season, tod, tech, vintage, operator) -); -INSERT INTO "limit_storage_level_fraction" VALUES('R1',2025,'winter','day','E_BATT',2025,'e',0.5,''); -INSERT INTO "limit_storage_level_fraction" VALUES('R2',2020,'summer','day','E_BATT',2020,'e',0.5,''); -CREATE TABLE limit_tech_input_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -INSERT INTO "limit_tech_input_split" VALUES('R1',2020,'GSL','T_BLND','ge',0.9,''); -INSERT INTO "limit_tech_input_split" VALUES('R1',2020,'ETH','T_BLND','ge',0.1,''); -INSERT INTO "limit_tech_input_split" VALUES('R1',2025,'GSL','T_BLND','ge',0.9,''); -INSERT INTO "limit_tech_input_split" VALUES('R1',2025,'ETH','T_BLND','ge',0.1,''); -INSERT INTO "limit_tech_input_split" VALUES('R1',2030,'GSL','T_BLND','ge',0.9,''); -INSERT INTO "limit_tech_input_split" VALUES('R1',2030,'ETH','T_BLND','ge',0.1,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2020,'GSL','T_BLND','ge',0.72,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2020,'ETH','T_BLND','ge',0.08,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2025,'GSL','T_BLND','ge',0.72,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2025,'ETH','T_BLND','ge',0.08,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2030,'GSL','T_BLND','ge',0.72,''); -INSERT INTO "limit_tech_input_split" VALUES('R2',2030,'ETH','T_BLND','ge',0.08,''); -CREATE TABLE limit_tech_input_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, input_comm, tech, operator) -); -CREATE TABLE limit_tech_output_split -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -INSERT INTO "limit_tech_output_split" VALUES('R1',2020,'S_OILREF','GSL','ge',0.9,''); -INSERT INTO "limit_tech_output_split" VALUES('R1',2020,'S_OILREF','DSL','ge',0.1,''); -INSERT INTO "limit_tech_output_split" VALUES('R1',2025,'S_OILREF','GSL','ge',0.9,''); -INSERT INTO "limit_tech_output_split" VALUES('R1',2025,'S_OILREF','DSL','ge',0.1,''); -INSERT INTO "limit_tech_output_split" VALUES('R1',2030,'S_OILREF','GSL','ge',0.9,''); -INSERT INTO "limit_tech_output_split" VALUES('R1',2030,'S_OILREF','DSL','ge',0.1,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2020,'S_OILREF','GSL','ge',0.72,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2020,'S_OILREF','DSL','ge',0.08,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2025,'S_OILREF','GSL','ge',0.72,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2025,'S_OILREF','DSL','ge',0.08,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2030,'S_OILREF','GSL','ge',0.72,''); -INSERT INTO "limit_tech_output_split" VALUES('R2',2030,'S_OILREF','DSL','ge',0.08,''); -CREATE TABLE limit_tech_output_split_annual -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - output_comm TEXT - REFERENCES commodity (name), - operator TEXT NOT NULL DEFAULT "le" - REFERENCES operator (operator), - proportion REAL, - notes TEXT, - PRIMARY KEY (region, period, tech, output_comm, operator) -); -CREATE TABLE linked_tech -( - primary_region TEXT, - primary_tech TEXT - REFERENCES technology (tech), - emis_comm TEXT - REFERENCES commodity (name), - driven_tech TEXT - REFERENCES technology (tech), - notes TEXT, - PRIMARY KEY (primary_region, primary_tech, emis_comm) -); -CREATE TABLE loan_lifetime_process -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - lifetime REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE loan_rate -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech, vintage) -); -CREATE TABLE metadata -( - element TEXT, - value INT, - notes TEXT, - PRIMARY KEY (element) -); -INSERT INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); -INSERT INTO "metadata" VALUES('DB_MAJOR',4,''); -INSERT INTO "metadata" VALUES('DB_MINOR',0,''); -CREATE TABLE metadata_real -( - element TEXT, - value REAL, - notes TEXT, - - PRIMARY KEY (element) -); -INSERT INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); -INSERT INTO "metadata_real" VALUES('global_discount_rate',0.05,''); -CREATE TABLE myopic_efficiency -( - base_year integer, - region text, - input_comm text, - tech text, - vintage integer, - output_comm text, - efficiency real, - lifetime integer, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (region, input_comm, tech, vintage, output_comm) -); -CREATE TABLE operator -( - operator TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "operator" VALUES('e','equal to'); -INSERT INTO "operator" VALUES('le','less than or equal to'); -INSERT INTO "operator" VALUES('ge','greater than or equal to'); -CREATE TABLE output_built_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, tech, vintage) -); -CREATE TABLE output_cost -( - scenario TEXT, - region TEXT, - sector TEXT REFERENCES sector_label (sector), - period INTEGER REFERENCES time_period (period), - tech TEXT REFERENCES technology (tech), - vintage INTEGER REFERENCES time_period (period), - d_invest REAL, - d_fixed REAL, - d_var REAL, - d_emiss REAL, - invest REAL, - fixed REAL, - var REAL, - emiss REAL, - PRIMARY KEY (scenario, region, period, tech, vintage), - FOREIGN KEY (vintage) REFERENCES time_period (period), - FOREIGN KEY (tech) REFERENCES technology (tech) -); -CREATE TABLE output_curtailment -( - scenario TEXT, - region TEXT, - sector TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES time_period (period), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - curtailment REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_dual_variable -( - scenario TEXT, - constraint_name TEXT, - dual REAL, - PRIMARY KEY (constraint_name, scenario) -); -CREATE TABLE output_emission -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - emis_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - emission REAL, - PRIMARY KEY (region, scenario, period, emis_comm, tech, vintage) -); -CREATE TABLE output_flow_in -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - input_comm TEXT - REFERENCES commodity (name), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - output_comm TEXT - REFERENCES commodity (name), - flow REAL, - PRIMARY KEY (region, scenario, period, season, tod, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_flow_out_summary -( - scenario TEXT NOT NULL, - region TEXT NOT NULL, - sector TEXT, - period INTEGER, - input_comm TEXT NOT NULL, - tech TEXT NOT NULL, - vintage INTEGER, - output_comm TEXT NOT NULL, - flow REAL NOT NULL, - - FOREIGN KEY (tech) REFERENCES technology (tech), - PRIMARY KEY (scenario, region, period, input_comm, tech, vintage, output_comm) -); -CREATE TABLE output_net_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - capacity REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_objective -( - scenario TEXT, - objective_name TEXT, - total_system_cost REAL -); -CREATE TABLE output_retired_capacity -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - cap_eol REAL, - cap_early REAL, - PRIMARY KEY (region, scenario, period, tech, vintage) -); -CREATE TABLE output_storage_level -( - scenario TEXT, - region TEXT, - sector TEXT - REFERENCES sector_label (sector), - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER - REFERENCES time_period (period), - level REAL, - PRIMARY KEY (scenario, region, period, season, tod, tech, vintage) -); -CREATE TABLE planning_reserve_margin -( - region TEXT - PRIMARY KEY - REFERENCES region (region), - margin REAL, - notes TEXT -); -CREATE TABLE ramp_down_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE ramp_up_hourly -( - region TEXT, - tech TEXT - REFERENCES technology (tech), - rate REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -CREATE TABLE region -( - region TEXT - PRIMARY KEY, - notes TEXT -); -INSERT INTO "region" VALUES('R1',NULL); -INSERT INTO "region" VALUES('R2',NULL); -CREATE TABLE reserve_capacity_derate -( - region TEXT, - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tech TEXT - REFERENCES technology (tech), - vintage INTEGER, - factor REAL, - notes TEXT, - PRIMARY KEY (region, period, season, tech, vintage), - CHECK (factor >= 0 AND factor <= 1) -); -CREATE TABLE rps_requirement -( - region TEXT NOT NULL - REFERENCES region (region), - period INTEGER NOT NULL - REFERENCES time_period (period), - tech_group TEXT NOT NULL - REFERENCES tech_group (group_name), - requirement REAL NOT NULL, - notes TEXT -); -CREATE TABLE season_label -( - season TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "season_label" VALUES('summer',NULL); -INSERT INTO "season_label" VALUES('fall',NULL); -INSERT INTO "season_label" VALUES('winter',NULL); -INSERT INTO "season_label" VALUES('spring',NULL); -CREATE TABLE sector_label -( - sector TEXT PRIMARY KEY, - notes TEXT -); -INSERT INTO "sector_label" VALUES('supply',NULL); -INSERT INTO "sector_label" VALUES('electric',NULL); -INSERT INTO "sector_label" VALUES('transport',NULL); -INSERT INTO "sector_label" VALUES('commercial',NULL); -INSERT INTO "sector_label" VALUES('residential',NULL); -INSERT INTO "sector_label" VALUES('industrial',NULL); -CREATE TABLE storage_duration -( - region TEXT, - tech TEXT, - duration REAL, - notes TEXT, - PRIMARY KEY (region, tech) -); -INSERT INTO "storage_duration" VALUES('R1','E_BATT',8.0,'8-hour duration specified as fraction of a day'); -INSERT INTO "storage_duration" VALUES('R2','E_BATT',8.0,'8-hour duration specified as fraction of a day'); -CREATE TABLE tech_group -( - group_name TEXT - PRIMARY KEY, - notes TEXT -); -CREATE TABLE tech_group_member -( - group_name TEXT - REFERENCES tech_group (group_name), - tech TEXT - REFERENCES technology (tech), - PRIMARY KEY (group_name, tech) -); -CREATE TABLE technology -( - tech TEXT NOT NULL PRIMARY KEY, - flag TEXT NOT NULL, - sector TEXT, - category TEXT, - sub_category TEXT, - unlim_cap INTEGER NOT NULL DEFAULT 0, - annual INTEGER NOT NULL DEFAULT 0, - reserve INTEGER NOT NULL DEFAULT 0, - curtail INTEGER NOT NULL DEFAULT 0, - retire INTEGER NOT NULL DEFAULT 0, - flex INTEGER NOT NULL DEFAULT 0, - exchange INTEGER NOT NULL DEFAULT 0, - seas_stor INTEGER NOT NULL DEFAULT 0, - description TEXT, - FOREIGN KEY (flag) REFERENCES technology_type (label) -); -INSERT INTO "technology" VALUES('S_IMPETH','p','supply','','',1,0,0,0,0,0,0,0,' imported ethanol'); -INSERT INTO "technology" VALUES('S_IMPOIL','p','supply','','',1,0,0,0,0,0,0,0,' imported crude oil'); -INSERT INTO "technology" VALUES('S_IMPNG','p','supply','','',1,0,0,0,0,0,0,0,' imported natural gas'); -INSERT INTO "technology" VALUES('S_IMPURN','p','supply','','',1,0,0,0,0,0,0,0,' imported uranium'); -INSERT INTO "technology" VALUES('S_OILREF','p','supply','','',0,0,0,1,0,0,0,0,' crude oil refinery'); -INSERT INTO "technology" VALUES('E_NGCC','p','electric','','',0,0,0,0,0,0,0,0,' natural gas combined-cycle'); -INSERT INTO "technology" VALUES('E_SOLPV','p','electric','','',0,0,0,0,0,0,0,0,' solar photovoltaic'); -INSERT INTO "technology" VALUES('E_BATT','ps','electric','','',0,0,0,0,0,0,0,0,' lithium-ion battery'); -INSERT INTO "technology" VALUES('E_NUCLEAR','pb','electric','','',0,0,0,0,0,0,0,0,' nuclear power plant'); -INSERT INTO "technology" VALUES('T_BLND','p','transport','','',0,0,0,0,0,0,0,0,'ethanol - gasoline blending process'); -INSERT INTO "technology" VALUES('T_DSL','p','transport','','',0,0,0,0,0,0,0,0,'diesel vehicle'); -INSERT INTO "technology" VALUES('T_GSL','p','transport','','',0,0,0,0,0,0,0,0,'gasoline vehicle'); -INSERT INTO "technology" VALUES('T_EV','p','transport','','',0,0,0,0,0,0,0,0,'electric vehicle'); -INSERT INTO "technology" VALUES('R_EH','p','residential','','',0,0,0,0,0,0,0,0,' electric residential heating'); -INSERT INTO "technology" VALUES('R_NGH','p','residential','','',0,0,0,0,0,0,0,0,' natural gas residential heating'); -INSERT INTO "technology" VALUES('E_TRANS','p','electric','','',0,0,0,0,0,0,1,0,'electric transmission'); -CREATE TABLE technology_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "technology_type" VALUES('p','production technology'); -INSERT INTO "technology_type" VALUES('pb','baseload production technology'); -INSERT INTO "technology_type" VALUES('ps','storage production technology'); -CREATE TABLE time_of_day -( - sequence INTEGER UNIQUE, - tod TEXT - PRIMARY KEY -); -INSERT INTO "time_of_day" VALUES(1,'day'); -INSERT INTO "time_of_day" VALUES(2,'night'); -CREATE TABLE time_period -( - sequence INTEGER UNIQUE, - period INTEGER - PRIMARY KEY, - flag TEXT - REFERENCES time_period_type (label) -); -INSERT INTO "time_period" VALUES(1,2015,'e'); -INSERT INTO "time_period" VALUES(2,2020,'f'); -INSERT INTO "time_period" VALUES(3,2025,'f'); -INSERT INTO "time_period" VALUES(4,2030,'f'); -INSERT INTO "time_period" VALUES(5,2035,'f'); -CREATE TABLE time_period_type -( - label TEXT - PRIMARY KEY, - description TEXT -); -INSERT INTO "time_period_type" VALUES('e','existing vintages'); -INSERT INTO "time_period_type" VALUES('f','future'); -CREATE TABLE time_season -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - season TEXT REFERENCES season_label(season), - notes TEXT, - PRIMARY KEY (period, sequence, season) -); -INSERT INTO "time_season" VALUES(2020,1,'spring',NULL); -INSERT INTO "time_season" VALUES(2020,2,'summer',NULL); -INSERT INTO "time_season" VALUES(2020,3,'fall',NULL); -INSERT INTO "time_season" VALUES(2020,4,'winter',NULL); -INSERT INTO "time_season" VALUES(2025,1,'spring',NULL); -INSERT INTO "time_season" VALUES(2025,2,'summer',NULL); -INSERT INTO "time_season" VALUES(2025,3,'fall',NULL); -INSERT INTO "time_season" VALUES(2025,4,'winter',NULL); -INSERT INTO "time_season" VALUES(2030,1,'spring',NULL); -INSERT INTO "time_season" VALUES(2030,2,'summer',NULL); -INSERT INTO "time_season" VALUES(2030,3,'fall',NULL); -INSERT INTO "time_season" VALUES(2030,4,'winter',NULL); - -CREATE TABLE time_season_sequential -( - period INTEGER REFERENCES time_period (period), - sequence INTEGER, - seas_seq TEXT, - season TEXT REFERENCES season_label(season), - num_days REAL NOT NULL, - notes TEXT, - PRIMARY KEY (period, sequence, seas_seq, season), - CHECK (num_days > 0) -); - -CREATE TABLE time_segment_fraction -( - period INTEGER - REFERENCES time_period (period), - season TEXT - REFERENCES season_label (season), - tod TEXT - REFERENCES time_of_day (tod), - segment_fraction REAL, - notes TEXT, - PRIMARY KEY (period, season, tod), - CHECK (segment_fraction >= 0 AND segment_fraction <= 1) -); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','day',0.125,'Spring - Day'); -INSERT INTO "time_segment_fraction" VALUES(2020,'spring','night',0.125,'Spring - Night'); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','day',0.125,'Summer - Day'); -INSERT INTO "time_segment_fraction" VALUES(2020,'summer','night',0.125,'Summer - Night'); -INSERT INTO "time_segment_fraction" VALUES(2020,'fall','day',0.125,'Fall - Day'); -INSERT INTO "time_segment_fraction" VALUES(2020,'fall','night',0.125,'Fall - Night'); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','day',0.125,'Winter - Day'); -INSERT INTO "time_segment_fraction" VALUES(2020,'winter','night',0.125,'Winter - Night'); -INSERT INTO "time_segment_fraction" VALUES(2025,'spring','day',0.125,'Spring - Day'); -INSERT INTO "time_segment_fraction" VALUES(2025,'spring','night',0.125,'Spring - Night'); -INSERT INTO "time_segment_fraction" VALUES(2025,'summer','day',0.125,'Summer - Day'); -INSERT INTO "time_segment_fraction" VALUES(2025,'summer','night',0.125,'Summer - Night'); -INSERT INTO "time_segment_fraction" VALUES(2025,'fall','day',0.125,'Fall - Day'); -INSERT INTO "time_segment_fraction" VALUES(2025,'fall','night',0.125,'Fall - Night'); -INSERT INTO "time_segment_fraction" VALUES(2025,'winter','day',0.125,'Winter - Day'); -INSERT INTO "time_segment_fraction" VALUES(2025,'winter','night',0.125,'Winter - Night'); -INSERT INTO "time_segment_fraction" VALUES(2030,'spring','day',0.125,'Spring - Day'); -INSERT INTO "time_segment_fraction" VALUES(2030,'spring','night',0.125,'Spring - Night'); -INSERT INTO "time_segment_fraction" VALUES(2030,'summer','day',0.125,'Summer - Day'); -INSERT INTO "time_segment_fraction" VALUES(2030,'summer','night',0.125,'Summer - Night'); -INSERT INTO "time_segment_fraction" VALUES(2030,'fall','day',0.125,'Fall - Day'); -INSERT INTO "time_segment_fraction" VALUES(2030,'fall','night',0.125,'Fall - Night'); -INSERT INTO "time_segment_fraction" VALUES(2030,'winter','day',0.125,'Winter - Day'); -INSERT INTO "time_segment_fraction" VALUES(2030,'winter','night',0.125,'Winter - Night'); -CREATE INDEX region_tech_vintage ON myopic_efficiency (region, tech, vintage); -COMMIT; +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'spring','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'summer','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'fall','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'winter','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2020,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'spring','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'summer','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'fall','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'winter','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2020,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'spring','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'summer','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'fall','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'winter','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2025,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'spring','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'summer','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'fall','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'winter','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2025,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'spring','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'summer','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'fall','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'winter','day','E_SOLPV',0.6,''); +REPLACE INTO "capacity_factor_tech" VALUES('R1',2030,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'spring','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'spring','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'summer','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'summer','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'fall','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'fall','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'winter','day','E_SOLPV',0.48,''); +REPLACE INTO "capacity_factor_tech" VALUES('R2',2030,'winter','night','E_SOLPV',0.0,''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'S_IMPETH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'S_IMPOIL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'S_IMPNG', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'S_IMPURN', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'S_OILREF', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'E_NGCC', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'E_SOLPV', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'E_BATT', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'E_NUCLEAR', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'T_BLND', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'T_DSL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'T_GSL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'T_EV', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'R_EH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1', 'R_NGH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'S_IMPETH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'S_IMPOIL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'S_IMPNG', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'S_IMPURN', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'S_OILREF', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'E_NGCC', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'E_SOLPV', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'E_BATT', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'E_NUCLEAR', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'T_BLND', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'T_DSL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'T_GSL', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'T_EV', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'R_EH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2', 'R_NGH', 1.0, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R1-R2', 'E_TRANS', 31.54, NULL, ''); +REPLACE INTO "capacity_to_activity" VALUES('R2-R1', 'E_TRANS', 31.54, NULL, ''); +REPLACE INTO "commodity" VALUES('ethos', 's', 'dummy commodity to supply inputs (makes graph easier to read)', NULL); +REPLACE INTO "commodity" VALUES('OIL', 'p', 'crude oil', NULL); +REPLACE INTO "commodity" VALUES('NG', 'p', 'natural gas', NULL); +REPLACE INTO "commodity" VALUES('URN', 'p', 'uranium', NULL); +REPLACE INTO "commodity" VALUES('ETH', 'p', 'ethanol', NULL); +REPLACE INTO "commodity" VALUES('SOL', 'p', 'solar insolation', NULL); +REPLACE INTO "commodity" VALUES('GSL', 'p', 'gasoline', NULL); +REPLACE INTO "commodity" VALUES('DSL', 'p', 'diesel', NULL); +REPLACE INTO "commodity" VALUES('ELC', 'p', 'electricity', NULL); +REPLACE INTO "commodity" VALUES('E10', 'p', 'gasoline blend with 10% ethanol', NULL); +REPLACE INTO "commodity" VALUES('VMT', 'd', 'travel demand for vehicle-miles traveled', NULL); +REPLACE INTO "commodity" VALUES('RH', 'd', 'demand for residential heating', NULL); +REPLACE INTO "commodity" VALUES('CO2', 'e', 'CO2 emissions commodity', NULL); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "cost_fixed" VALUES('R1',2020,'E_NGCC',2020,30.6,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_NGCC',2020,9.78,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_NGCC',2025,9.78,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2020,9.78,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2025,9.78,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NGCC',2030,9.78,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2020,'E_SOLPV',2020,10.4,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_SOLPV',2020,10.4,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_SOLPV',2025,9.1,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2020,10.4,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2025,9.1,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_SOLPV',2030,9.1,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2020,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_NUCLEAR',2025,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2020,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2025,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_NUCLEAR',2030,9.809999999999998e+01,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2020,'E_BATT',2020,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_BATT',2020,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2025,'E_BATT',2025,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2020,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2025,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R1',2030,'E_BATT',2030,7.05,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2020,'E_NGCC',2020,24.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_NGCC',2020,7.824,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_NGCC',2025,7.824,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2020,7.824,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2025,7.824,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NGCC',2030,7.824,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2020,'E_SOLPV',2020,8.32,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_SOLPV',2020,8.32,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_SOLPV',2025,7.28,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2020,8.32,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2025,7.28,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_SOLPV',2030,7.28,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2020,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_NUCLEAR',2025,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2020,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2025,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_NUCLEAR',2030,78.48,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2020,'E_BATT',2020,5.64,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_BATT',2020,5.64,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2025,'E_BATT',2025,5.64,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2020,5.64,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2025,5.64,'$M/GWyr',''); +REPLACE INTO "cost_fixed" VALUES('R2',2030,'E_BATT',2030,5.64,'$M/GWyr',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NGCC',2020,1050.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NGCC',2025,1025.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NGCC',2030,1000.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_SOLPV',2020,900.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_SOLPV',2025,560.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_SOLPV',2030,800.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NUCLEAR',2020,6145.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NUCLEAR',2025,6045.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_NUCLEAR',2030,5890.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_BATT',2020,1150.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_BATT',2025,720.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','E_BATT',2030,480.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R1','T_GSL',2020,2570.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_GSL',2025,2700.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_GSL',2030,2700.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_DSL',2020,2715.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_DSL',2025,2810.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_DSL',2030,2810.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_EV',2020,3100.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_EV',2025,3030.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','T_EV',2030,2925.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_EH',2020,4.1,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_EH',2025,4.1,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_EH',2030,4.1,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_NGH',2020,7.6,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_NGH',2025,7.6,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R1','R_NGH',2030,7.6,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NGCC',2020,840.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NGCC',2025,820.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NGCC',2030,800.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_SOLPV',2020,720.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_SOLPV',2025,448.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_SOLPV',2030,640.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NUCLEAR',2020,4916.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NUCLEAR',2025,4836.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_NUCLEAR',2030,4712.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_BATT',2020,920.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_BATT',2025,576.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','E_BATT',2030,384.0,'$M/GW',''); +REPLACE INTO "cost_invest" VALUES('R2','T_GSL',2020,2056.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_GSL',2025,2160.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_GSL',2030,2160.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_DSL',2020,2172.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_DSL',2025,2248.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_DSL',2030,2248.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_EV',2020,2480.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_EV',2025,2424.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','T_EV',2030,2340.0,'$/bvmt/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_EH',2020,3.28,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_EH',2025,3.28,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_EH',2030,3.28,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_NGH',2020,6.08,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_NGH',2025,6.08,'$/PJ/yr',''); +REPLACE INTO "cost_invest" VALUES('R2','R_NGH',2030,6.08,'$/PJ/yr',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'S_IMPETH',2020,32.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'S_IMPETH',2020,32.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'S_IMPETH',2020,32.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'S_IMPOIL',2020,20.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'S_IMPOIL',2020,20.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'S_IMPOIL',2020,20.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'S_IMPNG',2020,4.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'S_IMPNG',2020,4.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'S_IMPNG',2020,4.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'S_OILREF',2020,1.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'S_OILREF',2020,1.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'S_OILREF',2020,1.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'E_NGCC',2020,1.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'E_NGCC',2020,1.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'E_NGCC',2025,1.7,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2020,1.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2025,1.7,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NGCC',2030,1.8,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2020,'E_NUCLEAR',2020,0.24,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'E_NUCLEAR',2020,0.24,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2025,'E_NUCLEAR',2025,0.25,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2020,0.24,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2025,0.25,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1',2030,'E_NUCLEAR',2030,0.26,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'S_IMPETH',2020,25.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'S_IMPETH',2020,25.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'S_IMPETH',2020,25.6,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'S_IMPOIL',2020,16.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'S_IMPOIL',2020,16.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'S_IMPOIL',2020,16.0,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'S_IMPNG',2020,3.2,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'S_IMPNG',2020,3.2,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'S_IMPNG',2020,3.2,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'S_OILREF',2020,0.8,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'S_OILREF',2020,0.8,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'S_OILREF',2020,0.8,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'E_NGCC',2020,1.28,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'E_NGCC',2020,1.28,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'E_NGCC',2025,1.36,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2020,1.28,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2025,1.36,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NGCC',2030,1.44,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2020,'E_NUCLEAR',2020,0.192,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'E_NUCLEAR',2020,0.192,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2025,'E_NUCLEAR',2025,0.2,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2020,0.192,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2025,0.2,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2',2030,'E_NUCLEAR',2030,2.08000000000000018e-01,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1-R2',2020,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1-R2',2025,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R1-R2',2030,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2-R1',2020,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2-R1',2025,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "cost_variable" VALUES('R2-R1',2030,'E_TRANS',2015,0.1,'$M/PJ',''); +REPLACE INTO "demand" VALUES('R1',2020,'RH',30.0,'',''); +REPLACE INTO "demand" VALUES('R1',2025,'RH',33.0,'',''); +REPLACE INTO "demand" VALUES('R1',2030,'RH',36.0,'',''); +REPLACE INTO "demand" VALUES('R1',2020,'VMT',84.0,'',''); +REPLACE INTO "demand" VALUES('R1',2025,'VMT',91.0,'',''); +REPLACE INTO "demand" VALUES('R1',2030,'VMT',98.0,'',''); +REPLACE INTO "demand" VALUES('R2',2020,'RH',70.0,'',''); +REPLACE INTO "demand" VALUES('R2',2025,'RH',77.0,'',''); +REPLACE INTO "demand" VALUES('R2',2030,'RH',84.0,'',''); +REPLACE INTO "demand" VALUES('R2',2020,'VMT',36.0,'',''); +REPLACE INTO "demand" VALUES('R2',2025,'VMT',39.0,'',''); +REPLACE INTO "demand" VALUES('R2',2030,'VMT',42.0,'',''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2020,'winter','night','RH',0.4,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2020,'winter','night','RH',0.4,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2025,'winter','night','RH',0.4,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2025,'winter','night','RH',0.4,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R1',2030,'winter','night','RH',0.4,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'spring','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'spring','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'summer','day','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'summer','night','RH',0.0,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'fall','day','RH',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'fall','night','RH',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'winter','day','RH',0.3,''); +REPLACE INTO "demand_specific_distribution" VALUES('R2',2030,'winter','night','RH',0.4,''); +REPLACE INTO "efficiency" VALUES('R1', 'ethos', 'S_IMPETH', 2020, 'ETH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ethos', 'S_IMPOIL', 2020, 'OIL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ethos', 'S_IMPNG', 2020, 'NG', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ethos', 'S_IMPURN', 2020, 'URN', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'OIL', 'S_OILREF', 2020, 'GSL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'OIL', 'S_OILREF', 2020, 'DSL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ETH', 'T_BLND', 2020, 'E10', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'GSL', 'T_BLND', 2020, 'E10', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'E_NGCC', 2020, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'E_NGCC', 2025, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'E_NGCC', 2030, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'SOL', 'E_SOLPV', 2020, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'SOL', 'E_SOLPV', 2025, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'SOL', 'E_SOLPV', 2030, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'URN', 'E_NUCLEAR', 2015, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'URN', 'E_NUCLEAR', 2020, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'URN', 'E_NUCLEAR', 2025, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'URN', 'E_NUCLEAR', 2030, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'E_BATT', 2020, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'E_BATT', 2025, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'E_BATT', 2030, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'E10', 'T_GSL', 2020, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'E10', 'T_GSL', 2025, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'E10', 'T_GSL', 2030, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'DSL', 'T_DSL', 2020, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'DSL', 'T_DSL', 2025, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'DSL', 'T_DSL', 2030, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'T_EV', 2020, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'T_EV', 2025, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'T_EV', 2030, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'R_EH', 2020, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'R_EH', 2025, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'ELC', 'R_EH', 2030, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'R_NGH', 2020, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'R_NGH', 2025, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1', 'NG', 'R_NGH', 2030, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ethos', 'S_IMPETH', 2020, 'ETH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ethos', 'S_IMPOIL', 2020, 'OIL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ethos', 'S_IMPNG', 2020, 'NG', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ethos', 'S_IMPURN', 2020, 'URN', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'OIL', 'S_OILREF', 2020, 'GSL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'OIL', 'S_OILREF', 2020, 'DSL', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ETH', 'T_BLND', 2020, 'E10', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'GSL', 'T_BLND', 2020, 'E10', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'E_NGCC', 2020, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'E_NGCC', 2025, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'E_NGCC', 2030, 'ELC', 0.55, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'SOL', 'E_SOLPV', 2020, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'SOL', 'E_SOLPV', 2025, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'SOL', 'E_SOLPV', 2030, 'ELC', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'URN', 'E_NUCLEAR', 2015, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'URN', 'E_NUCLEAR', 2020, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'URN', 'E_NUCLEAR', 2025, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'URN', 'E_NUCLEAR', 2030, 'ELC', 0.4, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'E_BATT', 2020, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'E_BATT', 2025, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'E_BATT', 2030, 'ELC', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'E10', 'T_GSL', 2020, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'E10', 'T_GSL', 2025, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'E10', 'T_GSL', 2030, 'VMT', 0.25, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'DSL', 'T_DSL', 2020, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'DSL', 'T_DSL', 2025, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'DSL', 'T_DSL', 2030, 'VMT', 0.3, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'T_EV', 2020, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'T_EV', 2025, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'T_EV', 2030, 'VMT', 0.89, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'R_EH', 2020, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'R_EH', 2025, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'ELC', 'R_EH', 2030, 'RH', 1.0, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'R_NGH', 2020, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'R_NGH', 2025, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2', 'NG', 'R_NGH', 2030, 'RH', 0.85, NULL, ''); +REPLACE INTO "efficiency" VALUES('R1-R2', 'ELC', 'E_TRANS', 2015, 'ELC', 0.9, NULL, ''); +REPLACE INTO "efficiency" VALUES('R2-R1', 'ELC', 'E_TRANS', 2015, 'ELC', 0.9, NULL, ''); +REPLACE INTO "emission_activity" VALUES('R1','CO2','ethos','S_IMPNG',2020,'NG',5.029999999999999e+01,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "emission_activity" VALUES('R1','CO2','OIL','S_OILREF',2020,'GSL',67.2,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "emission_activity" VALUES('R1','CO2','OIL','S_OILREF',2020,'DSL',69.4,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "emission_activity" VALUES('R2','CO2','ethos','S_IMPNG',2020,'NG',5.029999999999999e+01,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "emission_activity" VALUES('R2','CO2','OIL','S_OILREF',2020,'GSL',67.2,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "emission_activity" VALUES('R2','CO2','OIL','S_OILREF',2020,'DSL',69.4,'kT/PJ','taken from MIT Energy Fact Sheet'); +REPLACE INTO "existing_capacity" VALUES('R1','E_NUCLEAR',2015,0.07,'GW',''); +REPLACE INTO "existing_capacity" VALUES('R2','E_NUCLEAR',2015,0.03,'GW',''); +REPLACE INTO "existing_capacity" VALUES('R1-R2','E_TRANS',2015,10.0,'GW',''); +REPLACE INTO "existing_capacity" VALUES('R2-R1','E_TRANS',2015,10.0,'GW',''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'S_IMPETH', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'S_IMPOIL', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'S_IMPNG', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'S_IMPURN', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'S_OILREF', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'E_NGCC', 30.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'E_SOLPV', 30.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'E_BATT', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'E_NUCLEAR', 50.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'T_BLND', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'T_DSL', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'T_GSL', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'T_EV', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'R_EH', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1', 'R_NGH', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'S_IMPETH', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'S_IMPOIL', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'S_IMPNG', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'S_IMPURN', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'S_OILREF', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'E_NGCC', 30.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'E_SOLPV', 30.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'E_BATT', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'E_NUCLEAR', 50.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'T_BLND', 100.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'T_DSL', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'T_GSL', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'T_EV', 12.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'R_EH', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2', 'R_NGH', 20.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R1-R2', 'E_TRANS', 30.0, NULL, ''); +REPLACE INTO "lifetime_tech" VALUES('R2-R1', 'E_TRANS', 30.0, NULL, ''); +REPLACE INTO "limit_activity" VALUES('R1',2020,'T_GSL','ge',35.0,'',''); +REPLACE INTO "limit_activity" VALUES('R1',2025,'T_GSL','ge',35.0,'',''); +REPLACE INTO "limit_activity" VALUES('R1',2030,'T_GSL','ge',35.0,'',''); +REPLACE INTO "limit_activity" VALUES('R2',2020,'T_GSL','ge',15.0,'',''); +REPLACE INTO "limit_activity" VALUES('R2',2025,'T_GSL','ge',15.0,'',''); +REPLACE INTO "limit_activity" VALUES('R2',2030,'T_GSL','ge',15.0,'',''); +REPLACE INTO "limit_emission" VALUES('R1',2020,'CO2','le',25000.0,'kT CO2',''); +REPLACE INTO "limit_emission" VALUES('R1',2025,'CO2','le',24000.0,'kT CO2',''); +REPLACE INTO "limit_emission" VALUES('R1',2030,'CO2','le',23000.0,'kT CO2',''); +REPLACE INTO "limit_emission" VALUES('global',2020,'CO2','le',37500.0,'kT CO2',''); +REPLACE INTO "limit_emission" VALUES('global',2025,'CO2','le',36000.0,'kT CO2',''); +REPLACE INTO "limit_emission" VALUES('global',2030,'CO2','le',34500.0,'kT CO2',''); +REPLACE INTO "limit_storage_level_fraction" VALUES('R1',2025,'winter','day','E_BATT',2025,'e',0.5,''); +REPLACE INTO "limit_storage_level_fraction" VALUES('R2',2020,'summer','day','E_BATT',2020,'e',0.5,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2020,'GSL','T_BLND','ge',0.9,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2020,'ETH','T_BLND','ge',0.1,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2025,'GSL','T_BLND','ge',0.9,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2025,'ETH','T_BLND','ge',0.1,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2030,'GSL','T_BLND','ge',0.9,''); +REPLACE INTO "limit_tech_input_split" VALUES('R1',2030,'ETH','T_BLND','ge',0.1,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2020,'GSL','T_BLND','ge',0.72,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2020,'ETH','T_BLND','ge',0.08,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2025,'GSL','T_BLND','ge',0.72,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2025,'ETH','T_BLND','ge',0.08,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2030,'GSL','T_BLND','ge',0.72,''); +REPLACE INTO "limit_tech_input_split" VALUES('R2',2030,'ETH','T_BLND','ge',0.08,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2020,'S_OILREF','GSL','ge',0.9,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2020,'S_OILREF','DSL','ge',0.1,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2025,'S_OILREF','GSL','ge',0.9,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2025,'S_OILREF','DSL','ge',0.1,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2030,'S_OILREF','GSL','ge',0.9,''); +REPLACE INTO "limit_tech_output_split" VALUES('R1',2030,'S_OILREF','DSL','ge',0.1,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2020,'S_OILREF','GSL','ge',0.72,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2020,'S_OILREF','DSL','ge',0.08,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2025,'S_OILREF','GSL','ge',0.72,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2025,'S_OILREF','DSL','ge',0.08,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2030,'S_OILREF','GSL','ge',0.72,''); +REPLACE INTO "limit_tech_output_split" VALUES('R2',2030,'S_OILREF','DSL','ge',0.08,''); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,''); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('R1',NULL); +REPLACE INTO "region" VALUES('R2',NULL); +REPLACE INTO "season_label" VALUES('summer',NULL); +REPLACE INTO "season_label" VALUES('fall',NULL); +REPLACE INTO "season_label" VALUES('winter',NULL); +REPLACE INTO "season_label" VALUES('spring',NULL); +REPLACE INTO "sector_label" VALUES('supply',NULL); +REPLACE INTO "sector_label" VALUES('electric',NULL); +REPLACE INTO "sector_label" VALUES('transport',NULL); +REPLACE INTO "sector_label" VALUES('commercial',NULL); +REPLACE INTO "sector_label" VALUES('residential',NULL); +REPLACE INTO "sector_label" VALUES('industrial',NULL); +REPLACE INTO "storage_duration" VALUES('R1','E_BATT',8.0,'8-hour duration specified as fraction of a day'); +REPLACE INTO "storage_duration" VALUES('R2','E_BATT',8.0,'8-hour duration specified as fraction of a day'); +REPLACE INTO "technology" VALUES('S_IMPETH','p','supply','','',1,0,0,0,0,0,0,0,' imported ethanol'); +REPLACE INTO "technology" VALUES('S_IMPOIL','p','supply','','',1,0,0,0,0,0,0,0,' imported crude oil'); +REPLACE INTO "technology" VALUES('S_IMPNG','p','supply','','',1,0,0,0,0,0,0,0,' imported natural gas'); +REPLACE INTO "technology" VALUES('S_IMPURN','p','supply','','',1,0,0,0,0,0,0,0,' imported uranium'); +REPLACE INTO "technology" VALUES('S_OILREF','p','supply','','',0,0,0,1,0,0,0,0,' crude oil refinery'); +REPLACE INTO "technology" VALUES('E_NGCC','p','electric','','',0,0,0,0,0,0,0,0,' natural gas combined-cycle'); +REPLACE INTO "technology" VALUES('E_SOLPV','p','electric','','',0,0,0,0,0,0,0,0,' solar photovoltaic'); +REPLACE INTO "technology" VALUES('E_BATT','ps','electric','','',0,0,0,0,0,0,0,0,' lithium-ion battery'); +REPLACE INTO "technology" VALUES('E_NUCLEAR','pb','electric','','',0,0,0,0,0,0,0,0,' nuclear power plant'); +REPLACE INTO "technology" VALUES('T_BLND','p','transport','','',0,0,0,0,0,0,0,0,'ethanol - gasoline blending process'); +REPLACE INTO "technology" VALUES('T_DSL','p','transport','','',0,0,0,0,0,0,0,0,'diesel vehicle'); +REPLACE INTO "technology" VALUES('T_GSL','p','transport','','',0,0,0,0,0,0,0,0,'gasoline vehicle'); +REPLACE INTO "technology" VALUES('T_EV','p','transport','','',0,0,0,0,0,0,0,0,'electric vehicle'); +REPLACE INTO "technology" VALUES('R_EH','p','residential','','',0,0,0,0,0,0,0,0,' electric residential heating'); +REPLACE INTO "technology" VALUES('R_NGH','p','residential','','',0,0,0,0,0,0,0,0,' natural gas residential heating'); +REPLACE INTO "technology" VALUES('E_TRANS','p','electric','','',0,0,0,0,0,0,1,0,'electric transmission'); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'day'); +REPLACE INTO "time_of_day" VALUES(2,'night'); +REPLACE INTO "time_period" VALUES(1,2015,'e'); +REPLACE INTO "time_period" VALUES(2,2020,'f'); +REPLACE INTO "time_period" VALUES(3,2025,'f'); +REPLACE INTO "time_period" VALUES(4,2030,'f'); +REPLACE INTO "time_period" VALUES(5,2035,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(2020,1,'spring',NULL); +REPLACE INTO "time_season" VALUES(2020,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(2020,3,'fall',NULL); +REPLACE INTO "time_season" VALUES(2020,4,'winter',NULL); +REPLACE INTO "time_season" VALUES(2025,1,'spring',NULL); +REPLACE INTO "time_season" VALUES(2025,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(2025,3,'fall',NULL); +REPLACE INTO "time_season" VALUES(2025,4,'winter',NULL); +REPLACE INTO "time_season" VALUES(2030,1,'spring',NULL); +REPLACE INTO "time_season" VALUES(2030,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(2030,3,'fall',NULL); +REPLACE INTO "time_season" VALUES(2030,4,'winter',NULL); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','day',0.125,'Spring - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'spring','night',0.125,'Spring - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','day',0.125,'Summer - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'summer','night',0.125,'Summer - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'fall','day',0.125,'Fall - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'fall','night',0.125,'Fall - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','day',0.125,'Winter - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2020,'winter','night',0.125,'Winter - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'spring','day',0.125,'Spring - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'spring','night',0.125,'Spring - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'summer','day',0.125,'Summer - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'summer','night',0.125,'Summer - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'fall','day',0.125,'Fall - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'fall','night',0.125,'Fall - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'winter','day',0.125,'Winter - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2025,'winter','night',0.125,'Winter - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'spring','day',0.125,'Spring - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'spring','night',0.125,'Spring - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'summer','day',0.125,'Summer - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'summer','night',0.125,'Summer - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'fall','day',0.125,'Fall - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'fall','night',0.125,'Fall - Night'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'winter','day',0.125,'Winter - Day'); +REPLACE INTO "time_segment_fraction" VALUES(2030,'winter','night',0.125,'Winter - Night'); diff --git a/tests/testing_data/utopia_data.sql b/tests/testing_data/utopia_data.sql new file mode 100644 index 00000000..8e99da42 --- /dev/null +++ b/tests/testing_data/utopia_data.sql @@ -0,0 +1,559 @@ +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'inter','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'inter','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'winter','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'winter','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'summer','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2000,'summer','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'inter','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'inter','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'winter','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'winter','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'summer','day','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'summer','night','E31',2000,0.2753,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'inter','day','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'inter','night','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'winter','day','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'winter','night','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'summer','day','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_process" VALUES('utopia',2010,'summer','night','E31',2010,0.2756,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'inter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'winter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',1990,'summer','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'inter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'winter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2000,'summer','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','day','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','night','E01',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','day','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','night','E21',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','day','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','night','E31',0.275,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','day','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','night','E51',0.17,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'inter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'winter','night','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','day','E70',0.8,''); +REPLACE INTO "capacity_factor_tech" VALUES('utopia',2010,'summer','night','E70',0.8,''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','E01',31.54,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','E21',31.54,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','E31',31.54,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','E51',31.54,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','E70',31.54,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','RHE',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','RHO',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','RL1',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','SRE',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','TXD',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','TXE',1.0,'PJ / (GW * year)',''); +REPLACE INTO "capacity_to_activity" VALUES('utopia','TXG',1.0,'PJ / (GW * year)',''); +REPLACE INTO "commodity" VALUES('ethos','s','# dummy commodity to supply inputs','PJ'); +REPLACE INTO "commodity" VALUES('DSL','p','# diesel','PJ'); +REPLACE INTO "commodity" VALUES('ELC','p','# electricity','PJ'); +REPLACE INTO "commodity" VALUES('FEQ','p','# fossil equivalent','PJ'); +REPLACE INTO "commodity" VALUES('GSL','p','# gasoline','PJ'); +REPLACE INTO "commodity" VALUES('HCO','p','# coal','PJ'); +REPLACE INTO "commodity" VALUES('HYD','p','# water','PJ'); +REPLACE INTO "commodity" VALUES('OIL','p','# crude oil','PJ'); +REPLACE INTO "commodity" VALUES('URN','p','# uranium','PJ'); +REPLACE INTO "commodity" VALUES('co2','e','#CO2 emissions','Mt'); +REPLACE INTO "commodity" VALUES('nox','e','#NOX emissions','Mt'); +REPLACE INTO "commodity" VALUES('RH','d','# residential heating','PJ'); +REPLACE INTO "commodity" VALUES('RL','d','# residential lighting','PJ'); +REPLACE INTO "commodity" VALUES('TX','d','# transportation','PJ'); +REPLACE INTO "commodity_type" VALUES('w','waste commodity'); +REPLACE INTO "commodity_type" VALUES('wa','waste annual commodity'); +REPLACE INTO "commodity_type" VALUES('wp','waste physical commodity'); +REPLACE INTO "commodity_type" VALUES('a','annual commodity'); +REPLACE INTO "commodity_type" VALUES('s','source commodity'); +REPLACE INTO "commodity_type" VALUES('p','physical commodity'); +REPLACE INTO "commodity_type" VALUES('e','emissions commodity'); +REPLACE INTO "commodity_type" VALUES('d','demand commodity'); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E01',1960,40.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E01',1970,40.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E01',1980,40.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E01',1990,40.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E01',1970,70.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E01',1980,70.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E01',1990,70.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E01',2000,70.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E01',1980,100.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E01',1990,100.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E01',2000,100.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E01',2010,100.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E21',1990,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E21',1990,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E21',1990,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E21',2000,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E21',2000,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E21',2010,500.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E31',1980,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E31',1990,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E31',1980,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E31',1990,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E31',2000,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E31',1980,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E31',1990,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E31',2000,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E31',2010,75.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E51',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E51',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E51',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E51',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E51',2000,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E51',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E51',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E51',2000,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E51',2010,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E70',1960,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E70',1970,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E70',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'E70',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E70',1970,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E70',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E70',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'E70',2000,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E70',1980,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E70',1990,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E70',2000,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'E70',2010,30.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'RHO',1970,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'RHO',1980,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'RHO',1990,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'RHO',1980,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'RHO',1990,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'RHO',2000,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'RHO',1990,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'RHO',2000,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'RHO',2010,1.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'RL1',1980,9.46,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'RL1',1990,9.46,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'RL1',2000,9.46,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'RL1',2010,9.46,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXD',1970,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXD',1980,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXD',1990,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXD',1980,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXD',1990,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXD',2000,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXD',2000,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXD',2010,52.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXE',1990,100.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXE',1990,90.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXE',2000,90.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXE',2000,80.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXE',2010,80.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXG',1970,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXG',1980,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',1990,'TXG',1990,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXG',1980,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXG',1990,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2000,'TXG',2000,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXG',2000,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_fixed" VALUES('utopia',2010,'TXG',2010,48.0,'Mdollar / (PJ^2 / GW / year)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E01',1990,2000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E01',2000,1300.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E01',2010,1200.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E21',1990,5000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E21',2000,5000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E21',2010,5000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E31',1990,3000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E31',2000,3000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E31',2010,3000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E51',1990,900.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E51',2000,900.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E51',2010,900.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E70',1990,1000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E70',2000,1000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','E70',2010,1000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHE',1990,90.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHE',2000,90.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHE',2010,90.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHO',1990,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHO',2000,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','RHO',2010,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','SRE',1990,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','SRE',2000,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','SRE',2010,100.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXD',1990,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXD',2000,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXD',2010,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXE',1990,2000.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXE',2000,1750.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXE',2010,1500.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXG',1990,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXG',2000,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_invest" VALUES('utopia','TXG',2010,1044.0,'Mdollar / (PJ^2 / GW)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'IMPDSL1',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'IMPDSL1',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'IMPDSL1',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'IMPGSL1',1990,15.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'IMPGSL1',1990,15.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'IMPGSL1',1990,15.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'IMPHCO1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'IMPHCO1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'IMPHCO1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'IMPOIL1',1990,8.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'IMPOIL1',1990,8.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'IMPOIL1',1990,8.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'IMPURN1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'IMPURN1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'IMPURN1',1990,2.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E01',1960,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E01',1970,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E01',1980,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E01',1990,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E01',1970,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E01',1980,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E01',1990,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E01',2000,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E01',1980,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E01',1990,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E01',2000,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E01',2010,0.3,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E21',1990,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E21',1990,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E21',1990,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E21',2000,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E21',2000,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E21',2010,1.5,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E70',1960,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E70',1970,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E70',1980,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'E70',1990,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E70',1970,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E70',1980,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E70',1990,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'E70',2000,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E70',1980,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E70',1990,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E70',2000,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'E70',2010,0.4,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',1990,'SRE',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'SRE',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2000,'SRE',2000,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'SRE',1990,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'SRE',2000,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "cost_variable" VALUES('utopia',2010,'SRE',2010,10.0,'Mdollar / (PJ)',''); +REPLACE INTO "demand" VALUES('utopia',1990,'RH',25.2,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2000,'RH',37.8,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2010,'RH',56.7,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',1990,'RL',5.6,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2000,'RL',8.4,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2010,'RL',12.6,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',1990,'TX',5.2,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2000,'TX',7.8,'PJ',''); +REPLACE INTO "demand" VALUES('utopia',2010,'TX',11.69,'PJ',''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'inter','day','RH',0.12,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'inter','night','RH',0.06,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'winter','day','RH',0.5467,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'winter','night','RH',0.2733,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'inter','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'inter','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'summer','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'summer','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'winter','day','RL',0.5,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',1990,'winter','night','RL',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'inter','day','RH',0.12,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'inter','night','RH',0.06,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'winter','day','RH',0.5467,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'winter','night','RH',0.2733,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'inter','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'inter','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'summer','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'summer','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'winter','day','RL',0.5,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2000,'winter','night','RL',0.1,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'inter','day','RH',0.12,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'inter','night','RH',0.06,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'winter','day','RH',0.5467,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'winter','night','RH',0.2733,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'inter','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'inter','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'summer','day','RL',0.15,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'summer','night','RL',0.05,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'winter','day','RL',0.5,''); +REPLACE INTO "demand_specific_distribution" VALUES('utopia',2010,'winter','night','RL',0.1,''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPDSL1',1990,'DSL',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPGSL1',1990,'GSL',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPHCO1',1990,'HCO',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPOIL1',1990,'OIL',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPURN1',1990,'URN',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPFEQ',1990,'FEQ',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','ethos','IMPHYD',1990,'HYD',1.0,'PJ / (PJ)',''); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',1960,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',1970,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',1980,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',1990,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',2000,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HCO','E01',2010,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','FEQ','E21',1990,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','FEQ','E21',2000,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','FEQ','E21',2010,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','URN','E21',1990,'ELC',0.4,'PJ / (PJ)','# 1/2.5'); +REPLACE INTO "efficiency" VALUES('utopia','URN','E21',2000,'ELC',0.4,'PJ / (PJ)','# 1/2.5'); +REPLACE INTO "efficiency" VALUES('utopia','URN','E21',2010,'ELC',0.4,'PJ / (PJ)','# 1/2.5'); +REPLACE INTO "efficiency" VALUES('utopia','HYD','E31',1980,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HYD','E31',1990,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HYD','E31',2000,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','HYD','E31',2010,'ELC',0.32,'PJ / (PJ)','# 1/3.125'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',1960,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',1970,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',1980,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',1990,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',2000,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','E70',2010,'ELC',0.294,'PJ / (PJ)','# 1/3.4'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','E51',1980,'ELC',0.72,'PJ / (PJ)','# 1/1.3889'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','E51',1990,'ELC',0.72,'PJ / (PJ)','# 1/1.3889'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','E51',2000,'ELC',0.72,'PJ / (PJ)','# 1/1.3889'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','E51',2010,'ELC',0.72,'PJ / (PJ)','# 1/1.3889'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RHE',1990,'RH',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RHE',2000,'RH',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RHE',2010,'RH',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','RHO',1970,'RH',0.7,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','RHO',1980,'RH',0.7,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','RHO',1990,'RH',0.7,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','RHO',2000,'RH',0.7,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','RHO',2010,'RH',0.7,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RL1',1980,'RL',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RL1',1990,'RL',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RL1',2000,'RL',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','RL1',2010,'RL',1.0,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',1990,'DSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',2000,'DSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',2010,'DSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',1990,'GSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',2000,'GSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','OIL','SRE',2010,'GSL',1.0,'PJ / (PJ)','# direct translation from PRC_INP2, PRC_OUT'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','TXD',1970,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','TXD',1980,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','TXD',1990,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','TXD',2000,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','DSL','TXD',2010,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','TXE',1990,'TX',0.827,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','TXE',2000,'TX',0.827,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','ELC','TXE',2010,'TX',0.827,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','GSL','TXG',1970,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','GSL','TXG',1980,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','GSL','TXG',1990,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','GSL','TXG',2000,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "efficiency" VALUES('utopia','GSL','TXG',2010,'TX',0.231,'PJ / (PJ)','# direct translation from DMD_EFF'); +REPLACE INTO "emission_activity" VALUES('utopia','co2','ethos','IMPDSL1',1990,'DSL',0.075,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','co2','ethos','IMPGSL1',1990,'GSL',0.075,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','co2','ethos','IMPHCO1',1990,'HCO',8.9e-02,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','co2','ethos','IMPOIL1',1990,'OIL',0.075,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','DSL','TXD',1970,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','DSL','TXD',1980,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','DSL','TXD',1990,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','DSL','TXD',2000,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','DSL','TXD',2010,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','GSL','TXG',1970,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','GSL','TXG',1980,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','GSL','TXG',1990,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','GSL','TXG',2000,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "emission_activity" VALUES('utopia','nox','GSL','TXG',2010,'TX',1.0,'Mt / (PJ)',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E01',1960,0.175,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E01',1970,0.175,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E01',1980,0.15,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E31',1980,0.1,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E51',1980,0.5,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E70',1960,0.05,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E70',1970,0.05,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','E70',1980,0.2,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','RHO',1970,12.5,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','RHO',1980,12.5,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','RL1',1980,5.6,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','TXD',1970,0.4,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','TXD',1980,0.2,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','TXG',1970,3.1,'GW',''); +REPLACE INTO "existing_capacity" VALUES('utopia','TXG',1980,1.5,'GW',''); +REPLACE INTO "lifetime_process" VALUES('utopia','RL1',1980,20.0,'year','#forexistingcap'); +REPLACE INTO "lifetime_process" VALUES('utopia','TXD',1970,30.0,'year','#forexistingcap'); +REPLACE INTO "lifetime_process" VALUES('utopia','TXD',1980,30.0,'year','#forexistingcap'); +REPLACE INTO "lifetime_process" VALUES('utopia','TXG',1970,30.0,'year','#forexistingcap'); +REPLACE INTO "lifetime_process" VALUES('utopia','TXG',1980,30.0,'year','#forexistingcap'); +REPLACE INTO "lifetime_tech" VALUES('utopia','E01',40.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','E21',40.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','E31',100.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','E51',100.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','E70',40.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','RHE',30.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','RHO',30.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','RL1',10.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','SRE',50.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','TXD',15.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','TXE',15.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','TXG',15.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPDSL1',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPGSL1',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPHCO1',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPOIL1',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPURN1',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPHYD',1000.0,'year',''); +REPLACE INTO "lifetime_tech" VALUES('utopia','IMPFEQ',1000.0,'year',''); +REPLACE INTO "limit_capacity" VALUES('utopia',1990,'E31','ge',0.13,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2000,'E31','ge',0.13,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2010,'E31','ge',0.13,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',1990,'SRE','ge',0.1,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',1990,'E31','le',0.13,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2000,'E31','le',0.17,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2010,'E31','le',2.1e-01,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',1990,'RHE','le',0.0,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',1990,'TXD','le',0.6,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2000,'TXD','le',1.76,'GW',''); +REPLACE INTO "limit_capacity" VALUES('utopia',2010,'TXD','le',4.76,'GW',''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',1990,'SRE','DSL','ge',0.7,''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',2000,'SRE','DSL','ge',0.7,''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',2010,'SRE','DSL','ge',0.7,''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',1990,'SRE','GSL','ge',0.3,''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',2000,'SRE','GSL','ge',0.3,''); +REPLACE INTO "limit_tech_output_split" VALUES('utopia',2010,'SRE','GSL','ge',0.3,''); +REPLACE INTO "metadata" VALUES('days_per_period',365,'count of days in each period'); +REPLACE INTO "metadata" VALUES('DB_MAJOR',4,''); +REPLACE INTO "metadata" VALUES('DB_MINOR',0,''); +REPLACE INTO "metadata_real" VALUES('default_loan_rate',0.05,'Default Loan Rate if not specified in loan_rate table'); +REPLACE INTO "metadata_real" VALUES('global_discount_rate',0.05,''); +REPLACE INTO "operator" VALUES('e','equal to'); +REPLACE INTO "operator" VALUES('le','less than or equal to'); +REPLACE INTO "operator" VALUES('ge','greater than or equal to'); +REPLACE INTO "region" VALUES('utopia',NULL); +REPLACE INTO "season_label" VALUES('inter',NULL); +REPLACE INTO "season_label" VALUES('summer',NULL); +REPLACE INTO "season_label" VALUES('winter',NULL); +REPLACE INTO "sector_label" VALUES('supply',NULL); +REPLACE INTO "sector_label" VALUES('electric',NULL); +REPLACE INTO "sector_label" VALUES('transport',NULL); +REPLACE INTO "sector_label" VALUES('commercial',NULL); +REPLACE INTO "sector_label" VALUES('residential',NULL); +REPLACE INTO "sector_label" VALUES('industrial',NULL); +REPLACE INTO "technology" VALUES('IMPDSL1','p','supply','petroleum','',1,0,0,0,0,0,0,0,' imported diesel'); +REPLACE INTO "technology" VALUES('IMPGSL1','p','supply','petroleum','',1,0,0,0,0,0,0,0,' imported gasoline'); +REPLACE INTO "technology" VALUES('IMPHCO1','p','supply','coal','',1,0,0,0,0,0,0,0,' imported coal'); +REPLACE INTO "technology" VALUES('IMPOIL1','p','supply','petroleum','',1,0,0,0,0,0,0,0,' imported crude oil'); +REPLACE INTO "technology" VALUES('IMPURN1','p','supply','nuclear','',1,0,0,0,0,0,0,0,' imported uranium'); +REPLACE INTO "technology" VALUES('IMPFEQ','p','supply','petroleum','',1,0,0,0,0,0,0,0,' imported fossil equivalent'); +REPLACE INTO "technology" VALUES('IMPHYD','p','supply','hydro','',1,0,0,0,0,0,0,0,' imported water -- doesnt exist in Utopia'); +REPLACE INTO "technology" VALUES('E01','pb','electric','coal','',0,0,0,0,0,0,0,0,' coal power plant'); +REPLACE INTO "technology" VALUES('E21','pb','electric','nuclear','',0,0,0,0,0,0,0,0,' nuclear power plant'); +REPLACE INTO "technology" VALUES('E31','pb','electric','hydro','',0,0,0,0,0,0,0,0,' hydro power'); +REPLACE INTO "technology" VALUES('E51','ps','electric','electric','',0,0,0,0,0,0,0,0,' electric storage'); +REPLACE INTO "technology" VALUES('E70','p','electric','petroleum','',0,0,0,0,0,0,0,0,' diesel power plant'); +REPLACE INTO "technology" VALUES('RHE','p','residential','electric','',0,0,0,0,0,0,0,0,' electric residential heating'); +REPLACE INTO "technology" VALUES('RHO','p','residential','petroleum','',0,0,0,0,0,0,0,0,' diesel residential heating'); +REPLACE INTO "technology" VALUES('RL1','p','residential','electric','',0,0,0,0,0,0,0,0,' residential lighting'); +REPLACE INTO "technology" VALUES('SRE','p','supply','petroleum','',0,0,0,0,0,0,0,0,' crude oil processor'); +REPLACE INTO "technology" VALUES('TXD','p','transport','petroleum','',0,0,0,0,0,0,0,0,' diesel powered vehicles'); +REPLACE INTO "technology" VALUES('TXE','p','transport','electric','',0,0,0,0,0,0,0,0,' electric powered vehicles'); +REPLACE INTO "technology" VALUES('TXG','p','transport','petroleum','',0,0,0,0,0,0,0,0,' gasoline powered vehicles'); +REPLACE INTO "technology_type" VALUES('p','production technology'); +REPLACE INTO "technology_type" VALUES('pb','baseload production technology'); +REPLACE INTO "technology_type" VALUES('ps','storage production technology'); +REPLACE INTO "time_of_day" VALUES(1,'day'); +REPLACE INTO "time_of_day" VALUES(2,'night'); +REPLACE INTO "time_period" VALUES(1,1960,'e'); +REPLACE INTO "time_period" VALUES(2,1970,'e'); +REPLACE INTO "time_period" VALUES(3,1980,'e'); +REPLACE INTO "time_period" VALUES(4,1990,'f'); +REPLACE INTO "time_period" VALUES(5,2000,'f'); +REPLACE INTO "time_period" VALUES(6,2010,'f'); +REPLACE INTO "time_period" VALUES(7,2020,'f'); +REPLACE INTO "time_period_type" VALUES('e','existing vintages'); +REPLACE INTO "time_period_type" VALUES('f','future'); +REPLACE INTO "time_season" VALUES(1990,1,'inter',NULL); +REPLACE INTO "time_season" VALUES(1990,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(1990,3,'winter',NULL); +REPLACE INTO "time_season" VALUES(2000,1,'inter',NULL); +REPLACE INTO "time_season" VALUES(2000,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(2000,3,'winter',NULL); +REPLACE INTO "time_season" VALUES(2010,1,'inter',NULL); +REPLACE INTO "time_season" VALUES(2010,2,'summer',NULL); +REPLACE INTO "time_season" VALUES(2010,3,'winter',NULL); +REPLACE INTO "time_segment_fraction" VALUES(1990,'inter','day',0.1667,'# I-D'); +REPLACE INTO "time_segment_fraction" VALUES(1990,'inter','night',0.0833,'# I-N'); +REPLACE INTO "time_segment_fraction" VALUES(1990,'summer','day',0.1667,'# S-D'); +REPLACE INTO "time_segment_fraction" VALUES(1990,'summer','night',0.0833,'# S-N'); +REPLACE INTO "time_segment_fraction" VALUES(1990,'winter','day',0.3333,'# W-D'); +REPLACE INTO "time_segment_fraction" VALUES(1990,'winter','night',0.1667,'# W-N'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'inter','day',0.1667,'# I-D'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'inter','night',0.0833,'# I-N'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','day',0.1667,'# S-D'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'summer','night',0.0833,'# S-N'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','day',0.3333,'# W-D'); +REPLACE INTO "time_segment_fraction" VALUES(2000,'winter','night',0.1667,'# W-N'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'inter','day',0.1667,'# I-D'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'inter','night',0.0833,'# I-N'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','day',0.1667,'# S-D'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'summer','night',0.0833,'# S-N'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','day',0.3333,'# W-D'); +REPLACE INTO "time_segment_fraction" VALUES(2010,'winter','night',0.1667,'# W-N');