A semicondcutor contains free electrons with concentration n, free holes with concentration p and donor doping concentration Nd and acceptor concentration Na. The metal has electrons with electron concentration n and positive metal ions say also Nd+. Before contacting every material is neutral such that the whole positive charges = whole negative charges. When contacting both materials they exchange electrons at the interface to reach equilibrium. In any point in the interface region which is at the same time a space charge region the space charge density at any position x, roh(x) can be expressed by roh(x)= q( Nd+ + p - Na- - n) = the positive space density at any point x - the negative charge density. Nd+ is the ionized donor ions only and Na- is the ionized acceptor ions only.