EE 554 Largescale Electric Systems Analysis Homework Assigments
Homework 2
Due Oct 23rd at 11:59pm. Submit to CANVAS at https://canvas.uw.edu/courses/1917157/assignments/11849576.
Problem 1
Consider a \(n\) by \(n\) matrix \(A\). We say \(A\) is diagonalizable if there exist some invertible matrix \(P\), where \(A=P \Lambda P^{-1}\), where \(\Lambda\) is a diagonal matrix.
a) Suppose \(A\) has \(n\) distinct eigenvalues. Proof that we can take \(\Lambda\) to the digaonal matrix with eigenvalues on the diagonal and \(P\) to be matrix where each column is the corresponding eigenvector.
b) Find a matrix that is not diagonalizable. Hint: there is a 2 by 2 matrix that is not diagonalizable.
Solutions.
a) Note the original version of the problem missed the word “distinct” and without that, the statement isn’t necessarily true. Full credits for anyone that attempted this problem. We write \(P\) as \(P= [ p_1 \; \dots p_n]\), where \(p_i\) is the \(i\)‘th eigenvector corresponding to \(\lambda_i\). By direct multiplication, we have \(AP=P \Lambda\). We need to show that \(P\) is invertible, and this is true when there are \(n\) distinct eigenvectors. Multiplying both sides by \(P^{-1}\), we have \(A=P \Lambda P^{-1}\).
b) Many matrices work, for example, \(A=\begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}\).
Problem 2
Let \(A\) and \(B\) be real \(n\) by \(n\) matrices. In general, \(AB \neq BA\). Show that if \(A\) and \(B\) are both diagonalizable, and they have the same eigenvectors, then \(AB=BA\).
Solutions.
Let’s say \(A=P \Lambda_A P^{-1}\) and \(B=P \Lambda_B P^{-1}\). Then \(AB= P \Lambda_A P^{-1} P \Lambda_B P^{-1}= P \Lambda_A \Lambda_B P^{-1} =P \Lambda_B \Lambda_A P^{-1}\), where the last step follows by noticing that two diagonal matrices always commutes. The we can insert \(I=P^{-1} P\) between \(\Lambda_B \Lambda_A\) (this trick is very common, and is sometimes called “the resolution of unity”), and \(P \Lambda_B \Lambda_A P^{-1}=P \Lambda_B P^{-1} P \Lambda_A P^{-1}=BA\).
Problem 3
Consider a lossy power system. That is, each line adminttance \(g_{ik}-j b_{ik}\) has \(g_{ik}\geq 0\). Proof that the the thermal loss in the system is nonnegative, and is zero if and only if all the bus voltages are equal. Hint: Once the thermal loss is appriopriately defined, the proof is about two lines.
Solutions.
The definition for loss in words is
\[\text{power generated}= \text{power consumed}+\text{loss}\]rearranging gives
\[\text{loss}=\text{power generated}-\text{power consumed}\]the negative sign can be absorbed into the sign for power injection, and we have
\[\text{loss}=\text{net power injected into the network}\]In symbols, we have \(\textbf{loss}=\sum_i P_i = \sum_{i \sim k} P_{ik}+P_{ki}\). We show that \(P_{ik}+P_{ki} \geq 0\) for every edge \((i,k)\). Writing out the power flow equations and adding, we get \(P_{ik}+P_{ki}= g_{ik} (V_i^2+ V_k^2 + 2 V_i V_k \cos(\theta_i -\theta_k)) \geq g_{ik} (V_i^2+V_k^2-2 V_i V_k) = g_{ik} (V_i-V_k)^2 \geq 0\).
Problem 4
Consider the equation \(f(x)=ax^2-x\), and we want to solve \(f(x)=0\). Of course, we can compute the roots pretty easily, but let’s try the Gauss Algorithm. This algorithm views the equation as a fixed point equation. That is, solving for \(f(x)=0\) is the same as solving for \(x\) such that \(ax^2=x\). Then a simple algorithm is to perform fixed point iterates: \(x^{(k+1)}=a(x^{(k)})^2\), and see if it converges. We call \(\mathcal{X}=\{x^{(0)}:\text{fixed point iterates converges starting from } x^{(0)}\}\) the region of convergence.
a) Pick \(a=0.5\) and find the region of convergence.
b) Pick \(a=2\) and find the region of convergence.
Solutions.
Note that the solutions of \(f(x)=0\) for a given \(a\) are \(0\) and \(\frac{1}{a}\). For every positive \(a\), the iteration
\[x^{(k+1)}=a\left(x^{(k)}\right)^2\]can be written as a function of \(a\) and \(x^{(0)}\) as
\[x^{(k)}=\frac1a\left(ax^{(0)}\right)^{2^k}.\]WE can observe the repeated exponential either goes to zero, stays at 1 or blows up based on: \(\lim_{k\to\infty}x^{(k)} = \begin{cases} 0, & \vert x^{(0)} \vert <1/a,\\ 1/a, & \vert x^{(0)} \vert =1/a,\\ +\infty, & \vert x^{(0)} \vert >1/a, \end{cases}\)
and so if we let \(\mathcal{X}\) denote the region of convergence, we have
\[\mathcal X=\left[-\frac1a,\frac1a\right].\]For \(a=0.5\),
\[\mathcal X=[-2,2].\]and for \(a=2\),
\[\mathcal X=\left[-\frac12,\frac12\right].\]Problem 5
Let \(f(x)\) the same as in the last problem. We now use the Newtow algorithm covered in class. The iterations are
\[x^{(k+1)} = x^{(k)} - \frac{f(x^{(k)})}{f'(x^{(k)})}.\]How about the region of convergence for this algorithm? Hint: run some simulations to help you build some intutions.
Solutions.
Newton’s iteration becomes
\[\boxed{x^{(k+1)}=\frac{a(x^{(k)})^2}{2ax^{(k)}-1}.}\]It make things easier to define \(y^{(k)}=ax^{(k)}.\)
and iteration becomes
\[y^{(k+1)} =\frac{(y^{(k)})^2}{2y^{(k)}-1}.\]Its fixed points are \(0\) and \(1\). We study the behavior of the algorithm case by case.
Case 1: \(y^{(0)}<\frac12\)
If \(0<y^{(0)}<\frac12\), then the denominator is negative and \(y^{(1)}<0\). If \(y^{(0)}\le 0\), the initial value is already nonpositive.
For any negative \(y\), the next iterate is also negative, and
\[\vert \frac{y^2}{2y-1}\vert =\frac{\vert y \vert^2}{1+2 \vert y \vert} < \vert y \vert.\]Hence the iterates approach \(0\).
Case 2: \(y^{(0)}>\frac12\)
We have
\[y^{(k+1)}-1 =\frac{(y^{(k)}-1)^2}{2y^{(k)}-1}.\]The denominator is positive, so \(y^{(1)}\ge1\).
For any \(y\ge1\),
\[\frac{y^2}{2y-1}-y =\frac{y(1-y)}{2y-1} \le 0.\]Thus, after the first iteration, the iterates remain at least \(1\) and form a nonincreasing sequence. Their limit must be a fixed point, so
\[\lim_{k\to\infty}y^{(k)}=1.\]Case 3: \(y^{(0)}=\frac12\)
Newton’s update divides by zero and is undefined.
Together, for positive \(a\), we obtain
\[\lim_{k\to\infty}x^{(k)} = \begin{cases} 0, & x^{(0)}<\dfrac1{2a},\\[6pt] \dfrac1a, & x^{(0)}>\dfrac1{2a}. \end{cases}\]Therefore, the region of convergence to one of the root is
\[\boxed{ \mathcal X=\mathbb R\setminus\left\{\frac1{2a}\right\}. }\]So for \(a=0.5\),
\[\boxed{ \mathcal X=(-\infty,1)\cup(1,\infty). }\]and initial values smaller than \(1\) converge to \(0\); initial values bigger than \(1\) converge to \(2\). Similarly for \(a=2\).
Problem 6
Here we look at solving power flow equation for a two bus system. We are going to set bus 1 as the slack bus, and bus 2 have complex voltage \(V \angle \theta\). The line admittance is \(1-j\).
a) Write the power flow equations for this system.
b) Use Newton’s method to find the values of \(V\) and \(\theta\) when \(P_2=-0.11\) and \(Q_2=0.083\).
Solutions.
a) From class, we get \(P_2=V^2-V\cos\theta+V\sin\theta\)
and
\[Q_2=V^2-V\cos\theta-V\sin\theta\]b) Define
\[\Delta P=-0.11-P(V,\theta),\] \[\Delta Q=0.083^{\mathrm{spec}}-Q(V,\theta).\]and we want to make \(\Delta P\) and \(\Delta Q\) both 0.
At each step, solve
\[\begin{bmatrix} \frac{\partial P}{\partial V} & \frac{\partial P}{\partial\theta}\\ \frac{\partial Q}{\partial V} & \frac{\partial Q}{\partial\theta} \end{bmatrix}_{(V^{(k)},\theta^{(k)})} \begin{bmatrix} \Delta V^{(k)}\\ \Delta\theta^{(k)} \end{bmatrix} = \begin{bmatrix} \Delta P^{(k)}\\ \Delta Q^{(k)} \end{bmatrix},\]then update
\[\begin{bmatrix} V^{(k+1)}\\ \theta^{(k+1)} \end{bmatrix} = \begin{bmatrix} V^{(k)}\\ \theta^{(k)} \end{bmatrix} + \begin{bmatrix} \Delta V^{(k)}\\ \Delta\theta^{(k)} \end{bmatrix}.\]The required derivatives are
\[\frac{\partial P}{\partial V}=2V-\cos\theta+\sin\theta,\] \[\frac{\partial P}{\partial\theta}=V(\sin\theta+\cos\theta),\] \[\frac{\partial Q}{\partial V}=2V-\cos\theta-\sin\theta,\] \[\frac{\partial Q}{\partial\theta}=V(\sin\theta-\cos\theta).\]Therefore the Jacobian is
\[J(V,\theta)= \begin{bmatrix} 2V-\cos\theta+\sin\theta & V(\sin\theta+\cos\theta)\\ 2V-\cos\theta-\sin\theta & V(\sin\theta-\cos\theta) \end{bmatrix}.\]If we start from the flat start, \(V=1\) and \(\theta=0\), we converge to \(V=0.981\) and \(\theta=-0.0985\text{ radians}\) in a few steps. Note, you can find another soluiton with other initial values.
Problem 7
We stay with the system in the last problem. Let’s say we want to solve the power flow problem where \(P_2=5\) and \(Q_2=5\).
a) Before running the algorithm, look at the values, and decide whether there is a solution and explain why or why not.
b) What happens when we do try to run the Netwon algorithm anyways?
Solutions.
This question was intended to not have a solution, but it actually does (actually has 2). In particular, \((V,\theta)\approx(2.791288,0)\) and \((V,\theta)\approx(1.791288,\pi).\) The mismatch in Newton steps first goes up then comes down, but it should converge. Full credits for anyone attempted this question.