Beruflich Dokumente
Kultur Dokumente
6 1. The following conservation equation describes the steady-state temperature distribution in a metal square: 2T 2T + =0 x2 y 2 subject to the following boundary conditions: T T (x, 0) = 0, (x, 1) = 0 y y T (0, y ) = 0, T (1, y ) = f (y )
(a) The centered nite dierence method will be employed to compute the temperature prole in the rectangle. Set up the grid in (x, y ) dimensions, with (i, j ) serving as local indices, as shown below:
(i, j+1)
(i+1, j)
Use three equidistant interior nodes and the same discretization step in both x and y dimensions (i.e. i = 1, . . . , 5, j = 1, . . . , 5 and x = y ). Show the exact form of the equations needed to compute Tij , for i = 2, 3, 4 and j = 2, 3, 4. (b) Use the method of separation of variables to compute an analytic series solution for the above problem. Solution: (a) In the gure below, the shadowed area is the metal square. j = 0, 6 are ctitious nodes due to the boundary conditions on x-sides. The unknown variable is Tij , where the upper
6 5 4
3 2 1 j=0 i=1
Tij
subindex denotes x-coordinate and the lower subindex denotes y-coordinate. The black dots in the gures denote the unknown nodes. Since the lattice is equidistantly divided x = y = h where h = 1 = 0.25. 4 Discretization of the nodes and boundary conditions using centered nite dierence method Tij+1 2Tij + Tij1 2T = x2 h2 2T Tij +1 2Tij + Tij 1 = y 2 h2
j 1 T T j +1 yi = i y 2h
B. C. 1:
i = 0, 1, 2, 3, 4
B. C. 2:
i = 0, 1, 2, 3, 4
B. C. 3: B. C. 4:
i T (0, y ) = 0 T1 = 0,
i = 0, 1, 2, 3, 4 i = 0, 1, 2, 3, 4
i T (1, y ) = f (y ) T5 = f (yi ),
Node at (i,j ), i = 2, 3, 4 and j = 1, 2, 3, 4, 5: Tij+1 2Tij + Tij1 Tij +1 2Tij + Tij 1 + =0 h2 h2 The equations are linear regardless of the format of f (y ), so Jacobi or Gauss-Seidal are applicable to solve the solution. (b) Use the method of separation of variables to compute an analytic series solution for the above problem. This is an elliptic PDE 2T 2T + =0 x2 y 2 Separation of variables
T (x, y ) =
n=1
Tn (x, y ) =
n=1
Xn (x)Yn (y )
Substitute back into the PDE Xn (x)Yn (y ) + Xn (x)Yn (y ) = 0 i. for Yn (y ) Xn (x) Y (x) = n = const. = 2 n Xn (x) Yn (x)
Yn (y ) + 2 n Yn (y ) = 0 D = b2 4ac = 42 n < 0
For this second-order ODE, a = 1, b = 0, c = 2 n The general solution Yn (y ) is Yn (y ) = An sin(n y ) + Bn cos(n y ) The derivative of Yn (y ) is Yn (y ) = An n sin(n y ) + Bn n cos(n y ) For B. C. 1:
T (x, 0) = Xn (x)Yn (0) = 0 y n=1
Yn (0) = [An n sin(0) + Bn n cos(0)] = 0 Bn = 0 Thus Yn (y ) = An cos(n y ) For B. C. 2: T (x, 1) = Xn (x)Yn (1) = 0 y n=1 n = 1, 2,
For B. C. 3: T (0, y ) =
n=1
Xn (0)Yn (y ) = 0
For B. C. 4: T (1, y ) =
n=1
Xn (1)Yn (y ) = f (y )
n=1
Xn (1)Yn (y ) =
n=1
1 , m=n
m=n
1 0 i=1
=
i=1
2Ai Ci sinh(i )
T (x, y ) = 2
n=1
1 0
2. Consider the following wave equation subject to external force: 2v 2v 2 = f (x, t) t2 x where f (x, t) denotes a nonlinear function of space and time, subject to the following boundary and initial conditions: v v (0, t) = 0, (1, t) = 0 x x v (x, 0) = 0, v (x, 0) = v0 t
(a) The solution, v (x, t), will be computed using the centered nite dierence method for spatial discretization and the explicit Euler method for integration in time. Set up the grid in (x, t) dimensions, with (i, l) serving as local indices, as shown below:
l=2
1 l=1 1
i1 i i+1 i1 i i+1
N N
Use 3 equidistant interior nodes in the x direction (i.e. i = 1, . . . , 5) and show the exact 2 form of all equations needed to compute, vi for i = 2, 3, 4. (b) When f (x, t) = 0, use the method of separation of variables to compute an analytic series solution for the above problem. Solution: (a) In the gure below, l = 0, i = 0, 6 are ctitious nodes due to the initial condition at t = 0 and the boundary conditions at x = 0 and x = 1. The black dots in the gures l denote the unknown nodes. The unknown variable is vi , where the upper subindex denotes t-coordinate and the lower subindex denotes x-coordinate.
vil
t
1 l=0 i=1
Since the lattice is equidistantly divided x = h = 0.25. where h = 1 4 Discretization of the nodes and boundary conditions using centered nite dierence method
l l l vi 2v +1 2vi + vi1 = x2 h2 l v l vi v 1 = i+1 x 2h l+1 l1 l 2v vi 2vi + vi = t2 t2 l1 v v l+1 vi = i t 2t
B. C. 1: B. C. 2: I. C. 1: I. C. 2:
v l l , = v2 (0, t) = 0 v0 x v l l = v6 , (1, t) = 0 v4 x
1 = 0, v (x, 0) = 0 vi
i = 0, 1, 2, 3, 4 i = 0, 1, 2, 3, 4 i = 0, 1, 2, 3, 4 i = 0, 1, 2, 3, 4
where xi = (i 1)h and t1 = 0. 2 So the exact form of the equations needed to solve vi is
2 2vi 1 2v0 t 2 = f ((i 1)h, 0) vi = ( f ((i 1)h, 0) + v0 )t t 2
(b) When f (x, t) = 0, use the method of separation of variables to compute an analytic series solution for the above problem. This is an hyperbolic PDE 2v 2v 2 = f (x, t) f (x, t) = 0 t2 x Separation of variables
v (x, t) =
n=1
vn (x, t) =
n=1
Xn (x)Tn (t)
Substitute back into the PDE Xn (x)Tn (t) Xn (x)Tn (t) = 0 Xn (x) T (t) = n = 2 n Xn (x) Tn (t)
i. for Xn (x)
The general solution Xn (x) is Xn (x) = An cos(n x) + Bn sin(n x) The derivative of Xn (x) is Xn (x) = An n sin(n x) + Bn n cos(n x) For B. C. 1:
v (0, t) = Xn (0)Tn (t) = 0 x n=1
Xn (1) = [An n sin(n )] = 0 sin(n ) = 0 n = n, Thus Xn (x) = An cos(nx) ii. for Tn (t) Tn (t) 2 n Tn (t) = 0 D = b2 4ac = 42 n < 0 The general solution Tn (t) is Tn (t) = Cn cos(n t) + Dn sin(n t) The derivative of Tn (t) is Tn (t) = Cn n sin(n t) + Dn n cos(n t)
n = 1, 2,
For B. C. 3: v (x, 0) =
n=1
Xn (x)Tn (0) = 0
n=1
Xn (x)Tn (0) =
n=1
nAn Dn cos(nx) = v0
cos(nx) cos(mx)dx =
1 , m=n
m=n
1 0 i=1
=
i=1
iAi Di
cos(iy ) cos(nx)dx
1 0
cos2 (nx)dx + 0 +
v0 cos(nx)dx =
3. Use separation of variables to solve the following heat equation problem analytically: T 2T = t x2 subject to the following initial and boundary conditions T (, t) = 0, x where f (x) is a known nonlinear function of x. Solution: This is an parabolic PDE 2T 2T = t x2 Separation of variables T (0, t) = 0,
T (x, 0) = f (x)
T (x, t) =
n=1
Tn (x, t) =
n=1
Xn (x)tn (t)
The general solution Xn (x) is Xn (x) = An cos(n x) + Bn sin(n x) The derivative of Xn (x) is Xn (x) = An n sin(n x) + Bn n cos(n x)
For B. C. 1: T (0, t) =
n=1
2 1 2 t
n = 0, 1, 2,
For I. C. 1: T (x, 0) =
n=1
n=1
Xn (x)tn (0) =
1 1 2 sin (n + )x sin (m + )x = 2 2 0
pi , m=n
m=n
=
i=1
Bi C i
1 1 sin (i + )x sin (n + )x dx 2 2
0
1 sin2 (n + )x dx + 0 + 2
Bn Cn 2 2
0
1 f (x) sin (n + )x dx 2
10