public double[] getEigenEnergy() {
        if (eigenEnergy != null) {
            return eigenEnergy;
        }
        ArrayList<Double> eigenEnergyList = new ArrayList<Double>();

        // Among all intervals we are looking for those which are truly quantum wells, they bring all the information.
        for (int i = 1; i < intervals.size() - 1; i++) {
            if (intervals.get(i).getY() <= intervals.get(i - 1).getY() && intervals.get(i).getY() < intervals.get(i + 1).getY()) {
                for (double e : findIntervalEigenEnergies(i)) {
                    if (!eigenEnergyList.contains(Double.valueOf(e))) {
                        eigenEnergyList.add(new Double(e));
                    }
                }
            }
        }
        eigenEnergy = new double[eigenEnergyList.size()];
        for (int i = 0; i < eigenEnergy.length; i++) {
            eigenEnergy[i] = Double.valueOf(eigenEnergyList.get(i));
        }
        return eigenEnergy;
    }