Elasticity of Proteins and Polymers from Molecular Dynamics Simulations