-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new example added #127 #128
new example added #127 #128
Conversation
additionally edit example e2 for dynamic parameter exchange via Dymola_API
Dear all, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice example! I suggested minor changes, please have a look
examples/e5_modifier_example.py
Outdated
# Start by importing all relevant packages | ||
import pathlib | ||
# Imports from ebcpy | ||
from ebcpy import DymolaAPI, TimeSeriesData, FMU_API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FMU_API is not required.
examples/e5_modifier_example.py
Outdated
n_restart=-1, | ||
equidistant_output=False, | ||
# Only necessary if you need a specific dymola version | ||
dymola_path=r"C:\Program Files\Dymola 2023x", | ||
#dymola_version=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove these special kwargs
examples/e5_modifier_example.py
Outdated
# Besides parameters (explained in fmu_example), return_option is important | ||
|
||
# Or change the savepath by using two keyword arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the description, does not fit the current example
return_option="time_series" | ||
) | ||
print(result_sp_2) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the following code as well, showing that simulating multiple model_names works, as well? It should work, if not, please give me a note
# You can also simulate a list of different `model_names` (or modified versions of the same model)
# by passing a list to the `simulate` function in `DymolaAPI`:
model_names_to_simulate = [
"BESMod.Examples.GasBoilerBuildingOnly(redeclare BESMod.Systems.Control.DHWSuperheating control(dTDHW=10))",
"BESMod.Examples.GasBoilerBuildingOnly(redeclare BESMod.Systems.Control.DHWSuperheating control(dTDHW=5))",
"BESMod.Examples.DesignOptimization.BES",
]
results = dym_api.simulate(
return_option="time_series",
model_names=model_names
)
print(results)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @FWuellhorst ! Example script is updated und pushed to the issue branch #127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the new example and the work!
New example (e5) was added which shows how to modify parameters of simulation model (built in Modelica) with the DymolaAPI.