Inverse Problems for the Heat Equation Using Conjugate Gradient Methods