Say you want to calculate degree of ionization for different gases in atmosphere of a star with abundances similar to those in Sun (let's assume you only have hydrogen, helium and sodium) over the temperature range (from 2000 K to 45000 K for example) using Saha equation:
$$\frac{n_{i+1}}{n_i}=\frac{g_{i+1}}{g_i} \frac{2}{n_e} \frac{{(2\pi m_e)}^{3/2}}{h^3} {(k_B T)^{3/2}} e^{-\chi /k_B T}$$,
which you write down for all three elements and of course next to abundances and temperature you also know ionization potentials $\chi$ for each element.
How can one calculate electron density in that case and how does it change? I understand, that at lower temperatures number of electrons is equal to number of ionized sodium atoms since it is the easiest to ionize (and in general $n_e=n_H^1+n_{He}^1+n_{Mg}^1$, where 1 means first level of ionization) but that doesn't help much. And additional question: should higher levels of ionization be included, given the temperature?