Skip to content

Commit d4c75a3

Browse files
committed
update CDS 110, L2
1 parent 257625e commit d4c75a3

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

‎examples/cds110-L2_invpend-dynamics.ipynb‎

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,13 @@
196196
"id": "IIiSaHNuM1u_"
197197
},
198198
"source": [
199-
"Note: you will see a warning when you run this command, because the output $\\dot\\theta$ (`thdot`) is not connected to anything. You can ignore this here, but as you get to more complicated examples, you should pay attention to warnings of this sort and make sure they are OK.\n",
200-
"\n",
199+
"Note: you will see a warning when you run this command, because the output $\\dot\\theta$ (`thdot`) is not connected to anything. You can ignore this here, but as you get to more complicated examples, you should pay attention to warnings of this sort and make sure they are OK."
200+
]
201+
},
202+
{
203+
"cell_type": "markdown",
204+
"metadata": {},
205+
"source": [
201206
"We can now linearize the closed loop system at different gains and compute the eigenvalues to check for stability:"
202207
]
203208
},
@@ -242,15 +247,6 @@
242247
" clsys, [-2*pi, 2*pi, -2, 2], 8, params={'kp': 10});"
243248
]
244249
},
245-
{
246-
"cell_type": "markdown",
247-
"metadata": {
248-
"id": "5nss-eU_vevc"
249-
},
250-
"source": [
251-
"### Improved phase portrait"
252-
]
253-
},
254250
{
255251
"cell_type": "markdown",
256252
"metadata": {
@@ -261,7 +257,14 @@
261257
"\n",
262258
"Some things to notice in this plot:\n",
263259
"* Not all of the equilibrium points are showing up (there are two unstable equilibrium points that are missing)\n",
264-
"* There is no detail about what is happening near the origin.\n",
260+
"* There is no detail about what is happening near the origin."
261+
]
262+
},
263+
{
264+
"cell_type": "markdown",
265+
"metadata": {},
266+
"source": [
267+
"### Improved phase portrait\n",
265268
"\n",
266269
"To fix these issues, we can do a couple of things:\n",
267270
"* Restrict the range of the plot from $-3\\pi/2$ to $3\\pi/2$, which means that grid used to calculate the equilibrium point is a bit finer.\n",
@@ -282,7 +285,7 @@
282285
" gridspec=[13, 7], params=kp_params,\n",
283286
" plot_separatrices={'timedata': 5})\n",
284287
"plt.plot([-pi, -pi], [-2, 2], 'k--', [ pi, pi], [-2, 2], 'k--')\n",
285-
"plt.plot([-pi/2, -pi/2], [-2, 2], 'k:', [ pi/2, pi/2], [-2, 2], 'k:')"
288+
"plt.plot([-pi/2, -pi/2], [-2, 2], 'k:', [ pi/2, pi/2], [-2, 2], 'k:');"
286289
]
287290
},
288291
{
@@ -319,7 +322,7 @@
319322
"u = -K (x - x_\\text{d}) = -k_1 (\\theta - \\theta_d) - k_2 (\\dot\\theta - \\dot\\theta_d).\n",
320323
"$$\n",
321324
"\n",
322-
"We will learn morea bout how to design these controllers later, so if you aren't familiar with the idea of eigenvalue placement, just take this as a bit of \"control theory magic\" for now.\n",
325+
"We will learn more about how to design these controllers later, so if you aren't familiar with the idea of eigenvalue placement, just take this as a bit of \"control theory magic\" for now.\n",
323326
"\n",
324327
"To compute the gains, we make use of the `place` command, applied to the linearized system:"
325328
]

0 commit comments

Comments
 (0)