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 3.7 or 3.8. In Anaconda run:
conda create -n py38_ebcpy python=3.8Activate the environment in your terminal. In Anaconda run:
activate py38_ebcpyClone the repository by running
git clone https://github.com/RWTH-EBC/ebcpyClone the AixLib in order to use the models:
git clone https://github.com/RWTH-EBC/AixLibAlso check if you’re on development usingcd AixLib && git status && cd ..Install 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_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
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.