You are on page 1of 1

ME 471 Textbook Problem 5.

8 Steady State Solution

The exact solution to this problem requires a fairly large m-file. To keep things simple, you can
use the steady state (t ) solution u(x) = 100 + 300x 50x2 to check your work. Your time
dependent solution should approach this function after approximately 175 s. As a further check on
your work, you should obtain the values

u2 = 56.0297
for the values of the solution at x = 0, 1, 3 and time 1 using t = 1 (these are the values suggested
by the textbook) . If you use evenly spaced points xi = (i 1)/3, i = 1, 2, 3, 4 as in the example
file, then with t = 1 at time 1 you should find the values

u2 56.9557


Of course, with a properly modified example file you can use a finer grid and obtain a smoothly
varying solution. If you plot the time evolution, I suggest you make a plot only every 25 or 50 time
steps. To plot every 50 steps you can use
if(rem(k, 50) == 0)plot(xvec, uold); end,
where k is the time step counter, uold the solution, and xvec the vector of grid points at which
uold is defined.