/* From: "COMPUTATIONAL PHYSICS, 2nd Ed" by RH Landau, MJ Paez, and CC Bordeianu Copyright Wiley-VCH, 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; and CC Bordeianu, Univ Bucharest, 2007. Support by National Science Foundation */ /* LaplaceLine.java: Laplace eqn via finite difference mthd wire in grounded box, Output for 3D gnuplot */ import java.io.*; public class LaplaceLine { static int Nmax = 100; // Size of box public static void main(String[] argv) throws IOException, FileNotFoundException { double V[][] = new double[Nmax][Nmax]; int i, j, iter; PrintWriter w = new PrintWriter // Save data in file (new FileOutputStream("LaplaceLine.dat"), true); // Initialize for (i=0; i