We consider the problem of planning the location and size of sensors and actuators to achieve optimal dynamic performance. Using basic results from control and convex optimization, we formulate mixed-integer semidefinite programs for the actuator placement and sizing to obtain the linear quadratic regulator with the lowest cost, and the sensor placement to obtain the Kalman filter with the lowest error. The two formulations are nearly identical due to the duality of optimal linear control and estimation. We also pose similar problems in terms of observability and controllability, which result in smaller mixed-integer semidefinite programs. Since the mixedinteger semidefinite programing is not yet a mature technology, we also use greedy heuristics in conjunction with continuous semidefinite programming. The approach is demonstrated on two modern applications from power systems: the placement and sizing of energy storage for regulation and the placement of phasor measurement units for estimation.Index Terms-Energy storage, Kalman filter (KF), linear quadratic regulator (LQR), mixed-integer semidefinite programming, phasor measurement unit (PMU), sensor and actuator placement.