<?xml version="1.0"?>
<!DOCTYPE report SYSTEM "chrome://media/structure/academic-entities.dtd">

<?xml-stylesheet type="text/css" href="../../media/style/report.css" ?>

<!-- This file is located at: 
http://www.bath.ac.uk/%7Epy8ieh/a/academic/laplace-heatflow/
  -->

<report xmlns="http://www.bath.ac.uk/%7Epy8ieh/media/structure/report"
        xmlns:math="http://www.w3.org/Math/MathML" 
        xmlns:html="http://www.w3.org/TR/REC-html40"> <!-- XXX -->

   <header>

      <title> An experimenal and theoretical investigation of the role of Laplace's equation in heat flow </title>
      <author> Ian Hickson </author>
      <credit title="Tutor"> Dr Laughton </credit>
      <address> Department of Physics <br/> University of Bath <br/> Bath BA2 7AY </address>
      <date> May 2000 <br/> (2nd Year) </date>
      <abstract> Heat flow data is collected from a plate with a
      heater on only one side so that theoretical models of heat flow
      can be compared. Both numerical and analytical methods are then
      applied, using the C programming language. It is found that both
      systems return similar results, but that the results do not
      perfectly model the real data due to the naivety of the boundary
      conditions. </abstract>

   </header>

   <body>

      <introduction>

         <p>This is an investigation into the application of the
         steady-state heat flow equations to a thin aluminium plate,
         and the role of Laplace's equation in heat flow. Actual,
         measured results will be compared with results derived from
         numerical analysis and analytical theory.</p>

         <p>The two dimensional Laplace equation [1] is shown in
         equation 1, where <var>T</var>(<var>x</var>, <var>y</var>) is
         the temperature at point (<var>x</var>, <var>y</var>) on the
         plate.</p>

         <html:table>
           <html:caption>Equation 1</html:caption>
           <html:tr>
             <html:td>
               <html:table>
                 <html:tr>
                   <html:td> &#x2202;<sup>2</sup> </html:td> 
                 </html:tr>
                 <html:tr>
                   <html:td> &#x2202;<var>x</var><sup>2</sup> </html:td> 
                 </html:tr>
               </html:table>
             </html:td>
             <html:td>
               <var>T</var>(<var>x</var>, <var>y</var>)
             </html:td>
             <html:td>
               +
             </html:td>
             <html:td>
               <html:table>
                 <html:tr>
                   <html:td> &#x2202;<sup>2</sup> </html:td> 
                 </html:tr>
                 <html:tr>
                   <html:td> &#x2202;<var>y</var><sup>2</sup> </html:td> 
                 </html:tr>
               </html:table>
             </html:td>
             <html:td>
               <var>T</var>(<var>x</var>, <var>y</var>)
             </html:td>
             <html:td>
               = 0
             </html:td>
           </html:tr>
         </html:table>

         <p>The temperature distribution of a plate can be described
         by equation 1 once it has stablised to a static pattern. This
         is when all time derivatives are zero. (The third dimension
         has been ignored since the plate used is of negligible depth
         and thus the problem can be approximated to a two-dimensional
         one.)</p>

         <p>Mapping this on to a discrete grid, we find equation 2.
         (The complete derivation is given in the Laboratory Manual
         and so will not be quoted in full here.)</p>

         <html:table>
           <html:caption>Equation 2</html:caption>
           <html:tr>
             <html:td>
               <var>T</var><sub><var>i</var> , <var>j</var></sub> = 
             </html:td>
             <html:td>
               <html:table>
                 <html:tr>
                   <html:td>
                     (
                     <var>T</var><sub><var>i</var>+1 , <var>j</var></sub> 
                     +
                     <var>T</var><sub><var>i</var>-1 , <var>j</var></sub>  
                     +
                     <var>T</var><sub><var>i</var> , <var>j</var>+1</sub>  
                     +
                     <var>T</var><sub><var>i</var> , <var>j</var>-1</sub>  
                     )
                   </html:td>
                 </html:tr>
                 <html:tr>
                   <html:td>
                     4
                   </html:td>
                 </html:tr>
               </html:table>
             </html:td>
           </html:tr>
         </html:table>

         <p>This equation will be used in the numerical analysis.</p>

         <p>The analytic form of the temperature profile can be found
         by summing the solutions obtained using separation of
         variables. (Again, a full derivation is provided in the
         Laboratory Manual). This gives equations 3 and 4.</p>

         <html:table>
           <html:caption>Equation 3</html:caption>
           <html:tr>
             <html:td>
               <var>T</var>(<var>x</var>, <var>y</var>) = <var>T</var><sub>1</sub> + 
             </html:td>
             <html:td>
               <html:table class="underover">
                 <html:tr>
                   <html:td>
                     &#x221E;
                   </html:td>
                 </html:tr>
                 <html:tr>
                   <html:td>
                     &#x2211;
                   </html:td>
                 </html:tr>
                 <html:tr>
                   <html:td>
                     odd <var>n</var>
                   </html:td>
                 </html:tr>
               </html:table>
             </html:td>
             <html:td>
               <var>c</var><sub><var>n</var></sub> sin 
             </html:td>
             <html:td>
               <html:table>
                 <html:tr>
                   <html:td>
                     <var>n</var>&#x03C0;<var>x</var>
                   </html:td>
                 </html:tr>
                 <html:tr>
                   <html:td>
                     15
                   </html:td>
                 </html:tr>
               </html:table>
             </html:td>
             <html:td>
               sinh <var>n</var>&#x03C0;(1-<var>y</var>/15)
             </html:td>
           </html:tr>
         </html:table>

         <html:table>
           <html:caption>Equation 4</html:caption>
           <html:tr>
             <html:td>
               <var>c</var><sub><var>n</var></sub> =
             </html:td>
             <html:td>
               <html:table>
                 <html:tr>
                   <html:td>
                     4(<var>T</var><sub>2</sub><var>T</var><sub>1</sub>)
                   </html:td>
                 </html:tr>
                 <html:tr>
                   <html:td>
                      <var>n</var>&#x03C0; sinh <var>n</var>&#x03C0;
                   </html:td>
                 </html:tr>
               </html:table>
             </html:td>
             <html:td>
               
             </html:td>
             <html:td>
               <var>n</var>= 1, 3, 5...
             </html:td>
           </html:tr>
         </html:table>

         <p>These will be written into a program in the section on Analytic Theory.</p>

      </introduction>

      <section title="1. Experimental Setup">

         <p>The experimental setup (figure 1) consisted of a
         temperature-controlled water bath with a pump in it. Water
         flowed in channels along the two sides and the bottom of a
         thin 15cm&#x00D7;15cm aluminium plate. This was designed to
         anchor the temperature along those edges to the temperature
         of the water bath. The top of the plate was in contact with a
         heater which was used to raise the plate temperature at that
         point above the water bath temperature.</p>

         <p>The front of the plate was covered with a thermochromatic
         liquid crystal display (similar to that used in hospitals to
         measure a patient's temperature). The liquid crystal only has
         a very narrow operational temperature range (302K to 308K) so
         the bath temperature was carefully set to be within this
         range (303K).</p>

         <figure>
            <html:div style="width: 209.973mm">
              <html:img src="method.gif" alt="Eek! please e-mail me to ask me what this diagram is -- I haven't had the time to write alternative text it seems!"/>
            </html:div>
            <caption num="1"> Apparatus for measuring heatflow in an aluminium plate. </caption>
         </figure>
         
         <p>The temperature of each point on the surface of the plate
         on a 10&#x00D7;10 grid of points 1.5cm apart was taken using a
         hand held optical pyrometer. This is a device that measures
         the temperature at a point based on its infra-red black body
         spectrum. </p>

         <p>To reduce error in the results, the data was collected in
         a random order, and three data points were collected per
         point on the grid.</p>

      </section>

      <section title="2. Numerical Analysis">

        <p>The C program which used the numerical analysis to model
        the heat flow is very simple. Using a custom made library for
        dynamic 2D arrays, a 10&#x00D7;10 matrix is seeded with the
        values at the edge of the plate.</p>

        <p>The iterative process of finding the values for all the
        points until they converge is then begun. I used the following
        convergence criterion: all points must change by less than
        0.001 (the constant <code>MIN_CHANGE</code>) in a single sweep
        before stopping. The core of the iteration code looks like the
        following.</p>

<source>
  <strong>matrix</strong>* plate;
  <strong>mNumber</strong> before, after;
  <strong>int</strong> x, y, changed;
  <strong>do</strong> {
    changed = FALSE;
    <strong>for</strong> (x = 1; x &lt; plate->width-1; x++) {
      <strong>for</strong> (y = 1; y &lt; plate->height-1; y++) {
        before = mGet(plate, x, y);
        after = (mGet(plate,x+1,y)+
                 mGet(plate,x,y+1)+
                 mGet(plate,x-1,y)+
                 mGet(plate,x,y-1)) / 4;
        mSet(plate, x, y, after);
        changed = changed || (fabs(before-after) &gt; MIN_CHANGE); 
      }
    }
  } <strong>while</strong> (changed);
</source>

      </section>

      <section title="3. Analytical Theory">

         <p>This applies equation 3 and 4 to each point in turn. This
        time, the following convergence criterion was employed: the
        total change caused by that iteration must be less than 0.001
        (the constant <code>MIN_CHANGE</code>).</p>

        <p>Note that in the code below, <code>x</code> and
        <code>y</code> are the indices into the matrix, and
        <code>xx</code> and <code>yy</code> are the distances to the
        point on the plate. This is why there is a conversion between
        the two at the top of each loop.</p>

<source>
  <strong>matrix</strong>* plate;
  <strong>mNumber</strong> xx, yy, value, delta;
  <strong>int</strong> x, y, n;
  <strong>for</strong> (x = 0; x &lt; plate-&gt;width; x++) {
    xx = x*(15.0/9.0);
    <strong>for</strong> (y = 0; y &lt; plate-&gt;height; y++) {
      yy = y*(15.0/9.0);
      value = BATH_TEMPERATURE;
      n = 1;
      <strong>do</strong> {
        delta = (((4*(HEATER_TEMPERATURE-BATH_TEMPERATURE))/(n*M_PI*sinh(n*M_PI))) 
                 * sin((n*M_PI*xx)/15) * sinh(n*M_PI*(1-(yy/15))));
        value += delta;
        n += 2;
      } <strong>while</strong> (fabs(delta) &gt; MIN_CHANGE);
      mSet(plate, x, y, value);
    }
  }
</source>

      </section>

      <section title="4. Results">

        <p>The results of the measured data collection are shown in
        graph 1. Graph 2 and 3 show the results of the numerical
        analysis and analytical theory respectively.</p>

        <p>The differences between the three are quite striking, and so are the similarities.</p>

        <subtitle>Defects in the Measured Data Plot</subtitle>

        <p>The measured data has some distinct trends in its defects.
        For example, at the points (4,8) to (4,5) and (7,8) to (7,4),
        the heat has not propagated uniformly down the plate, leaving
        characteristic spikes along all the contour lines on the
        <var>x</var>=4 and <var>x</var>=7 lines.</p>
        
        <p>Another defect occurs at (8,8), where some problem in the
        plate has prevented a small section from warming up.</p>

        <p>These errors are probably due to the structure of the plate
        -- there may be strengthening bars behind the <var>x</var>=4
        and <var>x</var>=7 lines for instance.</p>

        <p>Note that the downwards peak at (6,8) is not actually a
        downwards peak at all, but all that remains of the contour
        after the above mentioned defects have been applied to it.</p>

        <subtitle>Theoretical Analyses </subtitle>

        <p>In the numerical anaylsis, it was assumed that all 10
        points on the top row were at the heater temperature. This was
        clearly not the case, and in fact it is likely that the heater
        did not cover the entire top section of the flat plate at all.
        The analytical theory took this into account, and so matches
        the real map a lot more at the top corners.</p>

        <p>In all other respects, the temperatures predicted by the
        numerical and theoretical analyses are very similar to each
        other, and rather different from the actual data. The most
        likely reason for this is incorrect seeding -- the algorithms
        used a single value for the "Bath Temperature" (28&#x2103;),
        whereas the real data plot indicates that the temperature
        along the edges of the plate was not uniform as it should have
        been. This is an area for future research.</p>

      </section>

      <conclusion>

        <p>The plate we used was not perfect, and a lack of structural
        uniformity is very probable. This would explain the systematic
        error present.</p>

        <p>The theoretical methods were not very realistic in
        comparison to the real data, but this may also have been due
        to errors in the measurement of the water temperature which
        was used to seed the theoretical data, rather than a failing
        in the theory.</p>

      </conclusion>

      <appendix title="A. Acknowledgements">

        <p>Thanks go to my lab partner, Rebecca Harrod, for helping
        with the data collection, and to Dr Knight, for agreeing to
        let me perform the analysis in C instead of using MathCAD.</p>

      </appendix>

      <appendix title="B. Source">

        <p>Attached are <code>dynamic-2d-arrays.c</code>,
        <code>matrix.c</code>, <code>numerical.c</code>, and
        <code>analytical.c</code>.</p>

        <p><code>dynamic-2d-arrays.c</code>: A custom built set of
        generic routines to implement dynamic arrays.</p>

        <p><code>matrix.c</code>: An extension to the dynamic arrays
        routines which implement an easy to use numeric array.</p>

        <p><code>numerical.c</code>: The source to the Numerical
        Analysis part of the investigation.</p>

        <p><code>analytical.c</code>: The source to the Analytical
        Theory part of the investigation.</p>

      </appendix>

      <references style="byid">

        <p>There aren't many books on Laplace's Equation for Heat Flow.</p>

        <p>After looking through almost <em>every</em> book on the
        sixteen shelves in the Library and Learning Centre which cover
        the subject of Thermodynamics in all its forms, I ended up
        with only eight books which even <em>mention</em> Laplace in
        their index.</p>
        
        <p>The first [1] simply quotes the two dimensional form of
        Laplace's equation for steady state, and then goes on to talk
        about Liapounoff stability.</p>
        
        <p>The second [2] quotes Laplace:</p> 

        <blockquote>
          <p>Probability Theory is nothing but common sense reduced to
          calculation...</p>
        </blockquote>

        <p>...and says that Laplace was a proponent of the classical
        "if we know all the starting conditions then we can work out
        the future" school of thought.</p>

        <p>The third [3] mentions Laplace in passing, in a footnote no
        less, saying that he was on the panel of judges of the Paris
        Institute [4] which awarded Fourier the 1811 mathematics prize
        for a competition whose subject was the propagation of heat in
        solid bodies, and that Laplace, together with Lagrange,
        Legendre, Malus, and Ha&#x00Fc;y, was quite critical of
        Fourier's work, saying:</p>

        <blockquote>
          <p>[...] that the way the author arrives at his equations is
          not exempt from difficulties, and his analysis still leaves
          something to be desired, be it in generality, be it even in
          rigour. </p>
        </blockquote>

        <p>It should be noted at this point that Lagrange features
        much more frequently in the indexes of the Thermodynamics
        books that I looked through.</p>

        <p>The next book [5] can hardly be said to mention Laplace at
        all, given that it refers to him only to mention the Laplacian
        operator and Laplace's law of atmospheric pressure. Similarly
        for another book [6] which merely mentions that he proved that
        a certain expression first obtained by Newton was really
        adiabatic compressibility. </p>

        <p>The penultimate book [7] refers to Laplace's Principle of
        Insufficient Reason: </p>

        <blockquote>
          <p>In the absence of evidence to the contrary, all possible
          outcomes are equally probable.</p>
        </blockquote>

        <!-- ...which falls into the "Well, Duh" category. -->

        <p>And finally, the last book [8] that refers to Laplace in
        it's index, unfortunately refers to the well known
        <!--[sic]--> Laplace equation for the excess pressure inside a
        liquid drop, and not the equation for heat flow.</p>
         
        <ref id="1">
          <author>H. J. Kreuzer</author> 
          <pubyear>1981</pubyear> <!--<chapter></chapter>-->
          <resource>Nonequilibrium Thermodynamics and its Statistical Foundations</resource>
          <publisher location="Oxford, UK">Clarendon Press</publisher>
          <page>73</page>
        </ref>
         
        <ref id="2">
          <author>Myron Tribus</author> 
          <pubyear>1961</pubyear>  <!--<chapter></chapter>-->
          <resource>Thermostatics and Thermodynamics</resource>
          <publisher location="Princeton, New Jersey">D. Van Nostrand Company, Inc.</publisher>
          <page>29</page>
        </ref>
         
        <ref id="3">
          <author>C. Truesdell</author> 
          <pubyear>1980</pubyear>  <!--<chapter></chapter>-->
          <resource>The Tragicomical History of Thermodynamics</resource>
          <publisher location="New York, USA">Springer-Verlag</publisher>
          <page>55</page>
        </ref>

        <ref id="4">
          <author>School of Mathematics and Statistics</author> 
          <pubyear>2000</pubyear> 
          <resource>The MacTutor History of Mathematics archive</resource>
          <publisher location="Scotland, UK">University of St Andrews</publisher>
          <uri>http://www-groups.dcs.st-and.ac.uk/~history/Mathematicians/Laplace.html</uri>
        </ref>
         
        <ref id="5">
          <author>Y. Rocard</author> 
          <pubyear>1961</pubyear>  <!--<chapter></chapter>-->
          <resource>Thermodynamics</resource>
          <publisher location="London, UK">Sir Isaac Pitman &amp; Sons, Ltd.</publisher>
          <page>675</page>
        </ref>
         
        <ref id="6">
          <author>Mark W. Zemansky, Ph.D.</author> 
          <pubyear>1968</pubyear>  <!--<chapter></chapter>-->
          <resource>Heat And Thermodynamics, An Intermediate Textbook</resource>
          <publisher location="Tokyo, Japan">K&#x014D;gakusha Company, Ltd.</publisher>
          <page>134</page>
        </ref>
         
        <ref id="7">
          <author>Don C. Kelly</author> 
          <pubyear>1973</pubyear>  <!--<chapter></chapter>-->
          <resource>Thermodynamics and Statistical Physics: An Elementary Treatment with Contemporary Applications</resource>
          <publisher location="London, UK">Academic Press, Inc.</publisher>
          <page>189</page>
        </ref>
         
        <ref id="8">
          <author>Dilip Kondepudi, Ilya Prigogine</author> 
          <pubyear>1998</pubyear>  <!--<chapter></chapter>-->
          <resource>Modern Thermodynamics: From Heat Engines to Dissipative Structures</resource>
          <publisher location="West Sussex, UK">John Wiley &amp; Sons Ltd.</publisher>
          <page>145</page>
        </ref>

      </references>

   </body>

</report>
