  In order to test planetary accretion and differentiation scenarios, we
integrated a multistage core-mantle differentiation model with N-body accretion
simulations. Impacts between embryos and planetesimals result in magma ocean
formation and episodes of core formation. The core formation model combines
rigorous chemical mass balance with metal-silicate element partitioning data.
The primary constraint on the combined model is the composition of the Earth's
primitive mantle, the composition of the Martian mantle, and the mass fractions
of the metallic cores of Earth and Mars. The model is refined by least squares
minimization with up to five fitting parameters that consist of the
metal-silicate equilibrium pressure and 1-4 parameters that define the starting
compositions of primitive bodies. This integrated model has been applied to 6
Grand Tack simulations. Investigations of a broad parameter space indicate
that: accretion of Earth was heterogeneous, metal-silicate equilibration
pressures increase as accretion progresses and are 60-70% of core-mantle
boundary pressures at the time of each impact, and a large fraction (70-100%)
of the metal of impactor cores equilibrates with a small fraction of the
silicate mantles of protoplanets during each core formation event. Acceptable
fits to the Earth's mantle composition are obtained only when bodies that
originated close to the Sun, at <0.9-1.2 AU, are highly reduced and those
beyond this distance are increasingly oxidized. The FeO content of the Martian
mantle depends critically on the heliocentric distance at which the
Mars-forming embryo originated. Finally, the Earth's core is predicted to
contain 8-9 wt% silicon, 2-4 wt% oxygen and 10-60 ppm hydrogen, whereas the
Martian core is predicted to contain low concentrations (<1 wt%) of Si and O.
