aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2021-11-11 18:13:00 -0500
committerHolden Rohrer <hr@hrhr.dev>2021-11-11 18:13:00 -0500
commit6cf6c1977c1cda2a7c123368630cc7703ddc5172 (patch)
treea8578d7da627cadf89361e4d07a043b6bf1cf758
parent54ca67bc4b75fe2ad6d2f68aa4eff61f781d2af8 (diff)
more physics and linear homeworks
-rw-r--r--jarrio/week11.bc67
-rw-r--r--jarrio/week12.bc164
-rw-r--r--li/hw7.tex173
-rw-r--r--li/hw8.tex169
4 files changed, 573 insertions, 0 deletions
diff --git a/jarrio/week11.bc b/jarrio/week11.bc
new file mode 100644
index 0000000..da49df1
--- /dev/null
+++ b/jarrio/week11.bc
@@ -0,0 +1,67 @@
+scale = 30
+qel = 1.602*10^(-19) # elementary charge in Coulombs
+pi = 4*a(1)
+mu0 = 4*pi * 10^(-7)
+
+print "Weekly Practice 11\n"
+
+vz = 4.8*10^7 # m/s
+print "nonzero term on the first one\n"
+-mu0/(4*pi) * qel*vz*.02/.02^3
+
+print "nonzero term on the third one\n"
+mu0/(4*pi) * qel*vz*.02/sqrt(.02^2+.02^2)^3
+
+print "#2\n"
+vy = 2*10^7
+print mu0/(4*pi) * qel*vy*.02/sqrt(.02^2+.02^2)^3
+print "k\n"
+
+print "#3 (T)\n"
+#params
+i = 4.8 # A
+d = 1.9 # cm
+
+d = d/100 # m
+r = d/2 # m
+loopmag = mu0/(4*pi) * i*(pi*d)/r^2
+wiremag = mu0*i/(2*pi*r)
+loopmag + wiremag
+
+print "#4 (T, pos = into screen, neg = out of screen)\n"
+#params
+i = 4 # A
+r1 = .9 # cm
+r2 = 1.8 # cm
+
+r1 = r1/100 # m
+r2 = r2/100 # m
+
+# mu0/4pi Idl/r1^2
+(mu0 * i * (pi*r1)/r1^2 - mu0 * i * (pi*r2)/r2^2)/(4*pi)
+
+print "#5\n"
+#params
+l = 30 # cm
+mf = 4.8 # mT
+diamg18 = 1.02 # mm
+ig18 = 6 # A
+diamg26 = .41 # mm
+ig26 = 1 # A
+
+# B*diamg18 = mu0*I
+print "To reach necessary magnetic field with #26, current is\n"
+mf*diamg26/mu0/10^6
+print "Therefore, we should use #18 with current (A)\n"
+mf*diamg18/mu0/10^6
+
+print "#7\n"
+#params
+l = 1.3 # m
+mf = 1.4 # mT
+i = 1.5 # A
+
+# Biot-Savart: mu0/4pi * idl/r^2 = B
+# mu0/4pi * i * l / B = r^2
+print "Diameter is (m)\n"
+sqrt(mu0/(4*pi) * i * l / mf * 1000)*2
diff --git a/jarrio/week12.bc b/jarrio/week12.bc
new file mode 100644
index 0000000..fe5a7bd
--- /dev/null
+++ b/jarrio/week12.bc
@@ -0,0 +1,164 @@
+print "Weekly Practice 12\n"
+qelem = 1.6*10^(-19) # C
+pi = 4*a(1)
+mu0 = 4*pi*10^(-7)
+g = 9.81 # m/s^2
+scale = 40
+
+print "#1\n"
+# magnetic field in this problem is |B| @ theta ccw from +x.
+# we find the i and j components. i\times j = k. j\times i = -k.
+#params
+v1 = 1.25 * 10^6 #i m/s
+f1 = 1.64 * 10^(-16) #k N
+v2 = 2.49 * 10^6 #j m/s
+f2 = -4.04* 10^(-16) #k N
+
+# v1*bj*q = f1
+bj = f1/v1/qelem
+# v2*bi*q = -f2
+bi = -f2/v2/qelem
+
+print "Magnitude (T)\n"
+sqrt((bi*10^16)^2 + (bj*10^16)^2)*10^(-16)
+
+print "Angle ccw from +x axis (deg)\n"
+a(bj/bi)*180/pi
+
+scale = 40
+print "#2\n"
+#params
+v = 4*10^4 # m/s
+b = 5 # mT
+
+m = 1.67*10^(-27) # kg
+b = b/1000
+a = (b*qelem*v/m)
+r = v^2/a
+# r = vm/bq
+print "Diameter (m)\n"
+2*r
+
+print "#3\n"
+#params
+mf = 27 # mT
+v = 5.5 * 10^6 # m/s
+thdeg = 30
+
+th = thdeg*pi/180
+mf = mf/1000 # T
+vx = v*c(th)
+melec = 9.1*10^(-31)
+r = vx*melec/(mf*qelem)
+print "Radius (m)\n"
+r
+c = 2*pi*r
+t = c/vx
+
+print "Pitch (m)\n"
+t*v*s(th)
+
+print "#4\n"
+#params
+l = 52 # mass density - g/m
+d = 4 # cm
+
+d = d/100 # m
+l = l/1000 # kg/m
+
+w = l*g # N/m
+# Up and down cancel out from the two base wires, so we get an mf of
+# 2*mu0*I*s(60deg)/(2pi*d) and a force (per meter) of I*mf = w
+# i^2 * 2*mu0*s(60*pi/180)/(2*pi*d) = w
+i = sqrt(w/(2*mu0*s(60*pi/180)/(2*pi*d)))
+
+print "Current (A)\n"
+i
+
+print "#5\n"
+#params
+s = 5.1 # cm
+i = 470 # mA
+b = 1.7 # T
+thdeg = 30
+
+# We use magnetic moment here
+
+s = s/100 # m
+i = i/1000 # A
+th = thdeg*pi/180
+
+print "Torque Magnitude (Nm)\n"
+s^2*s(th)*b*i
+
+print "#6\n"
+#params
+k = 12 # N/m - spring constant
+d = .7 # cm
+b = .5 # T
+l = 20 # cm
+
+d = d/100 # m
+l = l/100 # m
+f = 2*k*d # N (two springs, double the force)
+# i*l*b = f
+i = f/(l*b)
+
+print "Current (A)\n"
+i
+
+print "#7\n"
+#params
+m = 4 # kg
+s = 5.5 # m
+i = 25 # A
+thdeg = 25
+
+th = thdeg*pi/180
+
+w = m*g
+t = w*s/2
+a = s^2
+# a*i*b = t
+b = t/(a*i) # what happened to the angle lmao. this is right (??)
+
+print "Magnetic field (T)\n"
+b
+
+print "#8\n"
+#params
+dv = .02 # V
+l = 10 # cm
+v = 5 # m/s
+
+l = l/100 # m
+ef = dv/l # some stackexchange article said so
+# ef = v*b
+
+print "Magnetic field into the page (T)\n"
+ef/v
+
+print "#9\n"
+#params
+b = .45 # T
+v = .5 # m/s
+ohm = 2 # Ohm
+d = 10 # cm
+
+d = d/100 # m
+i = v*d*b/ohm # IMPORTANT !!!
+p = i^2*ohm
+# f*v = p
+f = p/v
+
+print "Pushing force (N)\n"
+f
+
+print "Power (W)\n"
+p
+
+print "Current - induced counterclockwise (A)\n"
+i
+
+print "Power dissipated by resistor (W)\n"
+p
diff --git a/li/hw7.tex b/li/hw7.tex
new file mode 100644
index 0000000..61bdb6f
--- /dev/null
+++ b/li/hw7.tex
@@ -0,0 +1,173 @@
+\def\bmatrix#1{\left[\matrix{#1}\right]}
+\def\fr#1#2{{#1\over #2}}
+
+ {\bf Section 4.2}
+
+\noindent{\bf 12.}
+
+$$\det\bmatrix{1&a&a^2\cr1&b&b^2\cr1&c&c^2} =
+\det\bmatrix{1&a&a^2\cr0&b-a&b^2-a^2\cr0&c-a&c^2-a^2} =
+(b-a)(c-a)\det\bmatrix{1&a&a^2\cr0&1&b+a\cr0&1&c+a} =$$$$
+(b-a)(c-a)\det\bmatrix{1&a&a^2\cr0&1&b+a\cr0&0&c-b}
+= (b-a)(c-a)(c-b).
+$$
+
+\noindent{\bf 17.}
+
+The determinant of $A$ is $4*3 - 2*1 = 10.$
+
+$$\det(AA^{-1}) = \det I = 1 = \det(A)\det(A^{-1}) \to \det(A^{-1}) =
+1/\det(A) = 1/10.$$
+
+$$\det(A-\lambda I) = (4-\lambda)(3-\lambda) - 2 = \lambda^2 - 7\lambda
++ 10 = (\lambda - 2)(\lambda - 5).$$
+This gives zeroes (meaning $A-\lambda I$ is singular) of $\lambda = 2, 5.$
+
+\noindent{\bf 34.}
+
+By linearity in each row, the determinant of B is the sum of the
+determinants of every choice from the original set. However, if any row
+is repeated in the matrix being determined, the determinant is zero, so
+\def\row{\mathop{\rm row}}
+$$\det B = \left|\matrix{\row 1\cr\row 2\cr\row 3}\right|
++ \left|\matrix{\row 2\cr\row 3\cr\row 1}\right|
+= 6 + 6,$$
+the determinant of the second matrix being equivalent to $\det A$ by two
+row switches.
+
+\iffalse % this is the answer to 35 :'(
+Row operations give us
+$$\det(I+M) = \det\bmatrix{1+a & b & c & d\cr -1 & 1 & 0 & 0\cr -1 & 0 &
+1 & 0\cr -1 & 0 & 0 & 1} =
+\det\bmatrix{1+a+b+c+d & 0 & 0 & 0\cr -1 & 1 & 0 & 0\cr -1 & 0 &
+1 & 0\cr -1 & 0 & 0 & 1},$$
+giving determinant by product of the diagonal entries $1+a+b+c+d.$
+\fi
+
+ {\bf Section 4.3}
+
+\noindent{\bf 3.}
+
+{\it (a)}
+
+True.
+$$\det(S^{-1}AS) = \det(S^{-1})\det(A)\det(S) = \det(A)\det(S^{-1}S) =
+\det(A).$$
+
+{\it (b)}
+
+False, the matrix
+$$\bmatrix{1&1\cr 1&1}$$
+has determinant $1*1 - 1*1,$ which is a cofactor expansion with every
+cofactor either $1$ or $-1,$ but the determinant is still zero.
+
+{\it (c)}
+
+False,
+$$\left|\matrix{1&1&0\cr1&0&1\cr0&1&1}\right| = -2.$$
+
+\noindent{\bf 6.}
+
+{\it (a)}
+
+With $a_{ij}$ the entry on $A$ in the $i$th row and $j$th column, and
+$c_{ij}$ the determinant of the matrix minor of $A$ (matrix $A$ without
+the $i$th row or $j$th column).
+
+$$D_n = a_{11}c_{11} - a_{12}c_{12} + a_{13}c_{13} + \cdots = c_{11} -
+c_{12} + 0 + \cdots = D_{n-1} - D_{n-2}.$$
+$c_{11}$ is clearly $D_{n-1}$ because the remainder after that elimination
+is an $n-1 \times n-1$ tridiagonal matrix with 1s on the diagonals.
+
+$c_{12}$ is an $n-2\times n-2$ tridiagonal with $1,1,0,\ldots$ as the
+first row, inserted above it, and $1,0,0,\ldots$ to its left as the
+first column (overlapping with the first row). This gives a simple
+cofactor expansion (computing on the first column and ignoring the
+zeroes) of the determinant of the $n-2\times n-2$ matrix. Thus, $c_{12}
+= D_{n-2}.$
+
+{\it (b)}
+
+$D_3 = 0 - 1,$ $D_4 = -1 - 0,$ $D_5 = -1 - (-1) = 0,$ $D_6 = 0 - (-1) =
+1,$ $D_7 = 1 - 0,$ $D_8 = 1 - 1 = 0.$
+Therefore, the cycle has period 6, and $1000\bmod6 = 4,$ so $D_{1000}
+= D_4 = -1.$
+
+\noindent{\bf 15.}
+
+$\det A$ is zero because this is a triangular matrix, so the determinant
+is the product of the diagonal entries $x\cdot0\cdot x = 0.$
+The rank of $A$ is 2 unless $x = 0,$ in which case it is 0. This is
+because the first and second columns are linearly dependent.
+
+\noindent{\bf 34.}
+
+{\it (a)}
+
+Row operations (including permutations) which make $A$ and $D$ diagonal
+will be contained within their respective ``block-rows,'' and once we've
+got that, the product of the diagonal entries is the same as the product
+of the determinants of the new $A$ and $D$ blocks (because those
+triangular matrices have determinant equal to the product of diagonal
+entries). None of this requires knowledge of $B.$
+
+{\it (b)}
+
+$$
+\det
+\bmatrix{ 0 & 0 & 1 & 0\cr
+ 0 & 0 & 0 & 1\cr
+ 1 & 0 & 0 & 0\cr
+ 0 & 1 & 0 & 0 }
+= 1,
+$$
+because this can be permuted to give the identity in two operations
+(switch rows 3 and 1 and rows 4 and 2).
+
+However, $B = C = I_2,$ which would give our block determinant formula
+$|A||D| - |C||B| = 0 - 1 \neq 1.$
+
+{\it (c)}
+
+$$
+\det
+\bmatrix{ 0 & 1 & 0 & 0\cr
+ 0 & 0 & 1 & 0\cr
+ 0 & 0 & 0 & 1\cr
+ 1 & 0 & 0 & 0 }
+= -1,
+$$
+
+whereas
+$$\det(AD - CB) = \det\bmatrix{0&1\cr-1&0} = 1.$$
+
+ {\bf Section 4.4}
+
+\noindent{\bf 28.}
+
+The volume is easily found as the absolute determinant of
+
+$$\left|\matrix{3&1&1\cr 1&3&1\cr 1&1&3}\right| =
+\left|\matrix{3&1&1\cr 0&8/3&2/3\cr 0&-2&2}\right| =
+1/3\left|\matrix{3&1&1\cr 0&8&2\cr 0&0&5/2}\right| =
+20.
+$$
+
+The area of the parallelogram faces formed by each pair is the same for
+each pair by symmetry of the xyz coordinates.
+
+If two vectors are orthogonal, the area of the parallelogram they form
+(the rectangle) is the product of their norms.
+And the area computation is also linear. The area of $\{v_1+v_3, v_2\}$
+is the area of $\{v_1, v_2\}$ plus the area of $\{v_3, v_2\},$ and as
+was proven for determinants, the area of $\{v_1, av_1\}$ is zero.
+This lets us orthogonalize the first two vectors of our set to find
+area.
+$$\bmatrix{3&1\cr1&3\cr1&1} =
+\bmatrix{3&-10/11\cr1&26/11\cr1&4/11}\bmatrix{1&7/11\cr0&1}.$$
+
+This isn't a complete QR decomposition, but the norms of the given
+vectors are $\sqrt{11}$ and $\sqrt{792}/11,$ giving an area (by their
+product) of $\sqrt{72}$.
+
+\bye
diff --git a/li/hw8.tex b/li/hw8.tex
new file mode 100644
index 0000000..9b2938b
--- /dev/null
+++ b/li/hw8.tex
@@ -0,0 +1,169 @@
+\def\bmatrix#1{\left[\matrix{#1}\right]}
+\def\dmatrix#1{\left|\matrix{#1}\right|}
+\def\fr#1#2{{#1\over #2}}
+
+ {\bf Section 5.1}
+
+\noindent{\bf 4.}
+
+$P$ has two eigenvalues $c_1=0$ and $c_2=1,$ giving us corresponding
+eigenvectors $v_1=(1,-1)$ and $v_2=(1,1).$
+This gives a general solution
+$$c_1v_1 + c_2v_2e^t,$$
+and our initial condition $u(0)$ can be written as the combination
+$v_1+4v_2,$
+giving our particular solution
+$$v_1 + 4v_2e^t.$$
+
+\noindent{\bf 14.}
+
+The matrix of ones has rank 1 because any pair of rows makes a linearly
+dependent set (by including a duplicate).
+$$\dmatrix{1-\lambda & 1 & 1 & 1\cr
+ 1 & 1-\lambda & 1 & 1\cr
+ 1 & 1 & 1-\lambda & 1\cr
+ 1 & 1 & 1 & 1-\lambda\cr} = 0\Longrightarrow
+ \dmatrix{1-\lambda & 1 & 1 & 1\cr
+ \lambda & -\lambda & 0 & 0\cr
+ \lambda & 0 & -\lambda & 0\cr
+ \lambda & 0 & 0 & -\lambda\cr} = 0\Longrightarrow
+ \dmatrix{4-\lambda & 0 & 0 & 0\cr
+ 1 & -1 & 0 & 0\cr
+ 1 & 0 & -1 & 0\cr
+ 1 & 0 & 0 & -1\cr} = 0,
+$$
+by row operations (including multiplications), which do not affect a
+zero determinant where $\lambda\neq0.$ Because this is triangular, the
+determinant is the product of the diagonal, so $\lambda = 4.$
+This eigenvalue corresponds to $(1,1,1,1)^T.$
+
+The checkerboard matrix has rank 2 because any triplet of rows makes a
+linearly dependent set (again by including a duplicate).
+
+$$\dmatrix{-\lambda&1&0&1\cr
+ 1&-\lambda&1&0\cr
+ 0&1&-\lambda&1\cr
+ 1&0&1&-\lambda} = 0\Longrightarrow
+ \dmatrix{-\lambda&0&\lambda&0\cr
+ 0&-\lambda&0&\lambda\cr
+ 0&1&-\lambda&1\cr
+ 1&0&1&-\lambda} = 0\Longrightarrow$$$$
+ \dmatrix{-1&0&1&0\cr
+ 0&-1&0&1\cr
+ 0&0&-\lambda&2\cr
+ 0&0&2&-\lambda} = 0\Longrightarrow
+ \dmatrix{-1&0&1&0\cr
+ 0&-1&0&1\cr
+ 0&0&-\lambda&2\cr
+ 0&0&0&-\lambda+4/\lambda} = 0
+$$
+This gives $\lambda^2 - 4 = 0 \to \lambda = \pm 2.$
+These eigenvalues correspond to $(1,1,1,1)$ and $(1,-1,1,-1).$
+
+\noindent{\bf 15.}
+
+The rank of an $n\times n$ matrix of ones is 1 (giving $\lambda=0$ with
+multiplicity $n-1$), and its remaining non-zero eigenvalue of $n$
+(because $A-nI$ has the sum of every row, a linear combination, equal to
+zero, therefore it is an eigenvalue).
+
+The rank of an $n\times n$ checkerboard matrix is 2 because it has only
+two unique columns (giving $\lambda=0$ with multiplicity $n-2$) and its
+non-zero eigenvalues being $\pm\sqrt n,$ determined from the cofactor
+expansion of $A-\lambda I$ where $A$ is the checkerboard matrix.
+
+ {\bf Section 5.2}
+
+\noindent{\bf 8.}
+
+{\it (a)}
+$Au = uv^Tu = u(v\cdot u) = (v\cdot u)u,$
+giving that $u$ is an eigenvector with corresponding eigenvalue $v^Tu.$
+
+{\it (b)}
+The other eigenvalues are zero because there is one non-zero eigenvalue
+already shown and the dimension of the null space of $A = A - 0I$ is
+$n-r = n-1,$ completing the eigenvalue set.
+
+{\it (c)}
+The trace is equal to the sum of eigenvalues, which is $v^Tu + 0 =
+v^Tu,$ and it's equal to the sum of the diagonal, of which each entry is
+an element-wise product of $v$ and $u.$
+
+\noindent{\bf 12.}
+
+{\it (a)}
+False.
+$$\bmatrix{1&1&0\cr0&1&1\cr0&0&1}$$
+is invertible but has only the eigenvector set mentioned.
+
+{\it (b)}
+True. Every eigenvalue corresponds to at least one eigenvector (counting
+complex eigenvectors), so there must be only one (multiple) eigenvalue
+of $A.$
+
+{\it (c)}
+
+A is not diagonalizable because its eigenvector set does not span $R^3.$
+
+\noindent{\bf 32.}
+$$A = \bmatrix{2&1\cr1&2}.$$
+This matrix has eigenvalues $1$ and $3,$ and they correspond to
+eigenvectors $(1,-1)$ and $(1,1)$ respectively, giving a diagonalization
+with
+$$S = \bmatrix{1&1\cr-1&1} \Longrightarrow S^{-1} = \fr12\bmatrix{1&-1\cr1&1}$$
+and
+$$\Lambda = \bmatrix{1&0\cr0&3}$$
+$$A^k = S\Lambda^kS^{-1} =
+\bmatrix{1&1\cr-1&1}\bmatrix{1&0\cr0&3^k}\fr12\bmatrix{1&-1\cr1&1} =
+\fr12\bmatrix{1&1\cr-1&1}\bmatrix{1&-1\cr3^k&3^k} =
+\fr12\bmatrix{1+3^k&-1+3^k\cr-1+3^k&1+3^k}.
+$$
+
+ {\bf Section 5.3}
+
+\noindent{\bf 4.}
+
+$$A = \bmatrix{1/2 & 1/2\cr 1 & 0}.$$
+
+{\it (a)}
+$A$ has characteristic polynomial $\lambda^2 - \lambda/2 - 1/2 =
+(\lambda-1)(\lambda+1/2) \to \lambda = 1, -1/2,$ with eigenvectors
+respectively $(1,1)$ and $(1/2, -1).$
+
+{\it (b)}
+
+$$A = -\fr23\bmatrix{1&1/2\cr 1&-1}\bmatrix{1&0\cr0&-1/2}
+\fr13\bmatrix{2&1\cr2&-2}.$$
+As $k\to\infty,$
+$$A^k = \fr13\bmatrix{1&1/2\cr 1&-1}\bmatrix{1&0\cr0&-1/2}^k
+\bmatrix{2&1\cr2&-2} =
+\bmatrix{1&1/2\cr 1&-1}\bmatrix{2&1\cr0&0} =
+\bmatrix{2&1\cr2&1}.$$
+
+{\it (c)}
+
+$$A\bmatrix{1\cr0} = -\fr13\bmatrix{2&1\cr2&1}\bmatrix{1\cr0} =
+\bmatrix{2/3\cr2/3},$$
+giving us the steady state limit of 2/3 from this initial condition.
+
+\noindent{\bf 18.}
+
+These matrices are stable/neutrally stable if both eigenvalues are less
+than or equal to 1. Therefore, the maximal value will be when the larger
+eigenvalue equals 1.
+
+For the first matrix with characteristic equation
+$\lambda^2 - (.2+a)\lambda + .2a + .64 = 0 \to
+(\lambda-(.1+a/2))^2 = .01 + .1a + a^2/4 -.2a + .64,$
+$\lambda = .1+a/2 \pm (.65-.1a+a^2/4) =
+.75 - .4a + .25a^2 = 1 \to a = 2.081$
+
+The eigenvalues of this matrix are $.2$ and $b,$ so the largest
+neutrally stable value of $b$ is 1.
+
+For the third matrix with characteristic equation $\lambda^2 -
+2c\lambda + c^2 - .16 = 0,$ $\lambda = c \pm .4,$ giving maximum $c$ of
+$0.6.$
+
+\bye