@@ -837,12 +837,31 @@ def getLinearizationOptions(self, names: Optional[str | list[str]] = None) -> di
837837
838838 raise ModelicaSystemError ("Unhandled input for getLinearizationOptions()" )
839839
840- def getOptimizationOptions (self , names = None ): # 10
841- """
842- usage:
843- >>> getOptimizationOptions()
844- >>> getOptimizationOptions("Name1")
845- >>> getOptimizationOptions(["Name1","Name2"])
840+ def getOptimizationOptions (self , names : Optional [str | list [str ]] = None ) -> dict | list :
841+ """Get simulation options used for optimization.
842+
843+ Args:
844+ names: Either None (default), a string with the optimization option
845+ name, or a list of option name strings.
846+
847+ Returns:
848+ If `names` is None, a dict in the format
849+ {option_name: option_value} is returned.
850+ If `names` is a string, a single element list [option_value] is
851+ returned.
852+ If `names` is a list, a list with one value for each option name
853+ in names is returned: [option1_value, option2_value, ...].
854+ Some option values are returned as float when first initialized,
855+ but always as strings after setOptimizationOptions is used to
856+ change them.
857+
858+ Examples:
859+ >>> mod.getOptimizationOptions()
860+ {'startTime': 0.0, 'stopTime': 1.0, 'numberOfIntervals': 500, 'stepSize': 0.002, 'tolerance': 1e-08}
861+ >>> mod.getOptimizationOptions("stopTime")
862+ [1.0]
863+ >>> mod.getOptimizationOptions(["tolerance", "stopTime"])
864+ [1e-08, 1.0]
846865 """
847866 if names is None :
848867 return self ._optimizeOptions
0 commit comments