Nonlinear elastic analysis of 2D materials of arbitrary symmetries with application to black phosphorus