/* From: "A SURVEY OF COMPUTATIONAL PHYSICS" by RH Landau, MJ Paez, and CC Bordeianu Copyright Princeton University Press, Princeton, 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; & CC Bordeianu, Univ Bucharest, 2007 Support by National Science Foundation * * sqwell.java: Solves the time-dependent Schroedinger equation for a * Gaussian wavepacket in a infinite square well potential * comment: Output data is saved in 3D grid format used by gnuplot. */ import java.io.*; public class sqwell { public static void main(String[] argv) throws IOException, FileNotFoundException { PrintWriter w = new PrintWriter(new FileOutputStream("sqwell.dat"), true); double psr[][]=new double[751][2]; double psi[][]=new double[751][2]; double p2[]=new double[751]; double dx,k0,dt,x,pi; int i,n,max; max = 750; pi = 3.14159265358979323846; dx = 0.02; k0 = 17.0*pi; dt = dx*dx; //initial conditions x = 0.0; for( i=0;i