Mechanical Engineering homework help. [20 points] Consider the unsteady heat equation:

∂T

∂t =

∂

2T

∂x2

+ (π

2 − 1)e

−2t

sin(πx); 0 ≤ x ≤ 1; t ≥ 0 (1)

with the conditions:

T(0, t) = T(1, t) = 0; T(x, 0) = sin(πx) (2)

The equation is solved over the x domain 0 ≤ x ≤ 1. The conditions in time (t) and space (x) are

given above.

1. [3 points] What is the order of the PDE? What are the dependent ant independent variables?

Is it linear/non-linear, homogeneous/non-homogeneous?

2. [2 points] What is the type of the PDE (elliptic, parabolic, hyperbolic)?

3. [2 points] What type of problem do we have (initial value or boundary value) for each

independent variable, i.e. in time and in space? How do you know?

4. [13 points] You are to solve this problem using Forward Differencing for the time derivative

and Centered Differencing for space derivative. Discretize your domain into N equally spaced

points, where N is an integer that can be easily changed in the program.

(a) [5 points] Derive finite difference equation for temperature with proper index notation

in time and space. Use ∆x for grid spacing and ∆t for time step.

(b) [3 points] For the methods mentioned, can you choose ∆t and ∆x completely independently? If not, why not? What are the restrictions in choosing the step sizes? Hint:

Use positivity of coefficients.

(c) [3 points] Choosing 21 grid points (including the boundary points), and ∆t = 0.001

solve for the temperature to steady state. Note that steady state will be obtained at

very large value of time. Let’s assume that happens at t = 10. So, setup your solver

to obtain solutions up to t = 10. Write a computer program for this and provide this

program. Within the program, plot the temperature distribution T(x) (i.e. T on y-axis

and x on x-axis going between 0 and 1), for t = 0, t = 0.5, t = 1, t = 2, and t = 10.

Provide these figures as output.1

(d) [2 points] Verify that the time-evolution of your solution is correct. To do this, you will

have to reduce your step size (∆x) and time-steps (∆t) and rerun your program. Do this

for 2 different finer grid resolutions and compare your solutions for the same time-level.

1Note this will give five curves for T versus x. The intermediate times could be different from the ones mentioned

(i.e. you could plot them at 0, 1, 2, 3, 4, 10 etc., whatever is easier, as long as you plot the initial curve (t=0) and

the final (t=10)).

2