  We start from an effective Hamiltonian for Ru ions in a square lattice, which
includes the on-site interactions between t_2g orbitals derived from Coulomb
repulsion, and a tetragonal crystal-field splitting. Using perturbation theory
in the hopping terms, we derive effective Hamiltonians to describe the RuO2
planes of RuSr2(Eu,Gd)Cu2O8. For undoped planes (formal valence Ru{+5}),
depending on the parameters we find three possible orderings of spin and
orbitals, and construct a phase diagram. This allows to put constraints on the
parameters based on experimental data. When electron doping consistent with the
hole doping of the superconducting RuO2 planes is included, we obtain (for
reasonable parameters) a double-exchange model with infinite antiferromagnetic
coupling between itinerant electrons and localized spins. This model is
equivalent to one used before [H. Aliaga and A. A. Aligia, Physica B 320, 34
(2002)] which consistently explains the seemingly contradictory magnetic
properties of RuSr2(Eu,Gd)Cu2O8.
