Skip to content

Commit b98be62

Browse files
committed
Merge branch 'ModelicaSystem_small_changes' into small_updates
2 parents 2971b14 + 1d8e992 commit b98be62

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ def __init__(
361361
self._override_variables: dict[str, str] = {}
362362
self._simulate_options_override: dict[str, str] = {}
363363
self._linearization_options = {'startTime': 0.0, 'stopTime': 1.0, 'stepSize': 0.002, 'tolerance': 1e-8}
364-
self._optimization_options = {'startTime': 0.0, 'stopTime': 1.0, 'numberOfIntervals': 500, 'stepSize': 0.002,
365-
'tolerance': 1e-8}
364+
self._optimization_options = self._linearization_options | {'numberOfIntervals': 500}
366365
self._linearized_inputs: list[str] = [] # linearization input list
367366
self._linearized_outputs: list[str] = [] # linearization output list
368367
self._linearized_states: list[str] = [] # linearization states list
@@ -1083,9 +1082,9 @@ def getSolutions(self, varList: Optional[str | list[str]] = None, resultfile: Op
10831082
else:
10841083
result_file = pathlib.Path(resultfile)
10851084

1086-
# check for result file exits
1085+
# check if the result file exits
10871086
if not result_file.is_file():
1088-
raise ModelicaSystemError(f"Result file does not exist {result_file}")
1087+
raise ModelicaSystemError(f"Result file does not exist {result_file.as_posix()}")
10891088

10901089
# get absolute path
10911090
result_file = result_file.absolute()
@@ -1402,7 +1401,7 @@ def _createCSVData(self, csvfile: Optional[pathlib.Path] = None) -> pathlib.Path
14021401
interpolated_inputs[signal_name] = np.interp(
14031402
all_times,
14041403
signal[:, 0], # times
1405-
signal[:, 1] # values
1404+
signal[:, 1], # values
14061405
)
14071406

14081407
# Write CSV file
@@ -1414,7 +1413,7 @@ def _createCSVData(self, csvfile: Optional[pathlib.Path] = None) -> pathlib.Path
14141413
row = [
14151414
t, # time
14161415
*(interpolated_inputs[name][i] for name in input_names), # input values
1417-
0 # trailing 'end' column
1416+
0, # trailing 'end' column
14181417
]
14191418
csv_rows.append(row)
14201419

0 commit comments

Comments
 (0)