/* 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; & CC Bordeianu, Univ Bucharest, 2007 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