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

Commit85328d9

Browse files
authored
Merge pull request#965 from bnavigator/fix-examples
Fix examples
2 parentsa8a54d1 +2c32913 commit85328d9

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

‎examples/bode-and-nyquist-plots.ipynb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"metadata": {},
1717
"outputs": [],
1818
"source": [
19+
"import numpy as np\n",
1920
"import scipy as sp\n",
2021
"import matplotlib.pyplot as plt\n",
2122
"import control as ct"
@@ -109,9 +110,9 @@
109110
"w001rad = 1. # 1 rad/s\n",
110111
"w010rad = 10. # 10 rad/s\n",
111112
"w100rad = 100. # 100 rad/s\n",
112-
"w001hz = 2*sp.pi*1. # 1 Hz\n",
113-
"w010hz = 2*sp.pi*10. # 10 Hz\n",
114-
"w100hz = 2*sp.pi*100. # 100 Hz\n",
113+
"w001hz = 2*np.pi*1. # 1 Hz\n",
114+
"w010hz = 2*np.pi*10. # 10 Hz\n",
115+
"w100hz = 2*np.pi*100. # 100 Hz\n",
115116
"# First order systems\n",
116117
"pt1_w001rad = ct.tf([1.], [1./w001rad, 1.], name='pt1_w001rad')\n",
117118
"display(pt1_w001rad)\n",
@@ -153,7 +154,7 @@
153154
],
154155
"source": [
155156
"sampleTime = 0.001\n",
156-
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
157+
"display('Nyquist frequency: {:.0f} Hz, {:.0f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
157158
]
158159
},
159160
{

‎examples/genswitch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def genswitch(y, t, mu=4, n=2):
6060
# set(pl, 'LineWidth', AM_data_linewidth)
6161
plt.axis([0,25,0,5])
6262

63-
plt.xlabel('Time {\itt} [scaled]')
63+
plt.xlabel('Time {\\itt} [scaled]')
6464
plt.ylabel('Protein concentrations [scaled]')
6565
plt.legend(('z1 (A)','z2 (B)'))# 'Orientation', 'horizontal')
6666
# legend(legh, 'boxoff')

‎examples/kincar-flatsys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def plot_results(t, x, ud, rescale=True):
100100

101101
plt.subplot(2,4,8)
102102
plt.plot(t,ud[1])
103-
plt.xlabel('Ttime t [sec]')
104-
plt.ylabel('$\delta$ [rad]')
103+
plt.xlabel('Time t [sec]')
104+
plt.ylabel('$\\delta$ [rad]')
105105
plt.tight_layout()
106106

107107
#

‎examples/singular-values-plot.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
],
9191
"source": [
9292
"sampleTime = 10\n",
93-
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*sp.pi*1./sampleTime /2.))"
93+
"display('Nyquist frequency: {:.4f} Hz, {:.4f} rad/sec'.format(1./sampleTime /2., 2*np.pi*1./sampleTime /2.))"
9494
]
9595
},
9696
{

‎examples/type2_type3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
importos
66
importmatplotlib.pyplotasplt# Grab MATLAB plotting functions
77
fromcontrol.matlabimport*# MATLAB-like functions
8-
fromscipyimportpi
8+
fromnumpyimportpi
99
integrator=tf([0,1], [1,0])# 1/s
1010

1111
# Parameters defining the system

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp