This exercise considers the problem of finding the axial displacement
() of an elastic bar, which is subject to a body force() as well as a force
r
on the right end
= 1. At the left end, where
= 0, the bar is fixed, which means that
(0) = 0. The potential energy is
where
is a positive constant.
(a) Suppose the grid points are
0
= 0,
1
=
,
2
= 2, ··· ,
n+1
= 1, where
= 1/( + 1). Writing
write down the composite trapezoidal approximation for .
(b) As with the string example, use a centered second-order approximation for
x
at
1,
2, ··· ,
n
, and a first-order approximation for
x
at
0
and
n+1. Using these with the result from part (a), what is the resulting approximation for ? Note that like the string example,
0
= 0, but unlike the string example,
n+1
is an unknown in this problem.
(c) What is the resulting matrix equation that must be solved to find the minimum for the approximation for found in part (b)?
(d) The minimum of
from part (b) can be found using the MATLAB command
, where
is the approximation from part (b) and
U
is an ( + 1)-vector containing a starting guess for (
1,
2, ··· ,
n+1)
T
. What would be a good, simple, and nonzero choice for
U, and why is it a good choice?
(e) If
= 1,
r
= 1,
=
4, then the exact solution is
=
(
5+24)/30. On the same axis, plot the exact solution and the numerical solution when using 32 grid points. In doing this, explain how you found the numerical solution (using part (c) or part (d)), and why.
(f) The exact solution of the problem satisfies the boundary condition
So, the question is, does your numerical solution satisfy this condition. Using the first-order approximation you used in part (b), from the numerical solution calculate
x
(1), using
= 20, 40, 80, 160. Are your answers consistent with the statement that the solution satisfies the above condition?