New technique for calculating elasticity could aid design of new materials