Plot Income Example
To explore some of the possibilities with the EOPS model, we will plot the income for different scenarios. The system, initialized in the JSON file, consists of a single busbar connected to one reservoir and a plant. The difference between the scenarios lies in the main price series.
NOTE: For this example, where we use the generate_income_plots function, the price series must be provided in the unit øre/kWh. This function is specifically made for this example and is not intended for general use, so this is not a concern in most cases.
from pyltmapi import LtmSession
from IPython.display import HTML, display, display_markdown
import logging
from generate_income_plot import generate_income_plots
from pyltmapi import LtmSession, LtmDot
import os
from pathlib import Path
logging.basicConfig(level=logging.WARN)
ltm_core_path = os.environ.get(
"LTM_CORE_PATH", str(Path("~").expanduser().joinpath("ltm/release/bin/"))
)
license_file = os.environ.get(
"LTM_CORE_LICENSE_FILE", str(Path("~").expanduser().joinpath("ltm/ltm-license.dat"))
)
with LtmSession(
"ikernel", ltm_core_path=ltm_core_path, overwrite_session=True
) as session:
session.load(filename="income-eops.json")
print(session.model.global_settings.model_type)
print(session.model.global_settings.simulation_type)
LtmDot.display_dot_image(session.build_connection_tree())
# session.set_execute_callback(usercallback, {})
session.model.global_settings.ltm_license_file_path = license_file
validation = session.validate_model()
write_model = session.write_model()
last_rc, results = session.execute_model()
if last_rc != 0:
err = results[0]["log_file_contents"]
display_markdown(err)
else:
generate_income_plots(session)ModelType.EOPS
SimulationType.Parallel
Loading...
area/numedal



Income for scenario 0 are: 21494608.0
Income for scenario 1 are: 35257640.0
Income for scenario 2 are: 15512797.0
Income for scenario 3 are: 29009908.0
Income for scenario 4 are: 36555076.0
Income for scenario 5 are: 19023446.0
Income for scenario 6 are: 34165012.0
Income for scenario 7 are: 24649726.0
Income for scenario 8 are: 41889936.0