Skip to content
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

Merged
merged 3 commits into from
May 7, 2024

Conversation

tosch4
Copy link
Contributor

@tosch4 tosch4 commented Apr 14, 2024

New example (e5) was added which shows how to modify parameters of simulation model (built in Modelica) with the DymolaAPI.

@tosch4 tosch4 added the documentation Improvements or additions to documentation label Apr 14, 2024
@tosch4 tosch4 requested review from FWuellhorst and MZuschlag April 14, 2024 09:31
@tosch4 tosch4 self-assigned this Apr 14, 2024
@tosch4 tosch4 linked an issue Apr 14, 2024 that may be closed by this pull request
additionally edit example e2 for dynamic parameter exchange via Dymola_API
@tosch4
Copy link
Contributor Author

tosch4 commented May 2, 2024

Dear all,
updated example e2 and e5 is uploaded into branch #127. Please review.

Copy link
Collaborator

@FWuellhorst FWuellhorst left a 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

# Start by importing all relevant packages
import pathlib
# Imports from ebcpy
from ebcpy import DymolaAPI, TimeSeriesData, FMU_API
Copy link
Collaborator

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.

Comment on lines 55 to 59
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
Copy link
Collaborator

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

Comment on lines 75 to 77
# Besides parameters (explained in fmu_example), return_option is important

# Or change the savepath by using two keyword arguments.
Copy link
Collaborator

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)

Copy link
Collaborator

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)

Copy link
Contributor Author

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

Copy link
Collaborator

@FWuellhorst FWuellhorst left a 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!

@tosch4 tosch4 merged commit 3e6a3f3 into master May 7, 2024
1 check passed
@tosch4 tosch4 deleted the 127-add-new-example-for-parameter-modifications branch May 7, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new example for parameter modifications
2 participants