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

Fix examples#965

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
bnavigator merged 3 commits intopython-control:mainfrombnavigator:fix-examples
Jan 23, 2024
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
9 changes: 5 additions & 4 deletionsexamples/bode-and-nyquist-plots.ipynb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,6 +16,7 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy as sp\n",
"import matplotlib.pyplot as plt\n",
"import control as ct"
Expand DownExpand Up@@ -109,9 +110,9 @@
"w001rad = 1. # 1 rad/s\n",
"w010rad = 10. # 10 rad/s\n",
"w100rad = 100. # 100 rad/s\n",
"w001hz = 2*sp.pi*1. # 1 Hz\n",
"w010hz = 2*sp.pi*10. # 10 Hz\n",
"w100hz = 2*sp.pi*100. # 100 Hz\n",
"w001hz = 2*np.pi*1. # 1 Hz\n",
"w010hz = 2*np.pi*10. # 10 Hz\n",
"w100hz = 2*np.pi*100. # 100 Hz\n",
"# First order systems\n",
"pt1_w001rad = ct.tf([1.], [1./w001rad, 1.], name='pt1_w001rad')\n",
"display(pt1_w001rad)\n",
Expand DownExpand Up@@ -153,7 +154,7 @@
],
"source": [
"sampleTime = 0.001\n",
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletionexamples/genswitch.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,7 +60,7 @@ def genswitch(y, t, mu=4, n=2):
# set(pl, 'LineWidth', AM_data_linewidth)
plt.axis([0, 25, 0, 5])

plt.xlabel('Time {\itt} [scaled]')
plt.xlabel('Time {\\itt} [scaled]')
plt.ylabel('Protein concentrations [scaled]')
plt.legend(('z1 (A)', 'z2 (B)')) # 'Orientation', 'horizontal')
# legend(legh, 'boxoff')
Expand Down
4 changes: 2 additions & 2 deletionsexamples/kincar-flatsys.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -100,8 +100,8 @@ def plot_results(t, x, ud, rescale=True):

plt.subplot(2, 4, 8)
plt.plot(t, ud[1])
plt.xlabel('Ttime t [sec]')
plt.ylabel('$\delta$ [rad]')
plt.xlabel('Time t [sec]')
plt.ylabel('$\\delta$ [rad]')
plt.tight_layout()

#
Expand Down
2 changes: 1 addition & 1 deletionexamples/singular-values-plot.ipynb
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,7 +90,7 @@
],
"source": [
"sampleTime = 10\n",
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletionexamples/type2_type3.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
import os
import matplotlib.pyplot as plt # Grab MATLAB plotting functions
from control.matlab import * # MATLAB-like functions
fromscipy import pi
fromnumpy import pi
integrator = tf([0, 1], [1, 0]) # 1/s

# Parameters defining the system
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp