Theory of inhomogeneous quantum systems. IV. Variational calculations of metal surfaces | Synapse