Skip to content

Commit 5a5b702

Browse files
committed
Merge branch 'ModelicaSystem_small_changes' into MERGE@all
2 parents 6cd4613 + ebcab5e commit 5a5b702

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

OMPython/ModelicaSystem.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ def __init__(
377377
self._override_variables: dict[str, str] = {}
378378
self._simulate_options_override: dict[str, str] = {}
379379
self._linearization_options = {'startTime': 0.0, 'stopTime': 1.0, 'stepSize': 0.002, 'tolerance': 1e-8}
380-
self._optimization_options = {'startTime': 0.0, 'stopTime': 1.0, 'numberOfIntervals': 500, 'stepSize': 0.002,
381-
'tolerance': 1e-8}
380+
self._optimization_options = self._linearization_options | {'numberOfIntervals': 500}
382381
self._linearized_inputs: list[str] = [] # linearization input list
383382
self._linearized_outputs: list[str] = [] # linearization output list
384383
self._linearized_states: list[str] = [] # linearization states list
@@ -1438,7 +1437,7 @@ def _createCSVData(self, csvfile: Optional[pathlib.Path] = None) -> pathlib.Path
14381437
interpolated_inputs[signal_name] = np.interp(
14391438
all_times,
14401439
signal[:, 0], # times
1441-
signal[:, 1] # values
1440+
signal[:, 1], # values
14421441
)
14431442

14441443
# Write CSV file
@@ -1450,7 +1449,7 @@ def _createCSVData(self, csvfile: Optional[pathlib.Path] = None) -> pathlib.Path
14501449
row = [
14511450
t, # time
14521451
*(interpolated_inputs[name][i] for name in input_names), # input values
1453-
0 # trailing 'end' column
1452+
0, # trailing 'end' column
14541453
]
14551454
csv_rows.append(row)
14561455

0 commit comments

Comments
 (0)