/**copyright by Emanuele Dalla Torre - Technion 2002*/ class KPBand { double minZ, maxZ; boolean conduction; KPBand(double minZ, double maxZ, boolean conduction) {this.minZ=minZ; this.maxZ=maxZ; this.conduction=conduction;} double derivate(KronigPenney kp) { //System.out.print(start+" "+step+"\n"); final int N=20; final long pointsNumber=(long)10000; double[] k=new double[N], z=new double[N]; double start=conduction?minZ:maxZ, end=conduction?maxZ:minZ; double step=(end-start)/pointsNumber; //take data int n=N;//needed for NaN! for(int j=0;j