Variational formulation of curved beams in global coordinates