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

support discrete system as input for FRD#568

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
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
14 changes: 11 additions & 3 deletionscontrol/frdata.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -110,9 +110,14 @@ def __init__(self, *args, **kwargs):
# the frequency range
otherlti = args[0]
self.omega = sort(np.asarray(args[1], dtype=float))
numfreq = len(self.omega)
# calculate frequency response at my points
self.fresp = otherlti(1j * self.omega, squeeze=False)
if otherlti.isctime():
s = 1j * self.omega
self.fresp = otherlti(s, squeeze=False)
else:
z = np.exp(1j * self.omega * otherlti.dt)
self.fresp = otherlti(z, squeeze=False)

else:
# The user provided a response and a freq vector
self.fresp = array(args[0], dtype=complex)
Expand DownExpand Up@@ -538,7 +543,10 @@ def _convert_to_FRD(sys, omega, inputs=1, outputs=1):

elif isinstance(sys, LTI):
omega = np.sort(omega)
fresp = sys(1j * omega)
if sys.isctime():
fresp = sys(1j * omega)
else:
fresp = sys(np.exp(1j * omega * sys.dt))
if len(fresp.shape) == 1:
fresp = fresp[np.newaxis, np.newaxis, :]
return FRD(fresp, omega, smooth=True)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp