Lusares Notes Ra#9
Lusares Notes Ra#9
Lusares Notes Ra#9
For a function F(x,y) that depends on more than one independent variable, the partial
derivative of the function with respect to a particular variable is the derivative of the function
with respect to that variable while holding the other variables constant. For a function of two
independent variables x and y, the partial derivatives are 𝜕𝐹(𝑥, 𝑦)/𝜕𝑥 (y held constant) and
𝜕𝐹(𝑥, 𝑦)/𝜕𝑦 (x held constant). There are three second-order partial derivatives for the function
F(x,y): 𝜕 2 𝐹(𝑥, 𝑦)/𝜕𝑥 2 , 𝜕 2 𝐹(𝑥, 𝑦)/𝜕𝑥𝜕𝑦 and 𝜕 2 𝐹(𝑥, 𝑦)/𝜕𝑦 2.
Elliptic, Parabolic and Hyperbolic Partial Differential Equations
A general form of the partial differential equation (up to the second order) is
Elliptic equations are often used to describe the steady-state value of a function in two
dimensions. Parabolic partial differential equations are often used to describe how a quantity
varies with respect to both distance and time. The onedimensional thermal diffusion equation
describing the temperature T = F(x,t) at position x and time t in a material with thermal
diffusion coefficient K is an example of a parabolic equation (a = b = 0, c = K, thus b 2 – 4ac =
0). A similar equation, Fick's Second Law, describes the diffusion of molecules or ions in
solution, diffusion of dopant atoms into a semiconductor, and so on.
Hyperbolic partial differential equations, involving the second derivative with respect
to time, are used to describe oscillatory systems. The wave equation in one dimension,
describes the vibration of a violin string. Equation 12-4 is an example of a hyperbolic partial
differential equation (a = -k, b = 0, c = 1, thus b2 – 4ac = 4k). Other applications include the
vibration of structural members or the transmission of sound waves.
Elliptic Partial Differential Equations
Elliptic equations describe the value of a function in two spatial dimensions. Elliptic
partial differential equations have boundary conditions which are specified around a closed
boundary, while hyperbolic and parabolic partial differential equations have at least one open
boundary. Since the values are specified around a closed boundary, the equation describes a
steady-state condition.
Solving Elliptic Partial Differential Equations: Replacing Derivatives with Finite
Differences
In Chapter 6 we used the following approximation for a derivative
where h was a suitably small value. Equation 12-5 is the forward difference equation. The
corresponding backward difference equation is
For a partial derivative involving two independent variables, the finite difference
equation will involve suitable small differences in both x and y. We will use h and k to represent
these differences. The forward and backward difference equations corresponding to 12-5 and
12-6 are
Since we have used the forward difference equation 12-9 to calculate the partial derivative, we
can use backward differences for dF/dx in order to eliminate bias. The result is
Thus, for example, Laplace's equation (12-2) is rewritten as
Our approach for solving these problems will be to subdivide the region of interest into
a lattice of mesh size h x k and write the difference equations that correspond to the lattice
points, to obtain values of the function at each lattice point. For the general lattice point x i, yi
the derivative expression is
For the case where h ≠ k, an expression for F(x,y) can readily be obtained from equation
12- 14.
Note that four lattice points are involved in the calculation of F(x,y) by equation 12-
16, as represented in Figure 12-1. This representation is sometimes referred to as the stencil of
the method.
An Example: Temperature Distribution in a Heated Metal Plate
A typical example of an elliptic partial differential equation involves the solution of a
steady-state heat-flow problem. For example, if a thin steel plate, 10 x 10 cm, has one of the
edges held at 100°C and the other three edges at 0°C, what are the steady-state temperatures
within the plate? For simplicity, we assume that heat is not lost through the faces of the plate.
We subdivide the plate by means of a grid with h = k = 0.5 cm, thus creating a lattice
of size 20 x 20. At equilibrium, heat flows in the x-axis direction into a lattice element at a rate
proportional to the temperature of the adjoining element in the x-axis, and flows out of the
element at a rate proportional to the temperature of the element. The same is true in the y-axis
direction. This model gives rise to an elliptic partial differential equation of the form of
equation 12-2. The time and the thermal conductivity k of the material do not enter into the
equation.
We will use equation 12-16 to calculate the temperature at each lattice point; the
temperature at a lattice point is the average of the temperatures of the four surrounding lattice
points. Thus, we have generated a system of 400 simultaneous linear equations in 400
unknowns. Although most of the terms in a given equation are zero, the problem is still
unmanageable. However, we can solve the system by an iterative method, as described below.
Figure 12-2 shows part of the spreadsheet used to solve the system; each cell of the 20
x 20 array corresponds to a lattice point. The formula in cell B6 is
=(B5+A6+C6+B7)/4
You can Fill Down the formula into 20 rows and then Fill Right into 20 columns to create the
20 x 20 array.
Since cell B6 refers to cell B7 and B7 similarly refers to B6, we have created a circular
reference, a formula that refers to itself, either directly or indirectly. In fact, the spreadsheet
contains a large number of circular references. A circular reference is usually an error; Excel
displays the "Cannot resolve circular references" error message and puts a zero in the cell. In
this case, however, the circular reference is intentional. We can make Excel recalculate the
value in each cell, using the result of the previous iteration.
where K is the coefficient of thermal conductivity (cal s -1 cm-1 deg-1), A is the cross-sectional
area of the rod (cm2) and dT/dx is the temperature gradient. The minus sign is required because
temperature gradients are negative (heat flows from a higher temperature to a lower). The
material of which the rod is made has heat capacity c (cal g -1 deg-1) and density ρ(g – cm-3).
The heat flow (cal s-1) out of the volume element, at point x + dk, is given by
From equations 12 – 17 and 12 – 18, the rate of increase of heat stored in the element
Adx is Hin – Hout, and this is equal to the expression in 12-19
we can replace derivatives by finite differences, using the central difference formula for
𝜕 2 𝐹/𝜕𝑥 2
When these are substituted into equation 12-22, we obtain equation 12-25, where 𝑟 =
∆𝑦/(𝑘 (∆𝑥 )2). (Using forward and central differences simplifies the expression.)
Equation 12-25a permits us to calculate the value of the function at time t +l based on
values at time t. This is illustrated graphically by the stencil of the method.
An alternative to the use of equation 12-25 is to choose Δx and Δy such that r = 0.5
(e.g., for a given value of Δx, Δy = k(Δx2)/2), so that equation 12-25 is simplified to
Cells K3:K9 contain constants used in the calculations; these cells were assigned the
names shown in parentheses in column M. The formulas in cells K6, K7, K8 and K9 are,
respectively
=k/(hcap*rho) (coefficient k in general PDE, equation 12-22)
=D12-C12 (Δx)
=B14-B13 (Δt)
=e*Dt/(Dx^2) (f)
[In the spreadsheet, the range name f was used for the parameter Y in equation 12-26,
since r can't be used as a name in Excel.]
The values in cells on the edges of the table of temperatures (column C and column M)
are the constant temperature values at the ends of the rod; the values in row 13 are the initial
temperature of the interior of the rod. The formula in the remaining cells in the body of the
temperature table (D14:L113) is based on equation 12-22. For example, the formula in cell D14
is
=f*(C13+E13)+(1-2*f)*D13
Experience has shown that the factor f must be less than 1/2 in order to avoid instability
in the calculations. For a given problem, this requires adjustment of both Δx and Δt.
Equation 12-27a or 12-28 shows that Fx,t+1 is a function of yet-to-be calculated values
at t+1 (Fx-1,t+1 and Fx+1,t+1) in addition to known values at time t (the quantities on the right-hand
side of the equation). This is illustrated by the stencil of the method shown in Figure 12-7.
Equation 12-27a results in a set of simultaneous equations at each time step. Again, the solution
procedure is best illustrated by means of an example.
where p is the vapor pressure and D is the diffusion coefficient in units of cm2 s-1. For water
vapor, D = 0.115 cm2 s-1 at 30°C.
We subdivide the length of the tube into uniform subintervals and calculate the value
of the function (here the vapor pressure p) at each interior point. Choosing Δx = 4 yields four
x values where the function value needs to be evaluated (at x = 4, 8, 12 and 16 cm) and two
boundary values where it is known (at x = 0 and 20). Also, using Δx = 4 and r = 1 sets Δt = 139
seconds.
Using equation 12-28 yields four simultaneous equations in four unknowns, thus:
For r = 1, the values of the coefficients for the four simultaneous equations are shown
in the spreadsheet in Figure 12-8. They are designated cl, c2, c3 and c4 in the table. These
coefficients will have different values if a different value of r is chosen. The constants (the
values of the right-hand side of the four equations) are also shown in Figure 12-8. The formulas
in cells I15:L15 are
=C15+E15+C15
=D15+F15
=El5+G15
=F15+H15+H15
The set of simultaneous equations can be solved by methods described in Chapter 9. In
this case the solution was found by the matrix inversion method; the array formula in cells
D19:G19 is
{=MMULT(I15: L15,MlNVERSE($D$9:$G$l2))}
A plot of the results, shown in Figure 12-9, indicates that a smaller increment oft is
required. In the preceding example, the parameter r was set equal to 1, which simplifies the
equations but also determines the values oft that were used in the calculations. In most cases it
will probably be desirable to solve the system at specified values oft. Choosing specific values
for Δx and Δt determines the value of r. The following example, using the same data as Example
12-3, illustrates this.
describes the vibration (i.e., the lateral displacement y) of a string of length L, weight W,
tension T and weight/unit length w = W/L, as a function of distance x along the length of the
string.
Solving Hyperbolic Partial Differential Equations: Replacing Derivatives with Finite
Differences
Once again, we can solve the problem by replacing derivatives by finite differences.
If the value of the function is not zero at t = 0, a different method of beginning the
solution must be used.
An Example: Vibration of a String
A string 50 cm long and weighing 0.5 g is under a tension of 33 kg. Initially the mid-
point of the string is displaced 0.5 cm from its equilibrium position and released. We want to
calculate the displacement as a function of time at 5 cm intervals along the length of the string,
using equation 12-34. From equation 12- 35, the Δt must be 8.8 x 10-5 seconds.
The spreadsheet shown in Figure 12-14 illustrates the solution of the vibrating string
problem. Column B contains time in increments of Δt from zero to 2.8 x seconds (only part of
the spreadsheet is shown). The first row of displacement values (row 12, values shown in bold
on the spreadsheet) are the initial conditions. The values in the second row (row 13, values in
italics) are calculated according to equation 12-36; the formula in cell D13 is
=(C12+E12)/2
Values in subsequent rows (rows 14-27 in Figure 12-14; rows 14-44 on the CD-ROM)
are calculated according to equation 12-34; the formula in cell D14 is
=C13+E13-D12
If you examine the values in the table, you will see that 20-time increments constitute
a complete cycle of vibration. This vibration time, 0.001758 seconds, corresponds to a
frequency of 569 s-1, and agrees exactly with the value calculated by the formula
The above procedure can be expanded to model vibrations in two space dimensions.