Home
 

Home

Academia

Products

About Me

 

 

ME303 Project #2: Comparison of Numerical Methods

July 25, 2002

 

 

Discussion

The mathematical model of unsteady heat conduction in a bar with thermal energy generation along the bar is discussed.  This heat conduction can be described using the partial differential equation PDE given in equation 1 along with initial conditions and boundary conditions pre-defined in the handout. 

 

 [1]

 

An analytical solution of this equation is shown in appendix A which involves given specifications from the handout.  Two numerical solutions are also used to solve the PDE.  The first numerical solution involves a FDS method of order 1 to discretize dT/dt and a CDS method of 2nd order is used to discretize d2T/dx2 (See appendix A for sample calculations).  The second numerical method is that of Crank Nicolson to discretize the PDE (See appendix A for sample calculations).   In the numerical methods the temperature along the bar at different times for different step sizes (delta t = 1 and delta t = 2.5) were plotted.  The analytical solution was then compared to the numerical iterations and conclusions were drawn about which numerical method was superior.  

Comparison of Exact to Numerical Solutions using Plots from Excel:

Note: All excel data sheets are included in Appendix B.

The analytical (exact) solution is shown in Figure 1.  The temperature variation along the bar at different points is plotted.  It is shown that the insulation has an effect on the temperature distribution.  The temperature is greater at larger values of L and lower at low values of L indicating that the insulation traps in heat from the bar.  

The exact plot (Figure 1) is visually compared to the numerical solution plots (Figure 2 to 3) which represent CDS/FDS at a step sizes of t = 1 and 2.5 respectively.  It is apparent that graphs become unstable (large fluctuations in Figure 3) and are off by a large magnitude when compared to the exact solution.  This occurs because of the large step size of 2.5 when compared to the smaller step size of 1.  Thus smaller step sizes produce more accurate results when compared to the exact solution.  More instability occurs when the increments of time increase.  Thus to obtain more accurate results for larger times the step size must be decreased accordingly.  This is computationally expensive but is required for increased accuracy. 

Note:  In the CDS/FDS numerical method for step size of 2.5 the steady state solution was not graphed as it was not stable and did not converge to a single point.

If the bar were insulated at the left hand side a steady state solution would not exist.  This is because there is no place for the heat to escape and the bar will continually rise in temperature.

The Crank Nicolson scheme is also used to obtain a solution (Figure 4 and 5) and is visually compared to the exact solution.  It is seen that this method is extremely accurate and stable when compared to the analytical solution at all step sizes and increases in time that were plotted.  It is important to not that when the step size is varied the solution remains very similar. 

It is also noticed that all the numerical plots (CDS/FDS method and Crank Nicolson method) between 8 cm and 10 cm on the bar have flattened out curves.  This is due to the fact that in the numerical solutions the assumption that the temperature was the same at node 5 and node 6 was made.  This assumption is not valid as it would only be true for small distances and 2 cm cannot be considered a small distance.  It was required to make this assumption it was the only way to iterate and formulate a solution.

In conclusion, the most accurate and stable numerical approach is that of Crank- Nicolson.  It is very computationally expensive as four equations with four unknowns must be solved with two boundary conditions.  The numerical method of FDS of 1st order combined with CDS of 2nd order is not very accurate when time is increased and step sizes are large.  This method will only be good for accurate results at larger times when the step size is increased.  In this particular PDE the best method to use when considering ease of computation and accuracy together is the explicit (FDS/CDS) solution at step size of 1 second.

Figure  1 Exact solution

Figure 2 Explicit method using step size of 1 second

 

Figure 3 Explicit method using step size of 2.5 seconds

Figure 4 Crank-Nicolson with step size of 1 second

Figure  5 Crank-Nicolson with step size of 2.5 seconds