Real-time adaptive optics with pyramid wavefront sensors: part I. A theoretical analysis of the pyramid sensor model. (21st March 2019)