Skip to content

Commit d28c06c

Browse files
committed
Attempt implementing ipympl
1 parent 282a3fc commit d28c06c

8 files changed

Lines changed: 1122 additions & 9201 deletions

CLsys_general.svg

Lines changed: 346 additions & 0 deletions
Loading

SysReg_crashcourse_FreqDomain_BlockB.py

Lines changed: 581 additions & 125 deletions
Large diffs are not rendered by default.

SysReg_crashcourse_TimeDomain_BlockA.html

Lines changed: 0 additions & 9073 deletions
This file was deleted.

SysReg_crashcourse_TimeDomain_BlockA.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@
899899
" 1. $\\zeta>1$ is overdamped\n",
900900
" 2. $\\zeta=1$ is critically damped\n",
901901
" 3. $\\zeta\\in [0,1]$ is underdamped\n",
902-
" 4. and $\\zeta<1$ is unstable.\n",
902+
" 4. and $\\zeta<0$ is unstable.\n",
903903
"\n",
904904
" Also the speed of the response is defined by $\\omega_0$. We'll plot a few of these."
905905
]

SysReg_crashcourse_TimeDomain_BlockA.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def isControlable(A, B):
563563
# 1. $\zeta>1$ is overdamped
564564
# 2. $\zeta=1$ is critically damped
565565
# 3. $\zeta\in [0,1]$ is underdamped
566-
# 4. and $\zeta<1$ is unstable.
566+
# 4. and $\zeta<0$ is unstable.
567567
#
568568
# Also the speed of the response is defined by $\omega_0$. We'll plot a few of these.
569569

4.34 KB
Binary file not shown.

helperFunctions.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,25 @@ def vector_field(A, v1, v2, ax, n=8):
2828
_, =ax.plot([0, -20*v1[0,0]], [0, -20*v1[1,0]], 'k')
2929
_, =ax.plot([0, -20*v2[0,0]], [0, -20*v2[1,0]], 'k--')
3030
ax.set(xlim=[-1,1], ylim=[-1,1], xlabel="$x_1$", ylabel="$x_2$")
31-
ax.legend(handles=[l1, l2], loc=(1.05, .8))
31+
ax.legend(handles=[l1, l2], loc=(1.05, .8))
32+
33+
def drawContour(ax, cntr, c=[0.1,0.7,0.8], ls='--'):## Plot contour
34+
ax.plot(cntr.real, cntr.imag, ls, color=c)
35+
# ax.set(aspect='equal', ylabel="Im", xlabel="Re")
36+
37+
## Plot clockwise arrows
38+
arrowIdx = np.linspace(start=0, stop=len(cntr), num=6, endpoint=False, dtype=int)
39+
40+
for idx in range(len(arrowIdx)):
41+
ax.annotate("", xytext=(np.real(cntr[arrowIdx[idx]]), np.imag(cntr[arrowIdx[idx]])),
42+
xy=(np.real(cntr[arrowIdx[idx]+1]), np.imag(cntr[arrowIdx[idx]+1])),
43+
arrowprops=dict(arrowstyle="->"))
44+
ax.set_aspect('equal')
45+
46+
def unwrap_angle(ang):
47+
for idx in range(ang.size - 1):
48+
if ang[idx+1] - ang[idx] > 180:
49+
ang[idx+1:] -= 360
50+
elif ang[idx+1] - ang[idx] < -180:
51+
ang[idx+1:] += 360
52+
return ang

secondOrderTFs.svg

Lines changed: 171 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)