Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor/xferfcn.py#265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall 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
6 changes: 3 additions & 3 deletionscontrol/bdalg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -239,14 +239,14 @@ def feedback(sys1, sys2=1, sign=-1):
# its feedback member function.
if isinstance(sys1, (int, float, complex, np.number)):
if isinstance(sys2, tf.TransferFunction):
sys1 = tf._convertToTransferFunction(sys1)
sys1 = tf._convert_to_transfer_function(sys1)
elif isinstance(sys2, ss.StateSpace):
sys1 = ss._convertToStateSpace(sys1)
elif isinstance(sys2, frd.FRD):
sys1 = ss._convertToFRD(sys1)
else: # sys2 is a scalar.
sys1 = tf._convertToTransferFunction(sys1)
sys2 = tf._convertToTransferFunction(sys2)
sys1 = tf._convert_to_transfer_function(sys1)
sys2 = tf._convert_to_transfer_function(sys2)

return sys1.feedback(sys2, sign)

Expand Down
4 changes: 2 additions & 2 deletionscontrol/margins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,7 +144,7 @@ def stability_margins(sysdata, returnall=False, epsw=0.0):
sys = frdata.FRD(mag * np.exp(1j * phase * math.pi/180),
omega, smooth=True)
else:
sys = xferfcn._convertToTransferFunction(sysdata)
sys = xferfcn._convert_to_transfer_function(sysdata)
except Exception as e:
print (e)
raise ValueError("Margin sysdata must be either a linear system or "
Expand DownExpand Up@@ -299,7 +299,7 @@ def phase_crossover_frequencies(sys):
"""

# Convert to a transfer function
tf = xferfcn._convertToTransferFunction(sys)
tf = xferfcn._convert_to_transfer_function(sys)

# if not siso, fall back to (0,0) element
#! TODO: should add a check and warning here
Expand Down
4 changes: 2 additions & 2 deletionscontrol/rlocus.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,7 +51,7 @@
from math import pi
import scipy.signal # signal processing toolbox
import pylab # plotting routines
from .xferfcn import_convertToTransferFunction
from .xferfcn import_convert_to_transfer_function
from .exception import ControlMIMONotImplemented
from functools import partial
from .lti import isdtime
Expand DownExpand Up@@ -284,7 +284,7 @@ def _systopoly1d(sys):

else:
# Convert to a transfer function, if needed
sys =_convertToTransferFunction(sys)
sys =_convert_to_transfer_function(sys)

# Make sure we have a SISO system
if (sys.inputs > 1 or sys.outputs > 1):
Expand Down
2 changes: 1 addition & 1 deletioncontrol/statesp.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@
from scipy.signal import lti, cont2discrete
from warnings import warn
from .lti import LTI, timebase, timebaseEqual, isdtime
from .xferfcn import_convertToTransferFunction
from .xferfcn import_convert_to_transfer_function
from copy import deepcopy

__all__ = ['StateSpace', 'ss', 'rss', 'drss', 'tf2ss', 'ssdata']
Expand Down
4 changes: 2 additions & 2 deletionscontrol/tests/timeresp_test.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,7 @@
# import scipy as sp
from control.timeresp import *
from control.statesp import *
from control.xferfcn import TransferFunction,_convertToTransferFunction
from control.xferfcn import TransferFunction,_convert_to_transfer_function
from control.dtime import c2d
from control.exception import slycot_check

Expand All@@ -28,7 +28,7 @@ def setUp(self):

# Create some transfer functions
self.siso_tf1 = TransferFunction([1], [1, 2, 1])
self.siso_tf2 =_convertToTransferFunction(self.siso_ss1)
self.siso_tf2 =_convert_to_transfer_function(self.siso_ss1)

# Create MIMO system, contains ``siso_ss1`` twice
A = np.matrix("1. -2. 0. 0.;"
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp