@@ -1694,14 +1694,14 @@ class OperatingPoint(object):
16941694 """
16951695 def __init__ (
16961696 self , states , inputs = None , outputs = None , result = None ,
1697- return_y = False , return_result = False ):
1697+ return_outputs = False , return_result = False ):
16981698 self .states = states
16991699 self .inputs = inputs
17001700
1701- if outputs is None and return_y and not return_result :
1702- raise SystemError ("return_y specified by no y0 value" )
1701+ if outputs is None and return_outputs and not return_result :
1702+ raise SystemError ("return_outputs specified by no y0 value" )
17031703 self .outputs = outputs
1704- self .return_y = return_y
1704+ self .return_outputs = return_outputs
17051705
17061706 if result is None and return_result :
17071707 raise SystemError ("return_result specified by no result value" )
@@ -1710,9 +1710,9 @@ def __init__(
17101710
17111711 # Implement iter to allow assigning to a tuple
17121712 def __iter__ (self ):
1713- if self .return_y and self .return_result :
1713+ if self .return_outputs and self .return_result :
17141714 return iter ((self .states , self .inputs , self .outputs , self .result ))
1715- elif self .return_y :
1715+ elif self .return_outputs :
17161716 return iter ((self .states , self .inputs , self .outputs ))
17171717 elif self .return_result :
17181718 return iter ((self .states , self .inputs , self .result ))
@@ -1729,9 +1729,9 @@ def __len__(self):
17291729
17301730
17311731def find_operating_point (
1732- sys , x0 , u0 = None , y0 = None , t = 0 , params = None ,
1733- iu = None , iy = None , ix = None , idx = None , dx0 = None , root_method = None ,
1734- root_kwargs = None , return_y = False , return_result = False ):
1732+ sys , x0 , u0 = None , y0 = None , t = 0 , params = None , iu = None , iy = None ,
1733+ ix = None , idx = None , dx0 = None , root_method = None , root_kwargs = None ,
1734+ return_outputs = None , return_result = None , ** kwargs ):
17351735 """Find an operating point for an input/output system.
17361736
17371737 An operating point for a nonlinear system is a state and input around
@@ -1804,8 +1804,8 @@ def find_operating_point(
18041804 is passed to the :func:`scipy.optimize.root` function.
18051805 root_kwargs : dict, optional
18061806 Additional keyword arguments to pass :func:`scipy.optimize.root`.
1807- return_y : bool, optional
1808- If True, return the value of output at the operating point.
1807+ return_outputs : bool, optional
1808+ If True, return the value of outputs at the operating point.
18091809 return_result : bool, optional
18101810 If True, return the `result` option from the
18111811 :func:`scipy.optimize.root` function used to compute the
@@ -1820,8 +1820,8 @@ def find_operating_point(
18201820 :class:`OperatingPoint` for a description of other attributes.
18211821
18221822 If accessed as a tuple, returns `states`, `inputs`, and optionally
1823- `outputs` and `result` based on the `return_y ` and `return_result`
1824- parameters.
1823+ `outputs` and `result` based on the `return_outputs ` and
1824+ `return_result` parameters.
18251825
18261826 Notes
18271827 -----
@@ -1844,6 +1844,12 @@ def find_operating_point(
18441844 """
18451845 from scipy .optimize import root
18461846
1847+ # Process keyword arguments
1848+ return_outputs = config ._process_legacy_keyword (
1849+ kwargs , 'return_y' , 'return_outputs' , return_outputs )
1850+ if kwargs :
1851+ raise TypeError ("unrecognized keyword(s): " + str (kwargs ))
1852+
18471853 # Process arguments for the root function
18481854 root_kwargs = dict () if root_kwargs is None else root_kwargs
18491855 if root_method :
@@ -2019,14 +2025,14 @@ def rootfun(z):
20192025 # Return the result based on what the user wants and what we found
20202026 if return_result or result .success :
20212027 return OperatingPoint (
2022- z [0 ], z [1 ], z [2 ], result , return_y , return_result )
2028+ z [0 ], z [1 ], z [2 ], result , return_outputs , return_result )
20232029 else :
20242030 # Something went wrong, don't return anything
20252031 return OperatingPoint (
2026- None , None , None , result , return_y , return_result )
2032+ None , None , None , result , return_outputs , return_result )
20272033
20282034 # TODO: remove code when ready
2029- if not return_y :
2035+ if not return_outputs :
20302036 z = z [0 :2 ] # Strip y from result if not desired
20312037 if return_result :
20322038 # Return whatever we got, along with the result dictionary
@@ -2036,7 +2042,7 @@ def rootfun(z):
20362042 return z
20372043 else :
20382044 # Something went wrong, don't return anything
2039- return (None , None , None ) if return_y else (None , None )
2045+ return (None , None , None ) if return_outputs else (None , None )
20402046
20412047
20422048# Linearize an input/output system
0 commit comments