EE 554 Largescale Electric Systems Analysis Homework Assigments
Homework 4
Due Oct 25th at 11:59pm. Submit to CANVAS at https://canvas.uw.edu/courses/1828831/assignments/10790845.
Problem 1
Consider the following tree network with paramters \(y_{01}=0.81-j0.91, y_{12}=0.13-j 0.92, y_{23}=0.64-j0.91, y_{24}=0.28-j0.55, y_{45}=0.96-j0.96\). Assume that all the voltage magnitudes are one. The active power loads are \(0.07, 0.04, 0.03, 0.02, 0.02\) at buses 1, 2, 3, 4, 5, respectfully (note these are loads, so if we write them as injections, there is a minus sign). Find the power flow solution (since the voltage magnitudes are fixed, this is equivalent to finding the angles). Note because \(g\)’s are not zero, it is slightly more complicated than the case covered in class. But the same strategy works, start at the leafs of the tree and go upstream.

Solution
This problem can be solved by solving the equation of the following form for each line:
\[g-g\cos(\theta)+b\sin(\theta)=P.\]It is not linear, but as an equation with a single variable, it is easy to solve (by discretizing and doing a search, for example). Starting at bus \(5\), we solve
\[0.96-0.96\cos(\theta)+0.96\sin(\theta)=-0.02.\]We get \(\theta=-0.021\) or \(4.732\). We pick the smaller angle since larger angle leads to a very large loss and tend to create infeasiblities upstream (think in term of the two bus power injection region). Since the \(\theta\) in the above equation is the angle difference between bus 4 and bus 5 referenced to bus 5, we have \(\theta_4-\theta_5=0.021\). This allows us to compute the power flow from bus \(4\) to bus \(5\), given by \(0.96-0.96\cos(\theta)+0.96\sin(-\theta)= 0.02037\). This is slightly larger than the load at bus 5 due to the losses.
Now we group bus 4 and 5 together, as a bus with a total load of ‘load at bus 4+power transferred from 4 to 5’=\(0.02+0.02037=0.04037\). Repeating the procedure, we get \(\theta_2-\theta_4=0.074\). Repeating this process gives us all the angle differences.
Problem 2
For the optimization problem below, you can use direct substitution to solve them (write \(x_2\) in terms of \(x_1\) and differentiate the objective function).
a) Let \(C_1(x_1)= 0.5 x_1^2+x_1\), \(C_2(x_2)= x_2^2 + 2 x_2\), \(L=1\), solve
\[\begin{align} \min_{x_1,x_2} \; & C_1(x_1)+C_2(x_2) \\ & x_1+x_2 = L \end{align}\]b) Let \(C_1(x_1)= 2x_1^2+0.5 x_1\), \(C_2(x_2)= 0.1 x_2^2 + 2 x_2\), \(L=2\), solve
\[\begin{align} \min_{x_1,x_2} \; & C_1(x_1)+C_2(x_2) \\ & x_1+x_2 = L \end{align}\]c) let \(x_1^*\) and \(x_2^*\) be the optimal solutions. Evaluate \(C_1'(x_1^*)\) and \(C_2'(x_2^*)\) for both cases. What you do observe? This is a general principle that guides of much of power system market design.
Solution
a) We get \((x_1^*,x_2^*)=(1,0)\).
b) We get \((x_1^*,x_2^*)=(19/42,65/42)\).
c) In both cases we observe that \(C_1'(x_1^*)=C_2'(x_2^*)\).
Problem 3
a) Show that if \(f\) and \(g\) are both convex, then \(f+g\) is convex.
b) Does there exist \(f\) and \(g\) both convex, and \(f-g\) is also convex.
c) Consider \(f(x,y)=xy\), with domain \(x>0\) and \(y>0\). Is this function convex?
Solution
a) Can directly check using the definition of convexity.
b) Yes, when \(f\) is convex and \(g\) is affine.
c) The gradient is \(\begin{bmatrix} y \\ x \end{bmatrix}\) and the Hessian is \(\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\). The Hessian is indefinite, so the function is not convex.
Problem 4
Let \(A\) and \(B\) be two convex sets.
a) Show that \(A \cap B\) is convex.
b) Is \(A \cup B\) convex?
Solution
a) Yes, directly check by definition.
b) No in general. For example, take \(A=[0,1]\) and \(B=[2 3]\).
Problem 5
Consider the function \(f(x_1, x_2)=2x_1^3+x_1^2+2x_1x_2+\frac{1}{2}x_2^2-8x_1-2x_2-10\). Find the range of values of \((x_1,x_2)\) for whith \(f\) is convex, if any.
Solution
The Hessian of the function is
\[H(x_1,x_2)= \begin{bmatrix} 12x_1+2 & 2\\[6pt] 2 & 1 \end{bmatrix}\]For \(f\) to be convex, we need \(H\) to be positive semidefinite. Using the fact that the trace is the sum of the eigenvalues and the determinant is the product of the eigenvalues, the condition that both eigenvalues are nonnegative. is the same as that the trace and the determinant are both nonnegative. Therefore, we need \(12 x_1 +3 \geq 0\) and \(12 x_1-2 \geq 0\), or equivalently, \(x_1 \geq \frac{1}{6}\).
Problem 6
This is to get started on solving convex problem using a solver. Pick whatever language you’re comfortable with, learn how to call a convex optimization solver. A popular one is cvxpy, or its equivalent in Matlab or Julia, but there are many different ones out there and any of them would work. Solve the following problems, provide the optimal objective values and optimal solutions in your homework solutions.
a) Solve
\[\begin{align} \min_{x_1,x_2} \; & (x_1-2x_2)^2+x_1 \\ \mbox{s.t. } & 0 \leq x_2 \leq 1 \\ & x_1 \geq 0 \end{align}\]b) Solve
\[\begin{align} \min_{x_1,x_2,x_3} \; & \vert x_1 \vert +e^{x_2+x_3} - \log (x_1+x_3) \\ \mbox{s.t. } & x_1 + x_3 \geq 2 \\ & 0 \leq x_2 \leq 3 \\ & x_1 \leq 1 \end{align}\]Solution
a) \((x_1^*,x_2^*)=(0,0)\) with the optimal value being \(0\).
b) \((x_1^*,x_2^*,x_3^*)=(1,0,1)\) with the optimal value being about \(3.025\).