Statics and dynamics of nanorods embedded in an elastic medium: Nonlocal elasticity and lattice formulations