Towards an acoustoelastic theory for measurement of residual stress