<jupyter_start><jupyter_text>Austrian energy system Tutorial Part 3: A Policy Scenario**Pre-requisites**- You have the *MESSAGEix* framework installed and working- You have run Austrian energy system baseline scenario (``austria.ipynb``) and solved it successfully**Introduction**In this notebook, we will step through creating and investigating a policy scenario.We will look into the effect of wind generation subsidies on the electricity sector. These subsidies will take the form of capital investment subsidies, effectively reducing the costs of capital investment.  Setup and Helper Variables<jupyter_code># load required packages 
import numpy as np
import pandas as pd

import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')

import ixmp as ix
import message_ix
# launch the IX modeling platform using the local default database
mp = ix.Platform()
country = 'Austria'

plants = [
    "coal_ppl", 
    "gas_ppl", 
    "oil_ppl", 
    "bio_ppl", 
    "hydro_ppl",
    "wind_ppl", 
    "solar_pv_ppl", # actually primary -> final
]

lights = [
    "bulb", 
    "cfl", 
]<jupyter_output><empty_output><jupyter_text>Create the New Policy Scenario DatastructureThis operation is done by cloning the baseline scenario, which will then be edited.<jupyter_code>mp.scenario_list().tail()
model = "Austrian energy model"
scen = "baseline"
mp.open_db() # only open if you're on a local database!
base = message_ix.Scenario(mp, model, scen)
scenario = base.clone(model, 'wind subsidies', 'testing wind subsidies', keep_solution=False)
scenario.check_out()
horizon = scenario.set('year')<jupyter_output><empty_output><jupyter_text>Edit the Datastructure with the Scenario ParametersIntroduce subsidies that decay with time. Initially they are 50% of the total investment costs and decay to 0.<jupyter_code>scenario.par('inv_cost').tail()
subsidies = np.array([0.5, 0.5, 0.75, 1])
inv_cost = pd.DataFrame({
        'node_loc': country,
        'year_vtg': horizon,
        'technology': 'wind_ppl',
        'value': 1100 * subsidies * 1e6,
        'unit': 'USD/GWa',
})
scenario.add_par('inv_cost', inv_cost)
scenario.par('inv_cost').tail()<jupyter_output><empty_output><jupyter_text>Solve the Model<jupyter_code>scenario.commit('wind subsidies added')
scenario.set_as_default()
scenario.solve()
scenario.var('OBJ')['lvl']<jupyter_output><empty_output><jupyter_text>Investigate the Results<jupyter_code>from message_ix.reporting import Reporter
from message_ix.util.tutorial import prepare_plots

config = dict(filters=dict(t=plants))
base_rep = Reporter.from_scenario(base, **config)
prepare_plots(base_rep)
scen_rep = Reporter.from_scenario(scenario, **config)
prepare_plots(scen_rep)
base_rep.get("plot new capacity")
scen_rep.get("plot new capacity")
base_rep.get("plot capacity")
scen_rep.get("plot capacity")
base_rep.get("plot activity")
scen_rep.get("plot activity")
mp.close_db()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10883657454793585, 'fraction_numerical': 0.006141248720573183, 'mean_word_length': 5.866510538641686, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '306747', 'license': 'Apache-2.0', 'n_tokens_mistral': 993, 'n_tokens_neox': 923, 'n_words': 264, 'path': 'tutorial/Austrian_energy_system/austria_single_policy.ipynb', 'repo_name': 'LauWien/message_ix', 'size': '2931'}