In quasi-steady state, the electrical power grid is well modeled by a system of algebraic equations that relate the supplies and demands at nodes of the grid to (complex) voltages at the nodes and currents on the lines. This "AC model" can be used to formulate nonlinear optimization problems to study various issues related to monitoring and security of the grid. We discuss two such issues. The first is
vulnerability analysis, in which we seek the attack that causes maximum disruption to the grid, as measured by the amount of load that must be shed to return it to feasibility or by the departure from
unit-magnitude voltages. The second issue is the use of streaming data from phasor measurement units (PMUs) to detect single-line outages rapidly, and optimal placement of PMUs to maximize the quality of detection. Our methods for these problems are founded on multiclass linear regression classifiers. In each case we discuss the optimization models and algoithms that are used to formulate and solve these problems, and we present the results of computational testing.