The equilibrium density of two‐dimensional electron gas in a modulation‐doped AlGaAs/GaAs heterojunction structure has been studied by considering the deep electron traps (i.e.,DXcenter) in doped AlGaAs layer, the spatial distribution of electrons in three conduction‐band minima (&Ggr;,L, andX), and the heavy doping effect. It is shown that the amount of conduction band‐bending increases and the equilibrium density of two‐dimensional electron gas decreases significantly as a result of incorporating these effects.