HeatEqTutorial

HeatEqTutorial - Using EXCEL Spreadsheets to Solve a 1D...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Using EXCEL Spreadsheets to Solve a 1D Heat Equation The goal of this tutorial is to create an EXCEL spreadsheet that calculates the numerical solution to the following initial-boundary value problem for the one-dimensional heat equation: The basic idea of the numerical approach to solving differential equations is to replace the derivatives in the heat equation by difference quotients and consider the relationships between u at (x,t) and its neighbours a distance Δ x apart and at a time Δ t later. In particular, in this tutorial the following expressions will be used: a forward difference in time: and a central difference in space: By rewriting the heat equation in its discretized form using the expressions above and rearranging terms, one obtains Hence, given the values of u at three adjacent points x x , x , and x x at a time t , one can calculate an approximated value of u at x at a later time t t . Using EXCEL spreadsheets allows you to perform these calculations repeatedly and effortlessly. The
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
following are the necessary steps to set up a spreadsheet to calculate the solution to the initial-boundary value problem shown above. 1. How to Tabulate the Spatial Interval 2. How to Tabulate the Time Interval 3. How to Include the Initial Condition 4. How to Include the Boundary Conditions 5. How to Compute the Numerical Solution 6. How to Plot the Solution 7. How to Implement Derivative Boundary Conditions Step 1: How to Tabulate the Spatial Interval The first step is to tabulate the sample points in the spatial interval . Subdivide the interval [0, 1] into N+1 equally-spaced sample points a distance Δ x apart. In a blank EXCEL spreadsheet, enter the sample points along a row, as shown below. For this tutorial, let Δ x = 0.05 and N = 19. Note that the value of Δ x is shown in cell C2. Each sample point is calculated as for n = 1, . .. N and x 0 = 0. For example, in the spreadsheet below the first sample point in the interval is x 1 = x 0 + 0.05. The value of x 1 is shown in cell E5: it is computed by addying the fixed space increment (cell C2) to the value contained in the cell to the immediate left of E5 (cell D5). The expression in the formula box in the image below shows the specific EXCEL formula used to compute the value in cell E5. Step 2: How to Tabulate the Time Interval The second step is to tabulate the time interval . Subdivide the interval [0,T] into M+1 equal time levels Δ t long. Enter the time levels in a column in the EXCEL spreadsheet, as shown below. For this tutorial, let Δ t = 0.004 and M = 20. Note that the value of Δ t is shown in cell F2. Each time level is calculated as
Background image of page 2
for k = 1, . .. M and t 0 = 0. For example, in the spreadsheet below the second time level is t 2 = t 1 + 0.004. The value of t 2 is shown in cell B9: it is computed by adding the fixed time increment (cell F2) to the value contained in the cell immediately above B9 (cell B8). The expression in the formula box in the image below shows the specific EXCEL
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/04/2011 for the course MATH 25 taught by Professor Lo during the Spring '11 term at BC.

Page1 / 7

HeatEqTutorial - Using EXCEL Spreadsheets to Solve a 1D...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online