Calculation of the energy levels in quantum dots