Skip to content

Commit c633032

Browse files
committed
📝 update OMModel doc
1 parent 2773cbf commit c633032

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

modelitool/simulate.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ def __init__(
2424
package_path: Path = None,
2525
lmodel: list[str] = None,
2626
):
27+
"""
28+
A class to wrap ompython to simulate Modelica system.
29+
Make it easier to change parameters values and simulation options.
30+
Allows specification of boundary conditions using Pandas Dataframe.
31+
The class inherits from corrai Model base class, and can be used with the
32+
module.
33+
34+
- model_path (Path | str): Path to the Modelica model file.
35+
- simulation_options (dict[str, float | str | int], optional):
36+
Options for the simulation. May include values for "startTime",
37+
"stopTime", "stepSize", "tolerance", "solver", "outputFormat".
38+
- x (pd.DataFrame, optional): Input data for the simulation. Index shall
39+
be a DatetimeIndex or integers. Columns must match the combi time table
40+
used to specify boundary conditions in the Modelica System.
41+
- output_list (list[str], optional): List of output variables. Default
42+
will output all available variables.
43+
- simulation_path (Path, optional): Path to run the simulation and
44+
save the simulation results.
45+
- x_combitimetable_name (str, optional): Name of the Modelica System
46+
combi timetable object name, that is used to set the boundary condition.
47+
- package_path (Path, optional): Path to the Modelica package directory
48+
if necessary (package.mo).
49+
- lmodel (list[str], optional): List of Modelica libraries to load.
50+
"""
51+
2752
self.x_combitimetable_name = (
2853
x_combitimetable_name if x_combitimetable_name is not None else "Boundaries"
2954
)
@@ -59,6 +84,25 @@ def simulate(
5984
simflags: str = None,
6085
year: int = None,
6186
) -> pd.DataFrame:
87+
"""
88+
Runs the simulation with the provided parameters, simulation options and
89+
boundariy conditions.
90+
- parameter_dict (dict, optional): Dictionary of parameters.
91+
- simulation_options (dict, optional): Will update simulation options if it
92+
had been given at the init phase. May include values for "startTime",
93+
"stopTime", "stepSize", "tolerance", "solver", "outputFormat".
94+
- x (pd.DataFrame, optional): Input data for the simulation. Index shall
95+
be a DatetimeIndex or integers. Columns must match the combi time table
96+
used to specify boundary conditions in the Modelica System.
97+
- verbose (bool, optional): If True, prints simulation progress. Defaults to
98+
True.
99+
- simflags (str, optional): Additional simulation flags.
100+
- year (int, optional): If x boundary conditions is not specified or do not
101+
have a DateTime index (seconds int), a year can be specified to convert
102+
int seconds index to a datetime index. If simulation spans overs several
103+
years, it shall be the year when it begins.
104+
"""
105+
62106
if parameter_dict is not None:
63107
self._set_param_dict(parameter_dict)
64108

0 commit comments

Comments
 (0)