@@ -1694,14 +1694,14 @@ class OperatingPoint(object):
1694
1694
"""
1695
1695
def __init__ (
1696
1696
self , states , inputs = None , outputs = None , result = None ,
1697
- return_y = False , return_result = False ):
1697
+ return_outputs = False , return_result = False ):
1698
1698
self .states = states
1699
1699
self .inputs = inputs
1700
1700
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" )
1703
1703
self .outputs = outputs
1704
- self .return_y = return_y
1704
+ self .return_outputs = return_outputs
1705
1705
1706
1706
if result is None and return_result :
1707
1707
raise SystemError ("return_result specified by no result value" )
@@ -1710,9 +1710,9 @@ def __init__(
1710
1710
1711
1711
# Implement iter to allow assigning to a tuple
1712
1712
def __iter__ (self ):
1713
- if self .return_y and self .return_result :
1713
+ if self .return_outputs and self .return_result :
1714
1714
return iter ((self .states , self .inputs , self .outputs , self .result ))
1715
- elif self .return_y :
1715
+ elif self .return_outputs :
1716
1716
return iter ((self .states , self .inputs , self .outputs ))
1717
1717
elif self .return_result :
1718
1718
return iter ((self .states , self .inputs , self .result ))
@@ -1729,9 +1729,9 @@ def __len__(self):
1729
1729
1730
1730
1731
1731
def 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 ):
1735
1735
"""Find an operating point for an input/output system.
1736
1736
1737
1737
An operating point for a nonlinear system is a state and input around
@@ -1804,8 +1804,8 @@ def find_operating_point(
1804
1804
is passed to the :func:`scipy.optimize.root` function.
1805
1805
root_kwargs : dict, optional
1806
1806
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.
1809
1809
return_result : bool, optional
1810
1810
If True, return the `result` option from the
1811
1811
:func:`scipy.optimize.root` function used to compute the
@@ -1820,8 +1820,8 @@ def find_operating_point(
1820
1820
:class:`OperatingPoint` for a description of other attributes.
1821
1821
1822
1822
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.
1825
1825
1826
1826
Notes
1827
1827
-----
@@ -1844,6 +1844,12 @@ def find_operating_point(
1844
1844
"""
1845
1845
from scipy .optimize import root
1846
1846
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
+
1847
1853
# Process arguments for the root function
1848
1854
root_kwargs = dict () if root_kwargs is None else root_kwargs
1849
1855
if root_method :
@@ -2019,14 +2025,14 @@ def rootfun(z):
2019
2025
# Return the result based on what the user wants and what we found
2020
2026
if return_result or result .success :
2021
2027
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 )
2023
2029
else :
2024
2030
# Something went wrong, don't return anything
2025
2031
return OperatingPoint (
2026
- None , None , None , result , return_y , return_result )
2032
+ None , None , None , result , return_outputs , return_result )
2027
2033
2028
2034
# TODO: remove code when ready
2029
- if not return_y :
2035
+ if not return_outputs :
2030
2036
z = z [0 :2 ] # Strip y from result if not desired
2031
2037
if return_result :
2032
2038
# Return whatever we got, along with the result dictionary
@@ -2036,7 +2042,7 @@ def rootfun(z):
2036
2042
return z
2037
2043
else :
2038
2044
# 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 )
2040
2046
2041
2047
2042
2048
# Linearize an input/output system
0 commit comments