{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Troubleshooting 101\n",
"## How to: NEMGLO components\n",
"A quick exploration of some simple checks you can use to for your NEMGLO model components and `Plan` object."
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"# Import Packages\n",
"# NEMGLO Packages\n",
"from nemglo import *\n",
"\n",
"# Generic Packages\n",
"import pandas as pd"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Fetching Data as per Fundamentals 1"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Compiling data for table DISPATCHPRICE.\n",
"Returning DISPATCHPRICE.\n"
]
}
],
"source": [
"inputdata = nemosis_data(intlength=30, local_cache=r'E:\\TEMPCACHE')\n",
"start = \"02/01/2020 00:00\"\n",
"end = \"09/01/2020 00:00\"\n",
"region = 'VIC1'\n",
"inputdata.set_dates(start, end)\n",
"inputdata.set_region(region)\n",
"prices = inputdata.get_prices()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Construct the Planner + Adding Electrolyser\n",
"As per Fundamentals 1, we create a Plan and load market prices. Calling the `load_market_prices` twice will simply overwrite the existing values stored in the `Plan`.\n",
"```{warning} It is possible (and very dangerous) to create multiple Plan objects of the same identifier or variable name in python. Avoid this at all costs.\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
"P2G = Plan(identifier = \"H2_VIC\")\n",
"P2G.load_market_prices(prices)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING: Overwriting existing market_prices\n"
]
}
],
"source": [
"P2G.load_market_prices(prices)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However! Trying to add NEMGLO components twice will produce an error..."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": [
"h2e = Electrolyser(P2G, identifier='H2E')"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"ename": "ComponentError",
"evalue": "Cannot create a object of the same name as an existing instance in Plan 'H2_VIC'.",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mComponentError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32me:\\PROJECTS\\NEMGLO\\docs\\source\\help\\trouble101.ipynb Cell 10\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m h2e \u001b[39m=\u001b[39m Electrolyser(P2G, identifier\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39mH2E\u001b[39;49m\u001b[39m'\u001b[39;49m)\n",
"File \u001b[1;32mc:\\Users\\derlu\\.conda\\envs\\nempy\\lib\\site-packages\\nemglo\\components\\electrolyser.py:25\u001b[0m, in \u001b[0;36mElectrolyser.__init__\u001b[1;34m(self, system_plan, identifier)\u001b[0m\n\u001b[0;32m 23\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39misinstance\u001b[39m(system_plan, Plan), \u001b[39m\"\u001b[39m\u001b[39mElectrolyser Argument: \u001b[39m\u001b[39m'\u001b[39m\u001b[39msystem_plan\u001b[39m\u001b[39m'\u001b[39m\u001b[39m must be nemglo.planner.Plan object\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 24\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39misinstance\u001b[39m(identifier, \u001b[39mstr\u001b[39m), \u001b[39m\"\u001b[39m\u001b[39mElectrolyser Argument: \u001b[39m\u001b[39m'\u001b[39m\u001b[39midentifier\u001b[39m\u001b[39m'\u001b[39m\u001b[39m must be a str\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m---> 25\u001b[0m inv\u001b[39m.\u001b[39;49mvalidate_unique_id(\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m\u001b[39m__class__\u001b[39;49m, system_plan, identifier)\n\u001b[0;32m 27\u001b[0m \u001b[39m# Link object to Plan\u001b[39;00m\n\u001b[0;32m 28\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_system_plan \u001b[39m=\u001b[39m system_plan\n",
"File \u001b[1;32mc:\\Users\\derlu\\.conda\\envs\\nempy\\lib\\site-packages\\nemglo\\backend\\input_validation.py:115\u001b[0m, in \u001b[0;36mvalidate_unique_id\u001b[1;34m(c_definition, system_plan, identifier)\u001b[0m\n\u001b[0;32m 113\u001b[0m \u001b[39mfor\u001b[39;00m other_gen \u001b[39min\u001b[39;00m [c \u001b[39mfor\u001b[39;00m c \u001b[39min\u001b[39;00m system_plan\u001b[39m.\u001b[39m_components \u001b[39mif\u001b[39;00m c\u001b[39m.\u001b[39m\u001b[39m__class__\u001b[39m \u001b[39mis\u001b[39;00m c_definition]:\n\u001b[0;32m 114\u001b[0m \u001b[39mif\u001b[39;00m other_gen\u001b[39m.\u001b[39m_id \u001b[39m==\u001b[39m identifier:\n\u001b[1;32m--> 115\u001b[0m \u001b[39mraise\u001b[39;00m ComponentError(\u001b[39m\"\u001b[39m\u001b[39mCannot create a \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m object of the same name as an existing instance in Plan \u001b[39m\u001b[39m'\u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39m\u001b[39m\"\u001b[39m\\\n\u001b[0;32m 116\u001b[0m \u001b[39m.\u001b[39mformat(c_definition, system_plan\u001b[39m.\u001b[39m_id))\n",
"\u001b[1;31mComponentError\u001b[0m: Cannot create a object of the same name as an existing instance in Plan 'H2_VIC'."
]
}
],
"source": [
"h2e = Electrolyser(P2G, identifier='H2E')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To update or get around this you can use the function `remove_`, where the function name will match the main `add_` function for the respective component. So for the `Electrolyser` class, the main function call is `add_electrolyser_operation`. Hence we can call `remove_electrolyser_operation`."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Plan 'H2_VIC' unlinked the component 'H2E'\n"
]
}
],
"source": [
"h2e.remove_electrolyser_operation()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now if you create an `Electrolyser` with the same identifier as earlier, it will add this new object to the `Plan` successfully."
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"h2e = Electrolyser(P2G, identifier='H2E')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Another way to check the components in the `Plan` object is to get the `_components` attribute directly. This will produce a list of all components (Electrolyser, Generator, Emissions, etc.) linked to the `Plan`."
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P2G._components"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Loading Parameters to Components\n",
"Incorrect loading of parameters to components will likely cause an input error. For example an invalid entry for `sec_profile`."
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"ename": "AssertionError",
"evalue": "Electrolyser Argument: 'sec_profile' must be one of ['variable','fixed']",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32me:\\PROJECTS\\NEMGLO\\docs\\source\\help\\trouble101.ipynb Cell 18\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m h2e\u001b[39m.\u001b[39;49mload_h2_parameters_preset(capacity \u001b[39m=\u001b[39;49m \u001b[39m100.0\u001b[39;49m,\n\u001b[0;32m 2\u001b[0m maxload \u001b[39m=\u001b[39;49m \u001b[39m100.0\u001b[39;49m,\n\u001b[0;32m 3\u001b[0m minload \u001b[39m=\u001b[39;49m \u001b[39m10.0\u001b[39;49m,\n\u001b[0;32m 4\u001b[0m offload \u001b[39m=\u001b[39;49m \u001b[39m0.0\u001b[39;49m,\n\u001b[0;32m 5\u001b[0m electrolyser_type \u001b[39m=\u001b[39;49m \u001b[39m'\u001b[39;49m\u001b[39mPEM\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[0;32m 6\u001b[0m sec_profile\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39ma\u001b[39;49m\u001b[39m'\u001b[39;49m)\n",
"File \u001b[1;32mc:\\Users\\derlu\\.conda\\envs\\nempy\\lib\\site-packages\\nemglo\\components\\electrolyser.py:94\u001b[0m, in \u001b[0;36mElectrolyser.load_h2_parameters_preset\u001b[1;34m(self, capacity, maxload, minload, offload, electrolyser_type, sec_profile, h2_price_kg)\u001b[0m\n\u001b[0;32m 89\u001b[0m \u001b[39massert\u001b[39;00m \u001b[39misinstance\u001b[39m(h2_price_kg, (\u001b[39mfloat\u001b[39m, \u001b[39mtype\u001b[39m(\u001b[39mNone\u001b[39;00m))), \u001b[39m\"\u001b[39m\u001b[39mElectrolyser Argument: \u001b[39m\u001b[39m'\u001b[39m\u001b[39mh2_price_kg\u001b[39m\u001b[39m'\u001b[39m\u001b[39m must be a \u001b[39m\u001b[39m\\\u001b[39;00m\n\u001b[0;32m 90\u001b[0m \u001b[39m (float, or None)\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 92\u001b[0m \u001b[39massert\u001b[39;00m electrolyser_type \u001b[39min\u001b[39;00m [\u001b[39m'\u001b[39m\u001b[39mPEM\u001b[39m\u001b[39m'\u001b[39m,\u001b[39m'\u001b[39m\u001b[39mAE\u001b[39m\u001b[39m'\u001b[39m], \\\n\u001b[0;32m 93\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mElectrolyser Argument: \u001b[39m\u001b[39m'\u001b[39m\u001b[39melectrolyser_type\u001b[39m\u001b[39m'\u001b[39m\u001b[39m must be one of [\u001b[39m\u001b[39m'\u001b[39m\u001b[39mPEM\u001b[39m\u001b[39m'\u001b[39m\u001b[39m,\u001b[39m\u001b[39m'\u001b[39m\u001b[39mAE\u001b[39m\u001b[39m'\u001b[39m\u001b[39m]\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m---> 94\u001b[0m \u001b[39massert\u001b[39;00m sec_profile \u001b[39min\u001b[39;00m [\u001b[39m'\u001b[39m\u001b[39mvariable\u001b[39m\u001b[39m'\u001b[39m,\u001b[39m'\u001b[39m\u001b[39mfixed\u001b[39m\u001b[39m'\u001b[39m], \\\n\u001b[0;32m 95\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mElectrolyser Argument: \u001b[39m\u001b[39m'\u001b[39m\u001b[39msec_profile\u001b[39m\u001b[39m'\u001b[39m\u001b[39m must be one of [\u001b[39m\u001b[39m'\u001b[39m\u001b[39mvariable\u001b[39m\u001b[39m'\u001b[39m\u001b[39m,\u001b[39m\u001b[39m'\u001b[39m\u001b[39mfixed\u001b[39m\u001b[39m'\u001b[39m\u001b[39m]\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m 97\u001b[0m \u001b[39m# Store Values\u001b[39;00m\n\u001b[0;32m 98\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_capacity \u001b[39m=\u001b[39m capacity\n",
"\u001b[1;31mAssertionError\u001b[0m: Electrolyser Argument: 'sec_profile' must be one of ['variable','fixed']"
]
}
],
"source": [
"h2e.load_h2_parameters_preset(capacity = 100.0,\n",
" maxload = 100.0,\n",
" minload = 10.0,\n",
" offload = 0.0,\n",
" electrolyser_type = 'PEM',\n",
" sec_profile='a')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If we check the attributes of the python variable, we notice nothing has been loaded correctly."
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'_system_plan': ,\n",
" '_id': 'H2E',\n",
" '_capacity': None,\n",
" '_maxload': None,\n",
" '_minload': None,\n",
" '_offload': None,\n",
" '_type': None,\n",
" '_profile': 'fixed',\n",
" '_sec_nominal': None,\n",
" '_sec_conversion': None,\n",
" '_sec_system': None,\n",
" '_sec_variable_points': None,\n",
" '_h2_price_kg': None,\n",
" '_storage_max': None,\n",
" '_storage_initial': None,\n",
" '_storage_final': None,\n",
" '_storage_drain': None}"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"h2e.__dict__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Entering correct details with a successful load would instead show..."
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'_system_plan': ,\n",
" '_id': 'H2E',\n",
" '_capacity': 100.0,\n",
" '_maxload': 100.0,\n",
" '_minload': 10.0,\n",
" '_offload': 0.0,\n",
" '_type': 'PEM',\n",
" '_profile': 'fixed',\n",
" '_sec_nominal': 66,\n",
" '_sec_conversion': 1.0,\n",
" '_sec_system': 66.0,\n",
" '_sec_variable_points': h2e_load_pct nominal_sec_pct\n",
" 0 0.0 0.8383\n",
" 1 0.2 0.8383\n",
" 2 0.4 0.8598\n",
" 3 0.6 0.8982\n",
" 4 0.8 0.9315\n",
" 5 1.0 1.0101,\n",
" '_h2_price_kg': None,\n",
" '_storage_max': None,\n",
" '_storage_initial': None,\n",
" '_storage_final': None,\n",
" '_storage_drain': None}"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"h2e.load_h2_parameters_preset(capacity = 100.0,\n",
" maxload = 100.0,\n",
" minload = 10.0,\n",
" offload = 0.0,\n",
" electrolyser_type = 'PEM',\n",
" sec_profile='fixed')\n",
"h2e.__dict__"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"One may mistakeningly assume that the component variables and constraints are now entered in the optimiser model and ready to run `Plan.optimise`. If you check for the electrolyser variables of identifer **H2E** in the `Plan` using `view_variable` you will find nothing."
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Variable name not found in Plan: 'H2_VIC'\n"
]
},
{
"data": {
"text/plain": [
"{}"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P2G.view_variable('H2E')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Adding Component Functionality to Optimiser\n",
"The important final step before running `optimise` here is using `add_` function calls. If you now `add_electrolyser_operation` you will find the optimiser variables belonging to the `Plan`.\n",
"\n",
"The function `view_variable` can be used to find the identifier or individually named variables in the `Plan`."
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"h2e.add_electrolyser_operation()"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" \n",
" | \n",
" variable_name | \n",
" variable_id | \n",
" interval | \n",
" lower_bound | \n",
" upper_bound | \n",
" type | \n",
" \n",
" \n",
" \n",
" \n",
" | 0 | \n",
" H2E-mw_load | \n",
" 0 | \n",
" 0 | \n",
" 0.0 | \n",
" 100.0 | \n",
" continuous | \n",
" \n",
" \n",
" | 1 | \n",
" H2E-mw_load | \n",
" 1 | \n",
" 1 | \n",
" 0.0 | \n",
" 100.0 | \n",
" continuous | \n",
" \n",
" \n",
" | 2 | \n",
" H2E-mw_load | \n",
" 2 | \n",
" 2 | \n",
" 0.0 | \n",
" 100.0 | \n",
" continuous | \n",
" \n",
" \n",
" | 3 | \n",
" H2E-mw_load | \n",
" 3 | \n",
" 3 | \n",
" 0.0 | \n",
" 100.0 | \n",
" continuous | \n",
" \n",
" \n",
" | 4 | \n",
" H2E-mw_load | \n",
" 4 | \n",
" 4 | \n",
" 0.0 | \n",
" 100.0 | \n",
" continuous | \n",
" \n",
" \n",
" | ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" \n",
" \n",
" | 1676 | \n",
" H2E-msl_relieve | \n",
" 1676 | \n",
" 331 | \n",
" 0.0 | \n",
" 1.0 | \n",
" binary | \n",
" \n",
" \n",
" | 1677 | \n",
" H2E-msl_relieve | \n",
" 1677 | \n",
" 332 | \n",
" 0.0 | \n",
" 1.0 | \n",
" binary | \n",
" \n",
" \n",
" | 1678 | \n",
" H2E-msl_relieve | \n",
" 1678 | \n",
" 333 | \n",
" 0.0 | \n",
" 1.0 | \n",
" binary | \n",
" \n",
" \n",
" | 1679 | \n",
" H2E-msl_relieve | \n",
" 1679 | \n",
" 334 | \n",
" 0.0 | \n",
" 1.0 | \n",
" binary | \n",
" \n",
" \n",
" | 1680 | \n",
" H2E-msl_relieve | \n",
" 1680 | \n",
" 335 | \n",
" 0.0 | \n",
" 1.0 | \n",
" binary | \n",
" \n",
" \n",
" \n",
" 1681 rows × 6 columns \n",
" "
],
"text/plain": [
" variable_name variable_id interval lower_bound upper_bound \\\n",
"0 H2E-mw_load 0 0 0.0 100.0 \n",
"1 H2E-mw_load 1 1 0.0 100.0 \n",
"2 H2E-mw_load 2 2 0.0 100.0 \n",
"3 H2E-mw_load 3 3 0.0 100.0 \n",
"4 H2E-mw_load 4 4 0.0 100.0 \n",
"... ... ... ... ... ... \n",
"1676 H2E-msl_relieve 1676 331 0.0 1.0 \n",
"1677 H2E-msl_relieve 1677 332 0.0 1.0 \n",
"1678 H2E-msl_relieve 1678 333 0.0 1.0 \n",
"1679 H2E-msl_relieve 1679 334 0.0 1.0 \n",
"1680 H2E-msl_relieve 1680 335 0.0 1.0 \n",
"\n",
" type \n",
"0 continuous \n",
"1 continuous \n",
"2 continuous \n",
"3 continuous \n",
"4 continuous \n",
"... ... \n",
"1676 binary \n",
"1677 binary \n",
"1678 binary \n",
"1679 binary \n",
"1680 binary \n",
"\n",
"[1681 rows x 6 columns]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P2G.view_variable('H2E')"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" \n",
" | \n",
" variable_name | \n",
" variable_id | \n",
" interval | \n",
" lower_bound | \n",
" upper_bound | \n",
" type | \n",
" \n",
" \n",
" \n",
" \n",
" | 0 | \n",
" H2E-mw_load_sum | \n",
" 336 | \n",
" None | \n",
" 0.0 | \n",
" inf | \n",
" continuous | \n",
" \n",
" \n",
" \n",
" "
],
"text/plain": [
" variable_name variable_id interval lower_bound upper_bound type\n",
"0 H2E-mw_load_sum 336 None 0.0 inf continuous"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"P2G.view_variable('H2E-mw_load_sum')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Changing component characteristics\n",
"If you want to change the component after adding it but before optimising for whatever reason you need not clear the python kernel, simply use the `remove_` function call as before. Note here it will print out explicitly what has been removed from the `Plan` in terms of variables, constraints and objective costs."
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Plan 'H2_VIC' removed variable 'H2E-mw_load'\n",
"Plan 'H2_VIC' removed variable 'H2E-mw_load_sum'\n",
"Plan 'H2_VIC' removed variable 'H2E-h2_produced'\n",
"Plan 'H2_VIC' removed variable 'H2E-msl_violate'\n",
"Plan 'H2_VIC' removed variable 'H2E-msl_penalise'\n",
"Plan 'H2_VIC' removed variable 'H2E-msl_relieve'\n",
"Plan 'H2_VIC' removed objective cost 'H2E-mw_load'\n",
"Plan 'H2_VIC' removed objective cost 'H2E-msl_penalise'\n",
"Plan 'H2_VIC' removed objective cost 'H2E-msl_relieve'\n",
"Plan 'H2_VIC' removed constraint LHS 'H2E-mw_load_sum'\n",
"Plan 'H2_VIC' removed constraint LHS 'H2E-h2_produced'\n",
"Plan 'H2_VIC' removed constraint LHS 'H2E-msl_violate'\n",
"Plan 'H2_VIC' removed constraint RHS 'H2E-msl_violate'\n",
"Plan 'H2_VIC' removed constraint RHS dynamic 'H2E-mw_load_sum'\n",
"Plan 'H2_VIC' removed constraint RHS dynamic 'H2E-h2_produced'\n",
"Plan 'H2_VIC' removed objective cost 'H2E-msl_penalise'\n",
"Plan 'H2_VIC' removed objective cost 'H2E-msl_relieve'\n",
"Plan 'H2_VIC' unlinked the component 'H2E'\n"
]
}
],
"source": [
"h2e.remove_electrolyser_operation()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Recap\n",
"> As a recap, the 3 key steps to using NEMGLO are:\n",
"> 1. Defining an object of the component class and parsing the `Plan` and `identifier` of the component.\n",
"> 2. Loading parameters of the component using `load_` functions.\n",
"> 3. Adding variables and constraints that define how this component behaves in the optimiser using `add_`\n",
"> For debugging as well, we can use the inverse call, that is `remove_` if we run into problems\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.12 ('nempy')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "4aab49ac747d4948ee2428bd46f4ac833ef94a37ecb38233c747c75e4d05fe4b"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
| |