You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
243 lines
6.9 KiB
Plaintext
243 lines
6.9 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 20,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"The autoreload extension is already loaded. To reload it, use:\n",
|
|
" %reload_ext autoreload\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"from notepad import WaterStorage\n",
|
|
"\n",
|
|
"%load_ext autoreload\n",
|
|
"%autoreload 2\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Developments steps to take: \n",
|
|
"* Test the WaterStorage\n",
|
|
"* Create some example for WaterStorage\n",
|
|
"* Define interactions WaterStorage <> Heatpump\n",
|
|
"* Create some example for WaterStorage + Heatpump\n",
|
|
"* Develop the interactions --> Create working examples"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## WaterStorage"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Functional requirements for the WaterStorage:\n",
|
|
"* Given: \n",
|
|
" * Size / capacity\n",
|
|
" * Temperature in/out\n",
|
|
" * Max power\n",
|
|
" * Roundtripp efficiency\n",
|
|
"* It should be able to execute commands, like: \n",
|
|
" * Charge\n",
|
|
" * Discharge\n",
|
|
" * Whats the storage level? \n",
|
|
" * Assign financials \n",
|
|
" * Take into account storage losses (time dependent)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"waterstorage = WaterStorage(\n",
|
|
" name='MyStorage',\n",
|
|
" max_power=10,\n",
|
|
" min_power=-10,\n",
|
|
" roundtrip_eff=0.9,\n",
|
|
" volume=1000,\n",
|
|
" lifetime=25,\n",
|
|
" min_temperature=55+273,\n",
|
|
" max_temperature=95+273\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"dict_keys(['name', 'id', 'max_power', 'min_power', 'modes', 'roundtrip_eff', 'specific_heat_capacity', 'volume', 'lifetime', 'min_temperature', 'max_temperature', 'delta_T', 'energy_density', 'max_storage_capacity'])"
|
|
]
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"waterstorage.__dict__.keys()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"46.4"
|
|
]
|
|
},
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"waterstorage.max_storage_capacity"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"30"
|
|
]
|
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Funtionality: Set the storage level\n",
|
|
"waterstorage.storage_level = 30\n",
|
|
"waterstorage.storage_level"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AttributeError",
|
|
"evalue": "'WaterStorage' object has no attribute 'charge'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
|
"Input \u001b[1;32mIn [17]\u001b[0m, in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Functionality: Charge the storage\u001b[39;00m\n\u001b[0;32m 2\u001b[0m waterstorage\u001b[38;5;241m.\u001b[39mstorage_level \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m30\u001b[39m\n\u001b[1;32m----> 3\u001b[0m \u001b[43mwaterstorage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcharge\u001b[49m(\u001b[38;5;241m15\u001b[39m)\n\u001b[0;32m 4\u001b[0m waterstorage\u001b[38;5;241m.\u001b[39mstorage_level\n",
|
|
"\u001b[1;31mAttributeError\u001b[0m: 'WaterStorage' object has no attribute 'charge'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Functionality: Charge the storage\n",
|
|
"waterstorage.storage_level = 30\n",
|
|
"waterstorage.charge(15)\n",
|
|
"waterstorage.storage_level"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 19,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"ename": "AttributeError",
|
|
"evalue": "'WaterStorage' object has no attribute 'discharge'",
|
|
"output_type": "error",
|
|
"traceback": [
|
|
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
|
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
|
"Input \u001b[1;32mIn [19]\u001b[0m, in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Functionality: Discharge the storage\u001b[39;00m\n\u001b[0;32m 2\u001b[0m waterstorage\u001b[38;5;241m.\u001b[39mstorage_level \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m30\u001b[39m\n\u001b[1;32m----> 3\u001b[0m \u001b[43mwaterstorage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdischarge\u001b[49m(\u001b[38;5;241m15\u001b[39m)\n\u001b[0;32m 4\u001b[0m waterstorage\u001b[38;5;241m.\u001b[39mstorage_level\n",
|
|
"\u001b[1;31mAttributeError\u001b[0m: 'WaterStorage' object has no attribute 'discharge'"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Functionality: Discharge the storage\n",
|
|
"waterstorage.storage_level = 30\n",
|
|
"waterstorage.discharge(15)\n",
|
|
"waterstorage.storage_level"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## WaterStorage + Heatpump system"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Functional requirements for the WaterStorage + Heatpump system:\n",
|
|
"1. Goal (Funtional requirements): \n",
|
|
" * Given (context)\n",
|
|
" * price (forecast), \n",
|
|
" * source and sink temperature (provided by process), \n",
|
|
" * process heat demand, \n",
|
|
" * storage level of the water storage (temperature level)\n",
|
|
"* I want to know:\n",
|
|
" * Heat output from the heatpump (in MW)\n",
|
|
" * New storage level / temperature level\n",
|
|
" * Electricity consumption of the heatpump"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python [conda env:py39]",
|
|
"language": "python",
|
|
"name": "conda-env-py39-py"
|
|
},
|
|
"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"
|
|
},
|
|
"widgets": {
|
|
"application/vnd.jupyter.widget-state+json": {
|
|
"state": {},
|
|
"version_major": 2,
|
|
"version_minor": 0
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|