Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion OMPython/ModelicaSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,14 @@ def linearize(
csvfile = self._createCSVData()
om_cmd.arg_set(key="csvInput", val=csvfile.as_posix())

om_cmd.arg_set(key="l", val=str(lintime or self._linearization_options["stopTime"]))
if lintime is None:
lintime = float(self._linearization_options["stopTime"])
if (float(self._linearization_options["startTime"]) > lintime
or float(self._linearization_options["stopTime"]) < lintime):
raise ModelicaSystemError(f"Invalid linearisation time: {lintime=}; "
f"expected value: {self._linearization_options['startTime']} "
f"<= lintime <= {self._linearization_options['stopTime']}")
om_cmd.arg_set(key="l", val=str(lintime))

# allow runtime simulation flags from user input
if simflags is not None:
Expand Down
Loading