Sample Quiz 3 problems: BVPs#

Problem 1: Finite difference method#

The temperature distribution T(r) in an annular fin of inner radius r1 and outer radius r2 is described by the equation

(24)#rd2Tdr2+dTdrrm2(TT)=0,

where r is the radial distance from the centerline (the independent variable) and m2 is a constant that depends on the heat transfer coefficient, thermal conductivity, and thickness of the annulus. Assuming we choose a spatial step size Δr,

Annular fin

Fig. 1 Annular fin#

a.) Write the finite-difference representation of the ODE (that applies at a location ri), using central differences.

b.) Based on the last part, write the recursion formula.

c.) The boundary condition at the outer radius r=r2 is described by convection heat transfer:

(25)#kdTdr|r=r2=h[T(r=r2)T].

Write the boundary condition at r=r2 in recursion form (i.e., the equation you would implement into your system of equations to solve for temperature).

Solution#

a.) Replace the derivatives in the given ODE with finite differences, and replace any locations with the i location:

(26)#riTi12Ti+Ti+1Δr2+Ti+1Ti12Δrrim2(TiT)=0

or

(27)#ri(Ti12Ti+Ti+1)+Δr2(Ti+1Ti1)rim2Δr2(TiT)=0

b.) Rearrange and combine terms:

(28)#ri(Ti12Ti+Ti+1)+Δr2(Ti+1Ti1)rim2Δr2(TiT)=0ri(Ti12Ti+Ti+1)+Δr2(Ti+1Ti1)rim2Δr2Ti=rim2Δr2T(riΔr2)Ti1+(2ririm2Δr2)Ti+(ri+Δr2)Ti+1=rim2Δr2T

c.) We can use a backward difference to approximate the dT/dr term. Tn represents the temperature at node n where rn=r2:

(29)#kTnTn1Δr=h(TnT)k(TnTn1)=hΔr(TnT)kTn1(k+hΔr)Tn=hΔrT

Problem 2: eigenvalue#

Given the equation y+9λ2y=0 with y(0)=0 and y(2)=0,

a.) Find the expression that gives all eigenvalues (λ). What is the eigenfunction?

b.) Calculate the principal eigenvalue.

Solution#

a.)

(30)#y(x)=Asin(3λx)+Bcos(3λx)Apply BCs: y(x=0)=0=Asin(0)+Bcos(0)=BB=0y(x)=Asin(3λx)y(x=2)=0=Asin(3λ2)A0 so sin(3λ2)=sin(6λ)=06λ=nπn=1,2,3,λ=nπ6n=1,2,3,,

The eigenfunction is then the solution function associated with an eigenvalue:

(31)#yn=Ansin(nπx2)n=1,2,3,,

b.) The principal eigenvalue is just that associated with n=1:

(32)#λp=λ1=π6

Problem 3: shooting method#

Use the shooting method to solve the boundary value problem

(33)#y4y=0

where y(0)=0 and y(1)=3. Find the initial value of y (meaning, y(0)) that satisfies the given boundary conditions. Use the forward Euler method with a step size of Δx=0.5.

Solution#

First decompose into two 1st-order ODEs:

(34)#z1=y=z2z2=y=4z1

with BCs z1(x=0)=z1,1=0 and z1(x=1)=z1,3=3, we do not know y(0)=z2(x=0)=z2,1=?

Try some guess #1: y(0)=0=z2(0), with the forward Euler method:

(35)#z1,2=z1(0.5)=z1(0)+z2(0)0.5=0z2,2=z2(0.5)=z2(0)+(4z1(0))0.5=0z1,3=z1(1.0)=z1(0.5)+z2(0.5)0.5=0solution 1z2,3=z2(1.0)=z2(0.5)+(4z1(0.5))0.5=0

so for solution 1: y(1)=03.

For guess #2: y(0)=2=z2(0), with the forward Euler method:

(36)#z1(0.5)=z1(0)+z2(0)0.5=1.0z2(0.5)=z2(0)+(4z1(0))0.5=2.0z1(1.0)=z1(0.5)+z2(0.5)0.5=2.0solution 2z2(1.0)=z2(0.5)+(4z1(0.5))0.5=4.0

so for solution 1: y(1)=23.

For guess #3, we can interpolate:

(37)#m=guess 1guess 2solution 1solution 2=0202=1guess 3=guess 2+m(targetsolution 2)=2+1(32)=3

then, use this guess:

(38)#z1(0.5)=z1(0)+z2(0)0.5=1.5z2(0.5)=z2(0)+(4z1(0))0.5=3.0z1(1.0)=z1(0.5)+z2(0.5)0.5=3.0solution 3z2(1.0)=z2(0.5)+(4z1(0.5))0.5=6.0

so for solution 3: y(1)=3 which is the target.

So our answer is y(0)=3.