  The interactions between charge and orbitally ordered $d$-electrons are
important in many transition metal oxides. We propose an effective energy model
for such interactions, parameterized with DFT+U calculations, so that energy
contributions of both electronic and lattice origin can be simultaneously
accounted for. The model is applied to the low-temperature phase of magnetite,
for which we propose a new ground state structure. The effective interactions
on the B-lattice of Fe$_3$O$_4$ can be interpreted in terms of electrostatics
and short-range Kugel-Khomskii exchange coupling. The frustration between
optimal charge and orbital orderings leads to a complex energy landscape
whereby the supercell for the charge ordering, orbital ordering and ionic
displacements can all be different.
