Skip to content

Commit e4f2710

Browse files
committed
change cds112 files names and fix up errors
1 parent 354f3cc commit e4f2710

15 files changed

+233
-535
lines changed

examples/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This makefile allows cleanup and posting of Jupyter notebooks into
55
# Google Colab.
66

7-
NOTEBOOKS = cds110-L*_*.ipynb cds112-W*_*.ipynb
7+
NOTEBOOKS = cds110-L*_*.ipynb cds112-L*_*.ipynb
88
GDRIVE= gdrive:projects/python-control/public/notebooks
99

1010
# Clean up notebooks to remove output
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"\n",
8383
"where $x$ is the state vector for the system, $u$ represents the vector of inputs, and $y$ represents the vector of outputs.\n",
8484
"\n",
85-
"The python-control package allows definition of input/output sytems using the `InputOutputSystem` class and its various subclasess, including the `NonlinearIOSystem` class that we use here. A `NonlinearIOSystem` object is created by defining the update law ($f(x, u)$) and the output map ($h(x, u)$), and then calling the factor function `ct.nlsys`.\n",
85+
"The python-control package allows definition of input/output sytems using the `InputOutputSystem` class and its various subclasess, including the `NonlinearIOSystem` class that we use here. A `NonlinearIOSystem` object is created by defining the update law ($f(x, u)$) and the output map ($h(x, u)$), and then calling the factory function `ct.nlsys`.\n",
8686
"\n",
8787
"For the example in this notebook, we will be controlling the steering of a vehicle, using a \"bicycle\" model for the dynamics of the vehicle. A more complete description of the dynamics of this system are available in [Example 3.11](https://fbswiki.org/wiki/index.php/System_Modeling) of [_Feedback Systems_](https://fbswiki.org/wiki/index.php/FBS) by Astrom and Murray (2020)."
8888
]

examples/cds112-W6_stochastic-linsys.ipynb renamed to examples/cds112-L6_stochastic-linsys.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
"def r(tau):\n",
132132
" return c**2 * Q / (2 * a) * exp(-a * abs(tau))\n",
133133
" \n",
134-
"print(\"* mean(Y) [%0.3g] = %0.3g\" % (0, np.mean(Y)))\n",
135-
"print(\"* cov(Y) [%0.3g] = %0.3g\" % (r(0), np.cov(Y)))"
134+
"print(\"* mean(Y) [%0.3g] = %0.3g\" % (0, np.mean(Y).item()))\n",
135+
"print(\"* cov(Y) [%0.3g] = %0.3g\" % (r(0).item(), np.cov(Y).item()))"
136136
]
137137
},
138138
{
@@ -286,8 +286,8 @@
286286
"fig, axs = plt.subplots(1, 2)\n",
287287
"axs[0].plot(tau, R)\n",
288288
"axs[0].plot(tau, dryden_corrfcn(tau))\n",
289-
"axs[0].set_xlabel(\"$\\tau$\")\n",
290-
"axs[0].set_ylabel(\"$r(\\tau)$\")\n",
289+
"axs[0].set_xlabel(r\"$\\tau$\")\n",
290+
"axs[0].set_ylabel(r\"$r(\\tau)$\")\n",
291291
"axs[0].set_title(\"Correlation function\")\n",
292292
"\n",
293293
"# Compute the power spectral density\n",
@@ -302,9 +302,11 @@
302302
"# Plot the power spectral density\n",
303303
"axs[1].loglog(omega[1:], np.abs(S[1:]))\n",
304304
"axs[1].loglog(omega[1:], dryden_psd(omega[1:]))\n",
305-
"axs[0].set_xlabel(\"$\\omega$ [rad/sec]$\")\n",
306-
"axs[0].set_ylabel(\"$S(\\omega)$\")\n",
307-
"axs[0].set_title(\"Power spectral density\");"
305+
"axs[1].set_xlabel(r\"$\\omega$ [rad/sec]\")\n",
306+
"axs[1].set_ylabel(r\"$S(\\omega)$\")\n",
307+
"axs[1].set_title(\"Power spectral density\")\n",
308+
"\n",
309+
"plt.tight_layout()"
308310
]
309311
},
310312
{

0 commit comments

Comments
 (0)