Determining Stiffness Matrix by the Adjoint Method