Examples
This folder contains several example files which help with the understanding of ebcpy.
Getting started
While these examples should run in any IDE, we advise using PyCharm. Before being able to run these examples, be sure to:
Create a clean environment of python (We support 3.8 to 3.13). In Anaconda run:
conda create -n py313_ebcpy python=3.13Activate the environment in your terminal. In Anaconda run:
activate py313_ebcpyClone the repository by running
git clone https://github.com/RWTH-EBC/ebcpyClone the BESMod in order to use the models:
git clone https://github.com/RWTH-EBC/BESModand install it as described in the BESMod Readme with AixLibInstall the library using
pip install ebcpy. In order to execute everything, install the full version usingpip install ebcpy[full]
What can I learn in the examples?
e1_time_series_data_example.py
Learn how to use time series data
Understand why we use
TimeSeriesAccessorGet to know the different processing functions
e2_fmu_example.py
Learn how to use the
FMU_APIUnderstand model variables
Learn how to change variables to store (
result_names)Learn how to change parameters of a simulation
Learn how to change inputs of a simulation
Learn how to run simulations in parallel
e3_0_simple_dymola_example.py
Learn a common workflow for Dymola simulation studies using ebcpy
Understand how to run parameter studies across multiple model variants
Learn how to use model name modifiers
Learn how to post-process simulation results into usable formats
e3_dymola_example.py
Learn how to use the
DymolaAPILearn the different result options of the simulation
Learn how to convert inputs into the Dymola format
Learn advanced options for the
DymolaAPI
e4_optimization_example.py
Learn how to create a custom
OptimizerclassLearn the different optimizer frameworks
See the difference in optimization when using newton-based methods and evolutionary algorithms. The difference is, that newton based methods (like L-BFGS-B) are vastly faster in both convex and concave problems, but they are not guaranteed to find the global minimum and can get stock in local optima. Evolutionary algorithms (like the genetic algorithm) are substantially slower, but they can overcome local optima, as shown in the concave examples.
e5_modifier_example.py
Learn how to use the
DymolaAPILearn how to dynamically modify structural parameters in the model
Learn how to redeclare models dynamically in the main model