/* From: "A SURVEY OF COMPUTATIONAL PHYSICS" by RH Landau, MJ Paez, and CC BORDEIANU Copyright Princeton University Press, Princeton, 2008. Electronic Materials copyright: R Landau, Oregon State Univ, 2008; MJ Paez, Univ Antioquia, 2008; and CC BORDEIANU, Univ Bucharest, 2008. Support by National Science Foundation */ // eqheat.c: Solution of heat equation using with finite differences #include #include #define size 101 // grid size #define max 30000 // iterations #define thc 0.12 // thermal conductivity #define sph 0.113 // specific heat #define rho 7.8 // density main() { int i,j; double cons, u[101][2]; FILE *output; // save data in eqheat.dat output= fopen("eqheat.dat","w"); // t = 0 points are 100C for (i = 0; i